aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
blob: abc76754448152ad6c0663014bbef39c435cdfe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
plugins {
    id 'java'
    id 'io.qameta.allure' version '2.9.3'
}
apply plugin: 'io.qameta.allure'
group 'org.onap.portalng.e2e'
version '1.0'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'io.cucumber:cucumber-junit:7.3.3'
    implementation 'io.cucumber:cucumber-java:7.3.3'
    implementation 'com.codeborne:selenide:6.14.0'
    implementation 'io.qameta.allure:allure-cucumber7-jvm:2.20.1'
    implementation 'net.serenity-bdd:serenity-cucumber:3.4.3'
    implementation 'net.serenity-bdd:serenity-core:3.4.3'
    implementation 'net.serenity-bdd:serenity-junit:3.4.3'
    implementation 'io.qameta.allure:allure-selenide:2.20.1'
    implementation 'org.assertj:assertj-core:3.22.0'

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter:5.8.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-params:5.8.2'
    testImplementation 'org.junit.vintage:junit-vintage-engine:5.8.2'
}

configurations {
    cucumberRuntime {
        extendsFrom testImplementation
    }
}

allprojects {
    repositories {
        mavenLocal()
        mavenCentral()
    }

    apply plugin: 'idea'
    apply plugin: 'java'
    apply plugin: 'java-library'
    apply plugin: 'io.qameta.allure'

    java {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }

    test {
        useJUnitPlatform()
        testLogging.showStandardStreams = true
        systemProperty "cucumber.filter.tags", System.getProperty("cucumber.filter.tags")
    }
    gradle.startParameter.continueOnFailure = true
}

tasks.register('cucumber') {
    cleanupAllure
    dependsOn assemble, testClasses
    doLast {
        javaexec {
            systemProperties['selenide.headless'] = 'false'
            main = "io.cucumber.core.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = [
                    '--plugin', 'pretty',
                    '--plugin', 'io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm',
                    '--glue', 'org.onap.portalng.e2e',
                    'src/test/resources']
        }
    }
}

tasks.register('cucumberLocalDebug') {
    cleanupAllure
    dependsOn assemble, testClasses
    doLast {
        javaexec {
            systemProperties['selenide.headless'] = 'false'
            main = "io.cucumber.core.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = [
                    '--plugin', 'pretty',
                    '--plugin', 'io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm',
                    '--glue', 'org.onap.portalng.e2e',
                    '--tags', '@debug',
                    'src/test/resources']
        }
    }
}

tasks.register('cucumberCli') {
    cleanupAllure
    dependsOn assemble, testClasses
    doLast {
        javaexec {
            systemProperties['selenide.headless'] = 'true'
            main = "io.cucumber.core.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = [
                    '--plugin', 'pretty',
                    '--plugin', 'io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm',
                    '--glue', 'org.onap.portalng.e2e',
                    'src/test/resources']
        }
    }
}

tasks.register('cleanupAllure') {
    delete "allure-results"
}