Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
target/
build/
logs/
log/
.project
.settings/
.classpath
.idea/
.gradle/
*.iml
.DS_Store
!gradle/wrapper/*
!gradle/wrapper/*
.vscode/
local.log
115 changes: 21 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,23 @@ Test execution using [TestNG](http://testng.org) on BrowserStack.
```
Website will open on `localhost:8000`.

#### Desktop browsers
#### Web browsers

- Run a single test.
```
mvn -P desktop-single test
mvn -P web-single test
```
- Run parallel tests.
```
mvn -P desktop-parallel test
mvn -P web-parallel test
```
- Run a failed test.
```
mvn -P desktop-fail test
mvn -P web-fail test
```
- Run a local test.
```
mvn -P desktop-local test
```
- Run parallel local tests.
```
mvn -P desktop-local-parallel test
```

#### Mobile browsers

- Run a single test.
```
mvn -P mobile-single test
```
- Run parallel tests.
```
mvn -P mobile-parallel test
```
- Run a failed test.
```
mvn -P mobile-fail test
```
- Run a local test.
```
mvn -P mobile-local test
```
- Run parallel local tests.
```
mvn -P mobile-local-parallel test
mvn -P web-local test
```

### App-Automate
Expand All @@ -89,10 +62,6 @@ Test execution using [TestNG](http://testng.org) on BrowserStack.
```
mvn -P android-local test
```
- Run parallel local tests.
```
mvn -P android-local-parallel test
```

#### iOS devices

Expand All @@ -112,10 +81,6 @@ Test execution using [TestNG](http://testng.org) on BrowserStack.
```
mvn -P ios-local test
```
- Run parallel local tests.
```
mvn -P ios-local-parallel test
```

#### Espresso tests

Expand Down Expand Up @@ -156,46 +121,19 @@ Test execution using [TestNG](http://testng.org) on BrowserStack.

- Run a single test
```
./gradlew clean desktop-single
./gradlew webSingle
```
- Run parallel tests
```
./gradlew clean desktop-parallel
./gradlew webParallel
```
- Run a failed test
```
./gradlew clean desktop-fail
./gradlew webFail
```
- Run a local test
```
./gradlew clean desktop-local
```
- Run parallel local tests
```
./gradlew clean desktop-local-parallel
```

#### Mobile browsers

- Run a single test
```
./gradlew clean mobile-single
```
- Run parallel tests
```
./gradlew clean mobile-parallel
```
- Run a failed test
```
./gradlew clean mobile-fail
```
- Run a local test
```
./gradlew clean mobile-local
```
- Run parallel local tests
```
./gradlew clean mobile-local-parallel
./gradlew webLocal
```

### App-Automate
Expand All @@ -204,68 +142,57 @@ Test execution using [TestNG](http://testng.org) on BrowserStack.

- Run a single test
```
./gradlew clean android-single
./gradlew androidSingle
```
- Run parallel tests
```
./gradlew clean android-parallel
./gradlew androidParallel
```
- Run a failed test
```
./gradlew clean android-fail
./gradlew androidFail
```
- Run a local test
```
./gradlew clean android-local
```
- Run parallel local tests
```
./gradlew clean android-local-parallel
./gradlew androidLocal
```

#### iOS devices

- Run a single test
```
./gradlew clean ios-single
./gradlew iosSingle
```
- Run parallel tests
```
./gradlew clean ios-parallel
./gradlew iosParallel
```
- Run a failed test
```
./gradlew clean ios-fail
./gradlew iosFail
```
- Run a local test
```
./gradlew clean ios-local
```
- Run parallel local tests
```
./gradlew clean ios-local-parallel
./gradlew iosLocal
```

#### Espresso tests

- Run an Espresso test
```
./gradlew clean espresso
./gradlew espresso
```

#### XCUI tests

- Run a XCUI test
```
./gradlew clean xcuitest
./gradlew xcuitest
```

## Notes
- You can view your Automate test results on the [BrowserStack Automate dashboard](https://automate.browserstack.com/).
- You can view your App-Automate test results on the [BrowserStack App-Automate dashboard](https://app-automate.browserstack.com/).
- To use specific number of threads:
- For Maven use `-Dthreads=<thread-count>`. Example `-Dthreads=3`
- For Gradle use `-Pthreads=<thread-count>`. Example `-Pthreads=3`
- Apps used to test on Android:
- Demo App: [WikipediaSample.apk](https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk)
- Local App: [LocalSample.apk](https://www.browserstack.com/app-automate/sample-apps/android/LocalSample.apk)
Expand All @@ -280,5 +207,5 @@ Test execution using [TestNG](http://testng.org) on BrowserStack.
- Test-suite: [BrowserStack-SampleXCUITest.zip](https://www.browserstack.com/app-automate/sample-apps/ios/BrowserStack-SampleXCUITest.zip)
- Export the environment variables for the Username and Access Key of your BrowserStack account.
```sh
export BROWSERSTACK_USERNAME=<browserstack-username> && export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
```
export BROWSERSTACK_USERNAME=<your-username> && export BROWSERSTACK_ACCESS_KEY=<your-access-key>
```
82 changes: 82 additions & 0 deletions browserstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# =============================
# Set BrowserStack Credentials
# =============================
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and
# BROWSERSTACK_ACCESS_KEY as env variables
userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY

# ======================
# BrowserStack Reporting
# ======================
# The following capabilities are used to set up reporting on BrowserStack:
# Set 'projectName' to the name of your project. Example, Marketing Website
projectName: BrowserStack Samples
# Set `buildName` as the name of the job / testsuite being run
buildName: browserstack build
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
# buildName. Choose your buildIdentifier format from the available expressions:
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}
# Set `framework` of your test suite. Example, `testng`, `cucumber`, `cucumber-testng`
# This property is needed to send test context to BrowserStack (test name, status)
framework: testng

# =======================================
# Platforms (Browsers / Devices to test)
# =======================================
# Platforms object contains all the browser / device combinations you want to test on.
# Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate)
platforms:
- os: OS X
osVersion: Big Sur
browserName: Chrome
browserVersion: latest
- os: Windows
osVersion: 10
browserName: Edge
browserVersion: latest
- deviceName: Samsung Galaxy S22 Ultra
browserName: chrome # Try 'samsung' for Samsung browser
osVersion: 12.0

# =======================
# Parallels per Platform
# =======================
# The number of parallel threads to be used for each platform set.
# BrowserStack's SDK runner will select the best strategy based on the configured value
#
# 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
#
# 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
parallelsPerPlatform: 10

source: testng:sample-master:v1.1

# ==========================================
# BrowserStack Local
# (For localhost, staging/private websites)
# ==========================================
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
browserstackLocal: true # <boolean> (Default false)

# Options to be passed to BrowserStack local in-case of advanced configurations
browserStackLocalOptions:
localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections

# ===================
# Debugging features
# ===================
debug: false # <boolean> # Set to true if you need screenshots for every selenium command ran
networkLogs: false # <boolean> Set to true to enable HAR logs capturing
consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Default: errors)
# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)

# Test Observability is an intelligent test reporting & debugging product. It collects data using the SDK. Read more about what data is collected at https://www.browserstack.com/docs/test-observability/references/terms-and-conditions
# Visit observability.browserstack.com to see your test reports and insights. To disable test observability, specify `testObservability: false` in the key below.
testObservability: true
Loading
Loading