Skip to content

Commit 3a42d6c

Browse files
committed
SDK updated
1 parent c5f170d commit 3a42d6c

File tree

15 files changed

+103
-313
lines changed

15 files changed

+103
-313
lines changed

README.md

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ This repository contains the following Cucumber tests:
2727
| User | Login as User with no image loaded | This test verifies that the product images load for user: "image_not_loading_user" on the e-commerce application. Since the images do not load, the test case assertion fails. | user |
2828
| User | Login as User with existing Orders | This test verifies that existing orders are shown for user: "existing_orders_user" | user |
2929

30-
---
31-
## Configuring the maximum parallel test threads for this repository
32-
33-
For all the parallel run configuration profiles, you can configure the maximum parallel test threads by changing the number of workers in [pavement.py](pavement.py)
34-
35-
```py
36-
... pytest -s src/test/suites/e2e.py --driver Browserstack -n 2
37-
```
38-
39-
eg: Using `-n 2` will execute `2` tests in parallel per environment configuration that has been passed in the capabilities
40-
41-
---
4230
# On Premise
4331

4432
This infrastructure points to running the tests on your own machine using a browser (e.g. Chrome) using the browser's driver executables (e.g. ChromeDriver for Chrome). Selenium enables this functionality using WebDriver for many popular browsers.
@@ -58,7 +46,7 @@ Note: The ChromeDriver version must match the Chrome browser version on your mac
5846
To run the entire test suite on your own machine, use the following command:
5947

6048
```sh
61-
paver run single on-prem
49+
pytest -s src/test/suites/*.py --driver Chrome --driver-path /Path/To/Your/ChromeDriver
6250
```
6351

6452
- Output
@@ -89,40 +77,38 @@ Note: The ChromeDriver version must match the Chrome browser version on your mac
8977
set BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
9078
```
9179

92-
Alternatively, you can also hardcode username and access_key objects in the [single.json](src/resources/single.json) file, [parallel.json](src/resources/parallel.json) and [local.json](src/resources/local.json).
93-
94-
Note:
95-
96-
- The exact test capability values can be easily identified using the [Browserstack Capability Generator](https://browserstack.com/automate/capabilities)
80+
Alternatively, you can also hardcode username and access_key objects in the browserstack.yml file,
9781

9882
## Running Your Tests
9983

100-
### Run the entire test suite in parallel on a single BrowserStack browser
84+
### Run the entire test suite in parallel on a BrowserStack browser
10185

102-
In this section, we will run the tests in parallel on a single browser on Browserstack.
86+
In this section, we will run the tests in parallel on a browser on Browserstack.
10387

10488
- How to run the test?
10589

106-
To run the entire test suite in parallel on a single BrowserStack browser, use the following command:
90+
To run the entire test suite in parallel on a BrowserStack browser, update the 'platforms' in the browserstack.yml file &
91+
92+
use the following command:
10793

10894
```sh
109-
paver run single remote
95+
browserstack-sdk pytest -s src/test/suites/*.py
11096
```
11197

11298
- Output
11399

114-
This run profile executes the entire test suite in parallel on a single BrowserStack browser. Please refer to your [BrowserStack dashboard](https://automate.browserstack.com/) for test results.
100+
This run profile executes the entire test suite in parallel on a BrowserStack browser. Please refer to your [BrowserStack dashboard](https://automate.browserstack.com/) for test results.
115101

116102
### Run the entire test suite in parallel on multiple BrowserStack browsers
117103

118104
In this section, we will run the tests in parallel on multiple browsers on Browserstack.
119105

120106
- How to run the test?
121107

122-
To run the entire test suite in parallel on multiple BrowserStack browsers, use the following command:
108+
To run the entire test suite in parallel on multiple BrowserStack browsers, update the 'parallelsperplatform' in the browserstack.yml file & use the following command:
123109

124110
```sh
125-
paver run parallel remote
111+
browserstack-sdk pytest -s src/test/suites/*.py
126112
```
127113
### [Web application hosted on internal environment] Running your tests on BrowserStack using BrowserStackLocal
128114

@@ -143,10 +129,10 @@ In this section, we will run the tests in parallel on multiple browsers on Brows
143129

144130
- How to run the test?
145131

146-
- To run the default test scenario (e.g. End to End Scenario) on a single BrowserStack browser using BrowserStackLocal, use the following command:
132+
- To run the default test scenario (e.g. End to End Scenario) on a single BrowserStack browser using BrowserStackLocal, update the 'browserstackLocal' in the browserstack.yml file & use the following command:
147133

148134
```sh
149-
paver run local remote
135+
browserstack-sdk pytest -s src/test/suites/*.py
150136
```
151137

152138
- Output

browserstack.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# =============================
2+
# Set BrowserStack Credentials
3+
# =============================
4+
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and
5+
# BROWSERSTACK_ACCESS_KEY as env variables
6+
userName: abisheksurendrab_vKBnUQ
7+
accessKey: XeYLV5ZHsViiFXVFuBqx
8+
9+
# ======================
10+
# BrowserStack Reporting
11+
# ======================
12+
# The following capabilities are used to set up reporting on BrowserStack:
13+
# Set 'projectName' to the name of your project. Example, Marketing Website
14+
projectName: BrowserStack Samples
15+
# Set `buildName` as the name of the job / testsuite being run
16+
buildName: browserstack build
17+
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
18+
# buildName. Choose your buildIdentifier format from the available expressions:
19+
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
20+
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
21+
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
22+
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}
23+
# Set `framework` of your test suite. Example, `testng`, `cucumber`, `cucumber-testng`
24+
# This property is needed to send test context to BrowserStack (test name, status)
25+
framework: pytest
26+
27+
# =======================================
28+
# Platforms (Browsers / Devices to test)
29+
# =======================================
30+
# Platforms object contains all the browser / device combinations you want to test on.
31+
# Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate)
32+
platforms:
33+
- os: OS X
34+
osVersion: Big Sur
35+
browserName: Chrome
36+
browserVersion: latest
37+
- os: Windows
38+
osVersion: 10
39+
browserName: Edge
40+
browserVersion: latest
41+
42+
# =======================
43+
# Parallels per Platform
44+
# =======================
45+
# The number of parallel threads to be used for each platform set.
46+
# BrowserStack's SDK runner will select the best strategy based on the configured value
47+
#
48+
# Example 1 - If you have configured 3 platforms and set `parallelsPerPlatform` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack
49+
#
50+
# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
51+
parallelsPerPlatform: 1
52+
53+
# ==========================================
54+
# BrowserStack Local
55+
# (For localhost, staging/private websites)
56+
# ==========================================
57+
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet
58+
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
59+
browserstackLocal: false # <boolean> (Default false)
60+
# browserStackLocalOptions:
61+
# Options to be passed to BrowserStack local in-case of advanced configurations
62+
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
63+
# forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
64+
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections
65+
66+
# ===================
67+
# Debugging features
68+
# ===================
69+
debug: false # <boolean> # Set to true if you need screenshots for every selenium command ran
70+
networkLogs: false # <boolean> Set to true to enable HAR logs capturing
71+
consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Default: errors)
72+
# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)

conftest.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

pavement.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
pythonpath = .

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
browserstack-local
2+
browserstack-sdk
23
jsonmerge
34
multiprocess
45
paver

resources/local.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

resources/parallel.json

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)