Skip to content

Commit ad5b6f0

Browse files
committed
updated docker logic
update pom
1 parent 48cd06b commit ad5b6f0

3 files changed

Lines changed: 38 additions & 34 deletions

File tree

docker-compose.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
11
version: "3"
22
services:
33
chrome:
4-
image: selenium/node-chrome:4.0.0
5-
volumes:
6-
- /dev/shm:/dev/shm
4+
image: selenium/node-chrome:3.141.59-20210311
75
depends_on:
86
- selenium-hub
7+
volumes:
8+
- /dev/shm:/dev/shm
99
environment:
10-
- SE_EVENT_BUS_HOST=selenium-hub
11-
- SE_EVENT_BUS_PUBLISH_PORT=4442
12-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
1310
- SCREEN_WIDTH=2880
1411
- SCREEN_HEIGHT=1800
12+
- HUB_HOST=selenium-hub
13+
- HUB_PORT=4444
14+
- NODE_MAX_INSTANCES=5
15+
- NODE_MAX_SESSION=5
1516
links:
1617
- selenium-hub:hub
17-
scale: 4
18-
1918
firefox:
20-
image: selenium/node-firefox:4.0.0
21-
volumes:
22-
- /dev/shm:/dev/shm
19+
image: selenium/node-firefox:3.141.59-20210311
2320
depends_on:
2421
- selenium-hub
22+
volumes:
23+
- /dev/shm:/dev/shm
2524
environment:
26-
- SE_EVENT_BUS_HOST=selenium-hub
27-
- SE_EVENT_BUS_PUBLISH_PORT=4442
28-
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
2925
- SCREEN_WIDTH=2880
3026
- SCREEN_HEIGHT=1800
27+
- HUB_HOST=selenium-hub
28+
- NODE_MAX_INSTANCES=5
29+
- NODE_MAX_SESSION=5
3130
links:
3231
- selenium-hub:hub
33-
scale: 4
34-
3532
selenium-hub:
36-
image: selenium/hub:4.0.0
33+
image: selenium/hub:3.141.59-20210311
3734
container_name: selenium-hub
3835
environment:
39-
- GRID_MAX_SESSION=50
36+
- GRID_MAX_SESSION=5
4037
ports:
41-
- "4442:4442"
42-
- "4443:4443"
4338
- "4444:4444"

pom.xml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
</argLine>
131131
<systemPropertyVariables>
132132
<environment>local</environment>
133-
<url>${application-url}</url>
133+
<application_endpoint>${application-url}</application_endpoint>
134134
</systemPropertyVariables>
135135
<suiteXmlFiles>
136136
<suiteXmlFile>src/test/resources/conf/TestNG_Single.xml</suiteXmlFile>
@@ -151,7 +151,7 @@
151151
<configuration>
152152
<systemPropertyVariables>
153153
<environment>local</environment>
154-
<url>${application-url}</url>
154+
<application_endpoint>${application-url}</application_endpoint>
155155
</systemPropertyVariables>
156156
<suiteXmlFiles>
157157
<suiteXmlFile>src/test/resources/conf/TestNG_Single.xml</suiteXmlFile>
@@ -175,7 +175,7 @@
175175
</argLine>
176176
<systemPropertyVariables>
177177
<environment>docker</environment>
178-
<url>${application-url}</url>
178+
<application_endpoint>${application-url}</application_endpoint>
179179
</systemPropertyVariables>
180180
<suiteXmlFiles>
181181
<suiteXmlFile>src/test/resources/conf/TestNG_Single.xml</suiteXmlFile>
@@ -196,15 +196,15 @@
196196
<configuration>
197197
<systemPropertyVariables>
198198
<environment>docker</environment>
199-
<url>${application-url}</url>
199+
<application_endpoint>${application-url}</application_endpoint>
200200
</systemPropertyVariables>
201201
<suiteXmlFiles>
202202
<suiteXmlFile>src/test/resources/conf/TestNG_Parallel.xml</suiteXmlFile>
203203
</suiteXmlFiles>
204-
<argLine>
204+
<argLine>
205205
-Ddataproviderthreadcount=${parallel-count}
206206
</argLine>
207-
</configuration>
207+
</configuration>
208208
</plugin>
209209
</plugins>
210210
</build>
@@ -223,7 +223,7 @@
223223
</argLine>
224224
<systemPropertyVariables>
225225
<environment>remote</environment>
226-
<url>${application-url}</url>
226+
<application_endpoint>${application-url}</application_endpoint>
227227
</systemPropertyVariables>
228228
<suiteXmlFiles>
229229
<suiteXmlFile>src/test/resources/conf/TestNG_Single.xml</suiteXmlFile>
@@ -247,7 +247,7 @@
247247

248248
<systemPropertyVariables>
249249
<environment>remote</environment>
250-
<url>${application-localhost-url}</url>
250+
<application_endpoint>${application-localhost-url}</application_endpoint>
251251
<caps_type>local</caps_type>
252252
<env_cap_id>2</env_cap_id>
253253
</systemPropertyVariables>
@@ -269,7 +269,7 @@
269269
<configuration>
270270
<systemPropertyVariables>
271271
<environment>remote</environment>
272-
<url>${application-localhost-url}</url>
272+
<application_endpoint>${application-localhost-url}</application_endpoint>
273273
<caps_type>local</caps_type>
274274
</systemPropertyVariables>
275275
<suiteXmlFiles>
@@ -293,7 +293,7 @@
293293
<configuration>
294294
<systemPropertyVariables>
295295
<environment>remote</environment>
296-
<url>${application-url}</url>
296+
<application_endpoint>${application-url}</application_endpoint>
297297
</systemPropertyVariables>
298298
<suiteXmlFiles>
299299
<suiteXmlFile>src/test/resources/conf/TestNG_Parallel.xml</suiteXmlFile>
@@ -316,12 +316,15 @@
316316
<configuration>
317317
<systemPropertyVariables>
318318
<environment>remote</environment>
319-
<url>${application-localhost-url}</url>
319+
<application_endpoint>${application-localhost-url}</application_endpoint>
320320
<caps_type>local</caps_type>
321321
</systemPropertyVariables>
322322
<suiteXmlFiles>
323323
<suiteXmlFile>src/test/resources/conf/TestNG_MultipleParallel.xml</suiteXmlFile>
324324
</suiteXmlFiles>
325+
<argLine>
326+
-Ddataproviderthreadcount=${parallel-count}
327+
</argLine>
325328
</configuration>
326329
</plugin>
327330
</plugins>
@@ -337,11 +340,14 @@
337340
<configuration>
338341
<systemPropertyVariables>
339342
<environment>remote</environment>
340-
<url>${application-url}</url>
343+
<application_endpoint>${application-url}</application_endpoint>
341344
</systemPropertyVariables>
342345
<suiteXmlFiles>
343346
<suiteXmlFile>src/test/resources/conf/TestNG_MultipleParallel.xml</suiteXmlFile>
344347
</suiteXmlFiles>
348+
<argLine>
349+
-Ddataproviderthreadcount=${parallel-count}
350+
</argLine>
345351
</configuration>
346352
</plugin>
347353
</plugins>
@@ -357,13 +363,16 @@
357363
<configuration>
358364
<systemPropertyVariables>
359365
<environment>remote</environment>
360-
<url>${application-url}</url>
366+
<application_endpoint>${application-url}</application_endpoint>
361367
<caps_type>mobile</caps_type>
362368
<env_cap_id>2</env_cap_id>
363369
</systemPropertyVariables>
364370
<suiteXmlFiles>
365371
<suiteXmlFile>src/test/resources/conf/TestNG_MultipleParallel.xml</suiteXmlFile>
366372
</suiteXmlFiles>
373+
<argLine>
374+
-Ddataproviderthreadcount=${parallel-count}
375+
</argLine>
367376
</configuration>
368377
</plugin>
369378
</plugins>

src/test/java/browserstack/stepdefs/BaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public synchronized void setUpClass(@Optional("local") String environment, @Opti
7171
@Optional("single") String caps_type, @Optional("2") int env_cap_id,
7272
@Optional("BStack test name") String settestname) throws Exception {
7373
JSONParser parser = new JSONParser();
74-
System.out.print(environment.equalsIgnoreCase("docker"));
7574
if (System.getProperty("application_endpoint") != null) {
7675
URL = System.getProperty("application_endpoint");
7776
}
@@ -92,6 +91,7 @@ else if (environment.equalsIgnoreCase("docker")) {
9291
dc.setBrowserName("chrome");
9392
dc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
9493
ThreadLocalDriver.setWebDriver(new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc));
94+
9595
} else if (environment.equalsIgnoreCase("remote")) {
9696

9797
env = "remote";

0 commit comments

Comments
 (0)