Skip to content

Commit 6162c09

Browse files
samiran-bsroy-de-kleijnrathilpatel
authored
Review (#10)
Incorporated internal TU team validation review comments. Co-authored-by: Roy de Kleijn <roy.k@browserstack.com> Co-authored-by: s7arlord <rathilvasani@gmail.com>
1 parent a4c3238 commit 6162c09

4 files changed

Lines changed: 23 additions & 28 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ Note: The ChromeDriver version must match the Chrome browser version on your mac
170170
171171
- Install and start [Docker](https://docs.docker.com/get-docker/).
172172
- Note: Docker should be running on the test machine. Ensure Docker Compose is installed as well.
173-
- Run `docker-compose pull` from the current directory of the repository.
173+
174+
- Run `docker-compose pull` from the `docker` directory of the repository.
174175
175176
## Running Your Tests
176177
@@ -252,7 +253,7 @@ Note: The ChromeDriver version must match the Chrome browser version on your mac
252253
253254
- Output
254255
255-
This run profile executes the entire test suite in parallel on a single browser, deployed on a docker image.
256+
This run profile executes the entire test suite in parallel across multiple instances of the same browser, deployed on a docker image.
256257
257258
- Note: By default, this execution would run maximum 5 test threads in parallel on Docker. Refer to the section ["Configuring the maximum parallel test threads for this repository"](#Configuring-the-maximum-parallel-test-threads-for-this-repository) for updating the parallel thread count based on your requirements.
258259
@@ -475,7 +476,8 @@ In this section, we will run the test cases to test the internally hosted websit
475476
476477
Maven:
477478
```sh
478-
mvn allure:generate
479+
480+
mvn allure:report
479481
```
480482
481483
Gradle:

docker/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"

src/test/java/com/browserstack/test/suites/TestBase.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.io.FileReader;
1717
import java.lang.reflect.Method;
1818
import java.net.URL;
19+
import java.util.Date;
1920
import java.util.HashMap;
2021
import java.util.Map;
2122
import java.util.UUID;
@@ -36,10 +37,6 @@ public WebDriver getDriver() {
3637
return driver.get();
3738
}
3839

39-
public String getGeolocation() {
40-
return "";
41-
}
42-
4340
@BeforeMethod
4441
@Parameters(value = {"environment", "testtype", "env_cap_id"})
4542
public void setUp(@Optional("on-prem") String environment, @Optional("single") String testtype, @Optional("0") int env_cap_id, Method m) throws Exception {
@@ -55,6 +52,7 @@ public void setUp(@Optional("on-prem") String environment, @Optional("single") S
5552

5653
Map<String, String> commonCapabilities = (Map<String, String>) envs.get("common_caps");
5754
commonCapabilities.put("name", m.getName());
55+
commonCapabilities.put("build", commonCapabilities.get("build") + " - " + new Date().getTime());
5856
Map<String, String> envCapabilities = (Map<String, String>) ((org.json.simple.JSONArray) envs.get("env_caps")).get(env_cap_id);
5957
Map<String, String> localCapabilities = (Map<String, String>) envs.get("local_binding_caps");
6058

src/test/java/com/browserstack/test/suites/user/UserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void loginAndCheckExistingOrders() {
4444
@Test
4545
public void addToFavourites() {
4646
getDriver().findElement(By.id("signin")).click();
47-
getDriver().findElement(By.cssSelector("#username input")).sendKeys("existing_orders_user" + Keys.ENTER);
47+
getDriver().findElement(By.cssSelector("#username input")).sendKeys("demouser" + Keys.ENTER);
4848
getDriver().findElement(By.cssSelector("#password input")).sendKeys("testingisfun99" + Keys.ENTER);
4949
getDriver().findElement(By.id("login-btn")).click();
5050

0 commit comments

Comments
 (0)