1- /*
2- * This file was generated by the Gradle 'init' task.
3- */
4-
1+ buildscript {
2+ ext {
3+ TESTNG_VERSION = ' 7.3.0'
4+ CUCUMBER_VERSION = ' 6.7.0'
5+ THREAD_COUNT = 5
6+ APPLICATION_URL = ' http://bstackdemo.com/'
7+ APPLICATION_LOCAL_URL = ' http://localhost:3000/'
8+
9+ }
10+ }
511plugins {
612 id ' java'
7- id ' maven-publish'
813}
9-
14+ group ' com.dineshv'
15+ version ' 1.0-SNAPSHOT'
1016repositories {
11- mavenLocal()
12- maven {
13- url = uri(' https://repo.maven.apache.org/maven2/' )
14- }
17+ mavenCentral()
1518}
16-
1719dependencies {
18- implementation ' org.seleniumhq.selenium:selenium-java:3.11.0'
19- implementation ' com.browserstack:browserstack-local-java:1.0.6'
20- implementation ' com.googlecode.json-simple:json-simple:1.1.1'
21- implementation ' org.apache.commons:commons-lang3:3.11'
22- implementation ' io.qameta.allure:allure-testng:2.12.0'
23- implementation ' org.slf4j:slf4j-api:1.7.30'
24- implementation ' ch.qos.logback:logback-classic:1.2.3'
25- implementation ' org.testng:testng:6.14.3'
26- implementation ' info.cukes:cucumber-java:1.2.5'
27- implementation ' info.cukes:cucumber-jvm-deps:1.0.5'
28- implementation ' info.cukes:cucumber-testng:1.2.5'
29- implementation ' net.masterthought:cucumber-reporting:3.8.0'
30- testImplementation ' io.github.bonigarcia:webdrivermanager:4.3.1'
20+ testImplementation group : ' org.testng' , name : ' testng' , version : " $TESTNG_VERSION "
21+ testImplementation group : ' io.cucumber' , name : ' cucumber-java' , version : " $CUCUMBER_VERSION "
22+ testImplementation group : ' io.cucumber' , name : ' cucumber-core' , version : " $CUCUMBER_VERSION "
23+ testImplementation group : ' io.cucumber' , name : ' cucumber-testng' , version : " $CUCUMBER_VERSION "
24+ testImplementation group : ' io.cucumber' , name : ' cucumber-picocontainer' , version : " $CUCUMBER_VERSION "
25+ implementation group : ' org.seleniumhq.selenium' , name : ' selenium-java' , version : ' 3.141.5'
26+ implementation group : ' com.googlecode.json-simple' , name : ' json-simple' , version : ' 1.1.1'
27+ implementation group : ' com.browserstack' , name : ' browserstack-local-java' , version : ' 1.0.6'
28+ implementation group : ' org.apache.commons' , name : ' commons-lang3' , version : ' 3.12.0'
29+ implementation group : ' com.google.guava' , name : ' guava' , version : ' 26.0-jre'
3130}
32-
33- group = ' browserstack'
34- version = ' 0.0.1-SNAPSHOT'
35- description = ' browserstack-examples-cucumber-testng'
36- java. sourceCompatibility = JavaVersion . VERSION_1_8
37-
38- publishing {
39- publications {
40- maven(MavenPublication ) {
41- from(components. java)
42- }
31+
32+ tasks. register(' on-prem' , Test ) {
33+ useTestNG() {
34+ suites ' src/test/resources/conf/TestNG_Single.xml'
35+ }
36+ if (System . getProperty(" test-name" ) != null ) {
37+ systemProperty(" cucumber.filter.name" , System . getProperty (" test-name" ))
38+ } else {
39+ systemProperty(" cucumber.filter.name" , " End to End Scenario" )
4340 }
41+ scanForTestClasses = false
42+ testLogging. showStandardStreams(true )
43+ ignoreFailures = false
44+ failFast = true
45+ systemProperty " environment" , " local"
46+ systemProperty " application_endpoint" , " $APPLICATION_URL "
4447}
45-
46- tasks. named(' test' ) {
47- useTestNG()
48+ tasks. register(' on-prem-suite' , Test ) {
49+ useTestNG() {
50+ suites ' src/test/resources/conf/TestNG_Single.xml'
51+ }
52+
53+ scanForTestClasses = false
54+ testLogging. showStandardStreams(true )
55+ ignoreFailures = false
56+ failFast = true
57+ systemProperty " environment" , " local"
58+ systemProperty " application_endpoint" , " $APPLICATION_URL "
59+
4860}
49-
50- task on_prem (type : Test ) {
51- useTestNG()
52- if (project. hasProperty(' test' )) {
53- include ' **/' + project. property(' test' )+ ' .class'
54- }else {
55- include ' **/OrderTest.class'
61+ tasks. register(' docker' , Test ) {
62+ useTestNG() {
63+ suites ' src/test/resources/conf/TestNG_Single.xml'
64+ }
65+ if (System . getProperty(" test-name" ) != null ) {
66+ systemProperty(" cucumber.filter.name" , System . getProperty (" test-name" ))
67+ } else {
68+ systemProperty(" cucumber.filter.name" , " End to End Scenario" )
5669 }
57- testLogging {
58- events " PASSED" , " FAILED" , " SKIPPED"
70+ scanForTestClasses = false
71+ testLogging. showStandardStreams(true )
72+ ignoreFailures = false
73+ failFast = true
74+ systemProperty " environment" , " docker"
75+ systemProperty " application_endpoint" , " $APPLICATION_URL "
76+
77+ }
78+ tasks. register(' docker-parallel' , Test ) {
79+ useTestNG() {
80+ suites ' src/test/resources/conf/TestNG_Parallel.xml'
81+ }
82+
83+ scanForTestClasses = false
84+ testLogging. showStandardStreams(true )
85+ ignoreFailures = false
86+ failFast = true
87+ systemProperty " environment" , " docker"
88+ systemProperty " application_endpoint" , " $APPLICATION_URL "
89+
90+ }
91+ tasks. register(' bstack-single' , Test ) {
92+ useTestNG() {
93+ suites ' src/test/resources/conf/TestNG_Single.xml'
94+ }
95+ if (System . getProperty(" test-name" ) != null ) {
96+ systemProperty(" cucumber.filter.name" , System . getProperty (" test-name" ))
97+ } else {
98+ systemProperty(" cucumber.filter.name" , " End to End Scenario" )
5999 }
100+ scanForTestClasses = false
101+ testLogging. showStandardStreams(true )
102+ ignoreFailures = false
103+ failFast = true
104+ systemProperty " environment" , " remote"
105+ systemProperty " application_endpoint" , " $APPLICATION_URL "
106+
107+ }
108+ tasks. register(' bstack-local' , Test ) {
109+ useTestNG() {
110+ suites ' src/test/resources/conf/TestNG_Single.xml'
111+ }
112+ if (System . getProperty(" test-name" ) != null ) {
113+ systemProperty(" cucumber.filter.name" , System . getProperty (" test-name" ))
114+ } else {
115+ systemProperty(" cucumber.filter.name" , " End to End Scenario" )
116+ }
117+ scanForTestClasses = false
118+ testLogging. showStandardStreams(true )
119+ ignoreFailures = false
120+ failFast = true
121+ systemProperty " environment" , " remote"
122+ systemProperty " application_endpoint" , " $APPLICATION_LOCAL_URL "
123+ systemProperty " caps_type" , " local"
124+ systemProperty " env_cap_id" , " 2"
125+
126+ }
127+ tasks. register(' bstack-local-parallel' , Test ) {
128+ useTestNG() {
129+ suites ' src/test/resources/conf/TestNG_Parallel.xml'
130+ }
131+ scanForTestClasses = false
132+ testLogging. showStandardStreams(true )
133+ ignoreFailures = false
134+ failFast = true
135+ systemProperty " environment" , " remote"
136+ systemProperty " application_endpoint" , " $APPLICATION_LOCAL_URL "
137+ systemProperty " caps_type" , " local"
138+
139+
140+ }
141+ tasks. register(' bstack-parallel' , Test ) {
142+ useTestNG() {
143+ suites ' src/test/resources/conf/TestNG_Parallel.xml'
144+
145+ }
146+ scanForTestClasses = false
147+ testLogging. showStandardStreams(true )
148+ ignoreFailures = false
149+ failFast = true
150+ systemProperty " environment" , " remote"
151+ systemProperty " application_endpoint" , " $APPLICATION_URL "
152+
153+
154+
155+
156+ }
157+ tasks. register(' bstack-local-parallel-browsers' , Test ) {
158+ useTestNG() {
159+ suites ' src/test/resources/conf/TestNG_MultipleParallel.xml'
160+ }
161+ scanForTestClasses = false
162+ testLogging. showStandardStreams(true )
163+ ignoreFailures = false
164+ failFast = true
165+ systemProperty " environment" , " remote"
166+ systemProperty " application_endpoint" , " $APPLICATION_LOCAL_URL "
167+
168+ }
169+ tasks. register(' bstack-parallel-browsers' , Test ) {
170+ useTestNG() {
171+ suites ' src/test/resources/conf/TestNG_MultipleParallel.xml'
172+ }
173+ scanForTestClasses = false
174+ testLogging. showStandardStreams(true )
175+ ignoreFailures= false
176+ failFast = true
177+ systemProperty " environment" , " remote"
178+ systemProperty " application_endpoint" , " $APPLICATION_URL "
179+
180+ }
181+ tasks. register(' bstack-parallel-mobile' , Test ) {
182+ useTestNG() {
183+ suites ' src/test/resources/conf/TestNG_Parallel.xml'
184+ }
185+ scanForTestClasses = false
186+ testLogging. showStandardStreams(true )
187+ ignoreFailures = false
188+ failFast = true
189+ systemProperty " environment" , " remote"
190+ systemProperty " application_endpoint" , " $APPLICATION_URL "
191+ systemProperty " caps_type" , " mobile"
192+ systemProperty " env_cap_id" , " 1"
193+
194+ }
0 commit comments