Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- mavenCentral()
- jcenter()
- }
- dependencies {
- classpath "org.codehaus.gpars:gpars:1.2.1"
- classpath "io.qameta.allure:allure-gradle:2.3"
- }
- }
- plugins {
- id 'io.qameta.allure' version "2.5"
- }
- allure {
- version = '2.2.1'
- autoconfigure = true
- aspectjweaver = true
- }
- apply from: 'environment.gradle'
- apply plugin: 'application'
- apply plugin: 'java'
- apply plugin: 'idea'
- import groovyx.gpars.GParsPool
- version = '1.0'
- [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- mainClassName = 'ru.crystals.settester.SetTester'
- def suitesPath = "build/suites/"
- def testSuite = hasProperty('test_suite') ? test_suite : 'suite_robot.xml'
- def testGroup = hasProperty('test_group') ? test_group : ''
- def htmlCucumberReport = hasProperty('cucumber_html') ? cucumber_html.toBoolean() : true
- def junitCucumberReport = hasProperty('cucumber_junit') ? cucumber_junit.toBoolean() : true
- def jsonCucumberReport = hasProperty('cucumber_json') ? cucumber_json.toBoolean() : true
- def cucumberTags = hasProperty('cucumber_tags') ? cucumber_tags : ''
- def inversionTags = []
- repositories {
- // Репозиторий SetMachine:
- maven { url "https://artifactory.setmachine.ru:8443/repository/sm-public/" }
- maven { url "https://artifactory.setmachine.ru:8443/repository/set10-api-public" }
- maven {
- url 'http://artifactory.crystals.ru:8081/artifactory/remote-repos'
- credentials { username 'crystal'; password 'pdF7WUzBazTV' }
- }
- maven {
- url 'http://dl.bintray.com/epam/reportportal'
- }
- mavenCentral()
- jcenter()
- }
- configurations {
- cucumberRuntime {
- extendsFrom testRuntime
- }
- }
- def defaultEncoding = 'UTF-8'
- dependencies {
- loadLibs()
- compile server_libs.blazeds
- compile server_libs.jcifs
- compile server_libs.jee
- compile server_libs.guava
- compile libs.hibernate
- compile libs.jdbc
- compile libs.junit
- compile project(':SetRetail10_Cash_OSGi:OSGiDataStruct')
- compile project(':SetRetail10_Cash:modules:CashDS')
- compile project(':SetRetail10_Commons:DataStructsModule')
- compile project(':SetRetail10_Commons:goods-catalog-schema')
- compile project(':SetRetail10_Commons:SET-Topology-API')
- compile project(':SetRetail10_Commons:SET-Cards-Coupons')
- compile project(':SetRetail10_Commons:SET-Cards-PresentCards')
- compile project(':SetRetail10_Commons:SET-Report-API')
- compile project(':SetRetail10_Commons:SET-OperDay-API')
- compile project(':SetRetail10_Commons:PaymentsBankCardEntity')
- compile project(':SetRetail10_Commons:PaymentsBonusCardEntity')
- compile project(':SetRetail10_Commons:PaymentsGiftCardEntity')
- compile project(':SetRetail10_Commons:Loyal:SET-LoyalStructures')
- compile project(':SetRetail10_Commons:SET-Report')
- compile project(':SetRetail10_Commons:SET-Scales-Products-Exporter-API')
- compile project(':SetRetail10_Server:OperDay:SET-OperDay')
- compile project(':SetRetail10_Server:OperDay:SET-OperDay-MainCash')
- compile project(':SetRetail10_Server:RetailX:SET-Printers')
- compile project(':SetRetail10_Server:RetailX:SET-Producer')
- compile project(':SetRetail10_Server:RetailX:SET-Products')
- compile project(':SetRetail10_Server:RetailX:SET-ProductTypeManager')
- compile project(':SetRetail10_Server:RetailX:ServerDS')
- compile project(':SetRetail10_Server:Cards:Cards-SET-Cards-Coupons')
- compile project(':SetRetail10_Server:Cards:SET-Cards-PresentCards-DS')
- compile project(':SetRetail10_Server:Discounts:SET-Discounts')
- compile project(':SetRetail10_Server:RetailX:SET-Scales-Tech')
- compile project(':SetRetail10_Server:RetailX:SET-Scales-Tech:set-scales-tech-ejb')
- compile project(':SetRetail10_Server:Cards:SET-Cards-Coupons')
- compile project(':SetRetail10_Server:RetailX:SET-Scales-Products-Exporter')
- compile project(':SetRetail10_Server:Discounts:FLMS-Solution:FLMS-DiscountProcessing')
- compile project(':SetRetail10_Utils:CrystalAMF')
- compile project(':SetRetail10_Utils:ServerHttpClient')
- compile project(':SetRetail10_Commons:PersistenceUnits')
- compile project(':SetRetail10_Cash:modules:StockBalance1C')
- compile project(':SetRetail10_Server:RetailX:SET-ExternalSystems')
- compile project(':ExternalPaymentPlugin')
- compile project(':ExternalLoyaltyPlugin')
- compile project(':ExternalCardPlugin')
- compile 'org.apache.commons:commons-lang3:3.0'
- compile 'com.xebialabs.overthere:overthere:4.4.1'
- compile 'org.seleniumhq.selenium:selenium-java:2.53.0'
- compile 'org.springframework:spring:2.5.6'
- compile 'com.itextpdf:itextpdf:5.5.6'
- compile 'org.apache.velocity:velocity:1.7'
- compile 'com.google.inject:guice:4.0-beta5'
- compile 'org.jdom:jdom:2.0.2'
- compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.2'
- compile 'io.rest-assured:rest-assured:3.0.5'
- compile 'info.cukes:cucumber-java:1.2.4'
- compile 'com.lowagie:itext:2.1.7'
- compile 'org.testng:testng:6.9.10'
- compile 'org.apache.poi:poi:3.16'
- compile 'org.apache.poi:poi-ooxml:3.16'
- compile 'ru.yandex.qatools.ashot:ashot:1.5.4'
- compile 'com.epam.reportportal:agent-java-testng:3.0.6'
- compile 'com.epam.reportportal:logger-java-logback:3.0.0'
- compile 'com.epam.reportportal:logger-java-log4j:3.0.2'
- compile 'com.epam.reportportal:agent-java-cucumber:3.0.1'
- testCompile("org.uncommons:reportng:1.1.4") { exclude group: "org.testng", module: "testng" }
- testCompile 'info.cukes:cucumber-testng:1.2.4'
- testCompile "com.github.tomakehurst:wiremock:2.6.0"
- compileOnly 'org.projectlombok:lombok:1.16.18'
- testCompile group: 'com.shazam', name: 'shazamcrest', version: '0.11'
- }
- subprojects {
- repositories {
- // Репозитории SetMachine - там нам позволили публиковать наши артефакты:
- maven {
- url "https://artifactory.setmachine.ru:8443/repository/set10-api-public"
- }
- maven {
- url 'http://artifactory.crystals.ru:8081/artifactory/remote-repos'
- credentials { username 'crystal'; password 'pdF7WUzBazTV' }
- }
- // Репозиторий SetMachine:
- maven { url "https://artifactory.setmachine.ru:8443/repository/sm-public/" }
- mavenCentral()
- }
- apply plugin: 'java'
- //подключение конфигуратора проектов
- ext.BRANCH_ROOT_PATH = new File(rootProject.projectDir.getPath() + '/../../..').getAbsolutePath()
- apply(from: relativePath(ext.BRANCH_ROOT_PATH + '/proj_configurator.gradle'));
- // compiler properties
- compileJava {
- options.encoding = defaultEncoding
- options.debug = true
- }
- compileTestJava {
- options.encoding = defaultEncoding
- options.debug = true
- }
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
- test.enabled = false
- dependencies {
- testCompile libs.junit
- compile server_libs.guava
- compile server_libs.blazeds
- compile 'backport-util-concurrent:backport-util-concurrent:3.1'
- }
- }
- //подключение списка библиотек
- def loadLibs() {
- ext.BRANCH_ROOT_PATH = new File(rootProject.projectDir.getPath() + '/../../..').getAbsolutePath()
- project.apply(from: relativePath(ext.BRANCH_ROOT_PATH + '/SetRetail10_Cash/lib/libs.gradle'))
- project.apply(from: relativePath(ext.BRANCH_ROOT_PATH + '/SetRetail10_Server/server_libs.gradle'))
- project.apply(from: relativePath(BRANCH_ROOT_PATH + '/SetRetail10_Server/loyalty_libs.gradle'))
- }
- task copyToLib(type: Copy) {
- into "$buildDir/libs/lib"
- from configurations.runtime
- }
- task createJar(type: Jar) {
- dependsOn copyToLib
- from sourceSets.test.output
- from sourceSets.main.output
- manifest { attributes "Main-Class": "$mainClassName" }
- }
- task copySuites(type: Copy) {
- from fileTree('src/test/resources/suites').files
- from 'src/test/resources/'
- include '*.xml'
- into 'build/suites'
- }
- task copyExternalPlugins(dependsOn: project(':ExternalPaymentPlugin').tasks.jar, type: Copy) {
- from(project(':ExternalPaymentPlugin').buildDir.path + "/libs") {
- include('*.jar')
- }
- into 'src/test/resources/plugins/payments/'
- }
- project.tasks.compileJava.dependsOn copyExternalPlugins
- test {
- dependsOn copySuites
- systemProperties System.getProperties()
- testLogging.showStandardStreams = true
- useTestNG()
- options {
- useDefaultListeners = false
- //listeners << 'org.uncommons.reportng.HTMLReporter'
- listeners << 'org.uncommons.reportng.JUnitXMLReporter'
- testSuite.tokenize(',').collect {
- it = suitesPath + it
- }.each { suites it }
- includeGroups "${testGroup}"
- }
- }
- task pathingJar(type: Jar) {
- classifier 'pathing'
- doFirst {
- manifest {
- attributes "Class-Path": configurations.cucumberRuntime.files.collect {
- it.toURL().toString().replaceFirst(/file:\/+/, '/')
- }.join(' ')
- }
- }
- dependsOn configurations.runtime
- }
- task reportportal() {
- Properties props = new Properties()
- File propsFile = project.file('src/test/resources/reportportal.properties')
- props.load(propsFile.newDataInputStream())
- if (System.getProperty("rp.enable") == null) {
- System.setProperty("rp.enable", props.getProperty("rp.enable"))
- }
- System.setProperty("rp.endpoint", props.getProperty("rp.endpoint"))
- System.setProperty("rp.uuid", props.getProperty("rp.uuid"))
- if (System.getProperty("rp.launch") == null) {
- System.setProperty("rp.launch", props.getProperty("rp.launch"))
- }
- System.setProperty("rp.project", props.getProperty("rp.project"))
- }
- task cucumberInParallel() {
- def cucumberArgs = ['--plugin', 'pretty', '--glue', 'ru.crystals.settester', 'build/resources/test']
- dependsOn assemble, compileTestJava, compileJava, processResources, processTestResources, pathingJar
- def reportDirectory = file('cucumber')
- if (reportDirectory.exists()) {
- reportDirectory.deleteDir()
- }
- String[] Tags
- if (!cucumberTags.isEmpty()) {
- Tags = cucumberTags.split(',')
- } else
- Tags = ''
- for (String item : Tags) {
- inversionTags.add('--tags')
- inversionTags.add('~' + item)
- }
- doLast {
- GParsPool.withPool(Tags.length) {
- Tags.eachParallel { String tag ->
- javaexec {
- main = "cucumber.api.cli.Main"
- classpath = files(pathingJar.archivePath, sourceSets.test.output.getFiles(), sourceSets.main.output.getFiles())
- args = cucumberArgs + ['--plugin', 'html:cucumber/html-report' + tag] + ['--plugin', 'junit:cucumber/junit-report' + tag + '.xml'] + ['--plugin', 'json:cucumber/cucumber' + tag + '.json'] + ['--tags', tag]
- systemProperties System.getProperties()
- }
- }
- }
- }
- }
- task cucumberInSequence() {
- def cucumberArgs = ['--plugin', 'pretty', '--glue', 'ru.crystals.settester', 'build/resources/test']
- doLast {
- javaexec {
- main = "cucumber.api.cli.Main"
- classpath = files(pathingJar.archivePath, sourceSets.test.output.getFiles(), sourceSets.main.output.getFiles())
- args = cucumberArgs + ['--plugin', 'html:cucumber/html-report'] + ['--plugin', 'junit:cucumber/junit-report.xml'] + ['--plugin', 'json:cucumber/cucumber.json'] + inversionTags
- systemProperties System.getProperties()
- }
- }
- }
- task cucumber() {
- def cucumberArgs = ['--plugin', 'pretty', '--glue', 'ru.crystals.settester', 'build/resources/test']
- if (htmlCucumberReport) {
- cucumberArgs.addAll(['--plugin', 'html:cucumber/html-report'])
- }
- if (junitCucumberReport) {
- cucumberArgs.addAll(['--plugin', 'junit:cucumber/junit-report.xml'])
- }
- if (jsonCucumberReport) {
- cucumberArgs.addAll(['--plugin', 'json:cucumber/cucumber.json'])
- }
- if (!cucumberTags.isEmpty()) {
- cucumberArgs.addAll(['--tags', cucumberTags])
- }
- def reportDirectory = file('cucumber')
- if (reportDirectory.exists()) {
- reportDirectory.deleteDir()
- }
- cucumberArgs.addAll(['--plugin', 'com.epam.reportportal.cucumber.ScenarioReporter'])
- dependsOn assemble, compileTestJava, compileJava, processResources, processTestResources, pathingJar, reportportal
- doLast {
- javaexec {
- main = "cucumber.api.cli.Main"
- classpath = files(pathingJar.archivePath, sourceSets.test.output.getFiles(), sourceSets.main.output.getFiles())
- args = cucumberArgs
- systemProperties System.getProperties()
- }
- }
- }
- task prepareEnv(type: Test) {
- systemProperties System.getProperties()
- testLogging.showStandardStreams = true
- dependsOn destroyVagrantMachine, changeVagrantConfig, runVagrantMachine, copySuites
- useTestNG()
- options {
- useDefaultListeners = false
- //listeners << 'org.uncommons.reportng.HTMLReporter'
- listeners << 'org.uncommons.reportng.JUnitXMLReporter'
- suites suitesPath + "suite_robot_config_server.xml"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement