diff --git a/.github/workflows/best-practice.yml b/.github/workflows/best-practice.yml
deleted file mode 100644
index 21605db7..00000000
--- a/.github/workflows/best-practice.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
-
-name: Best Practices Tests
-
-on:
- push:
- branches: [ main ]
- pull_request:
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Run tests
- continue-on-error: true
- env:
- SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
- SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
- SCREENER_API_KEY: ${{ secrets.SCREENER_API_KEY }}
- run: mvn test -pl best-practice -Dtest=\!RealDevice* -X
\ No newline at end of file
diff --git a/.github/workflows/junit4.yml b/.github/workflows/junit4.yml
index 89e7e5c4..428c1d6b 100644
--- a/.github/workflows/junit4.yml
+++ b/.github/workflows/junit4.yml
@@ -16,7 +16,7 @@ jobs:
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--replace"
- files: "selenium-junit4-examples/**/*.java"
+ files: "selenium-junit4/**/*.java"
skip-commit: true
- name: Print diffs
run: git --no-pager diff --exit-code
@@ -30,7 +30,7 @@ jobs:
with:
java-version: 11
- name: Run JUnit 4 Tests
- working-directory: ./selenium-junit4-examples
+ working-directory: ./selenium-junit4
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
diff --git a/.github/workflows/junit5.yml b/.github/workflows/junit5.yml
new file mode 100644
index 00000000..50bbc889
--- /dev/null
+++ b/.github/workflows/junit5.yml
@@ -0,0 +1,37 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
+
+name: JUnit 4 Tests
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+
+jobs:
+ formatting:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: axel-op/googlejavaformat-action@v3
+ with:
+ args: "--replace"
+ files: "selenium-junit5/**/*.java"
+ skip-commit: true
+ - name: Print diffs
+ run: git --no-pager diff --exit-code
+
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Java
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Run JUnit 5 Tests
+ working-directory: ./selenium-junit5
+ env:
+ SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
+ SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
+ run: mvn test
diff --git a/.github/workflows/mac-windows.yml b/.github/workflows/mac-windows.yml
deleted file mode 100644
index c6c0c94c..00000000
--- a/.github/workflows/mac-windows.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
-
-name: Windows and Mac OS tests
-
-on:
- push:
- branches: [ main ]
- pull_request:
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [windows-latest, macos-latest]
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Run tests
- continue-on-error: true
- env:
- SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
- SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
- SCREENER_API_KEY: ${{ secrets.SCREENER_API_KEY }}
- run: mvn test -pl best-practice -Dtest=DesktopTests* -X
\ No newline at end of file
diff --git a/.github/workflows/real-devices.yml b/.github/workflows/real-devices.yml
deleted file mode 100644
index d110dfe7..00000000
--- a/.github/workflows/real-devices.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
-name: Real Devices
-
-on:
- push:
- branches: [ main ]
- pull_request:
-
-env:
- SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
- SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: RDC Native App Android
- run: mvn test -pl appium/appium-app/appium-app-examples -Dtest=AndroidNativeAppTest -Dregion=eu -X
- - name: RDC Native App IOS
- run: mvn test -pl appium/appium-app/appium-app-examples -Dtest=IOSNativeAppTest -Dregion=eu -X
diff --git a/.github/workflows/selenium-cucumber-examples.yml b/.github/workflows/selenium-cucumber-examples.yml
deleted file mode 100644
index f5a50f85..00000000
--- a/.github/workflows/selenium-cucumber-examples.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
-
-name: Cucumber Tests
-
-on:
- push:
- branches: [ main ]
- pull_request:
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Run tests
- env:
- SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
- SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
- run: mvn test -pl selenium-cucumber-examples -X
diff --git a/.github/workflows/selenium-examples.yml b/.github/workflows/selenium.yml
similarity index 90%
rename from .github/workflows/selenium-examples.yml
rename to .github/workflows/selenium.yml
index 801af2fc..85b1a2c5 100644
--- a/.github/workflows/selenium-examples.yml
+++ b/.github/workflows/selenium.yml
@@ -16,7 +16,7 @@ jobs:
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--replace"
- files: "selenium-examples/**/*.java"
+ files: "selenium/**/*.java"
skip-commit: true
- name: Print diffs
run: git --no-pager diff --exit-code
@@ -30,7 +30,7 @@ jobs:
with:
java-version: 11
- name: Run JUnit 5 tests
- working-directory: ./selenium-examples
+ working-directory: ./selenium
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
diff --git a/.github/workflows/testng.yml b/.github/workflows/testng.yml
deleted file mode 100644
index 45285b24..00000000
--- a/.github/workflows/testng.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
-
-name: TestNg Tests
-
-on:
- push:
- branches: [ main ]
- pull_request:
-
-jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Run testng tests
- env:
- SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
- SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
- run: mvn test -pl selenium-testng-examples -X
diff --git a/.gitpod.yml b/.gitpod.yml
deleted file mode 100644
index 1c2612b6..00000000
--- a/.gitpod.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-# List the start up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks
-image: maven:3.6.3-jdk-8
-tasks:
- - name: Script Task
- init: |
- mvn dependency:resolve
- mvn test-compile
- cd gitpod
- command: $MVN_COMMAND
-
diff --git a/README.md b/README.md
index bc8f0515..64a4c1b0 100644
--- a/README.md
+++ b/README.md
@@ -1,80 +1,62 @@
-# Java Demonstration Scripts
+# Java Demonstration Code
-Welcome to Java Demo Scripts designed by Solution Architects to provide examples of how to use Sauce Labs technologies. This repository contains
-everything that you need to get started with web, mobile, visual, functional and all other types of automation using Java.
+Welcome to Java Demo Scripts designed by Solution Architects to provide examples of how to use Sauce Labs technologies.
+This repository contains
+everything that you need to get started with web, mobile, functional, performance, accessibility and all other types of
+automation using Java.
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
-[![Codacy Badge](https://api.codacy.com/project/badge/Grade/564ddfb012db40048781b7b6c954d099)](https://app.codacy.com/gh/saucelabs-training/demo-java?utm_source=github.com&utm_medium=referral&utm_content=saucelabs-training/demo-java&utm_campaign=Badge_Grade_Dashboard)
-[![Best Practices Tests](https://github.com/saucelabs-training/demo-java/actions/workflows/best-practice.yml/badge.svg)](https://github.com/saucelabs-training/demo-java/actions/workflows/best-practice.yml)
[![Selenium JUnit 5 Tests](https://github.com/saucelabs-training/demo-java/actions/workflows/selenium-examples.yml/badge.svg)](https://github.com/saucelabs-training/demo-java/actions/workflows/selenium-examples.yml)
[![JUnit 4 Tests](https://github.com/saucelabs-training/demo-java/actions/workflows/junit4.yml/badge.svg)](https://github.com/saucelabs-training/demo-java/actions/workflows/junit4.yml)
[![TestNg Tests](https://github.com/saucelabs-training/demo-java/actions/workflows/testng.yml/badge.svg)](https://github.com/saucelabs-training/demo-java/actions/workflows/testng.yml)
-[![Selenium Cucumber Examples](https://github.com/saucelabs-training/demo-java/actions/workflows/cucumber.yml/badge.svg)](https://github.com/saucelabs-training/demo-java/actions/workflows/cucumber.yml)
[![Real Devices](https://github.com/saucelabs-training/demo-java/actions/workflows/real-devices.yml/badge.svg)](https://github.com/saucelabs-training/demo-java/actions/workflows/real-devices.yml)
-## 🥇Most Popular
-* [Web automation best practices framework with multiple testing strategies. Crafted by industry experts with decades of experience.](./best-practice/)
-* [Quick start test, Junit 5](./selenium-examples/src/test/java/com/saucedemo/selenium/demo/SeleniumTest.java)
-* [Quick start test, Junit 4](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/SeleniumTest.java)
-* [Quick start test, TestNg](./selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SeleniumTest.java)
-* [iOS real device, native app, Junit4](./appium-examples/src/test/java/com/appium_app/simple_example/IOSNativeAppTest.java)
-* [Front-end performance testing](./selenium-examples/src/test/java/com/saucedemo/selenium/PerformanceTest.java)
-* [Visual E2E test](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/SimpleVisualE2ETest.java)
-* [Sauce Connect usage](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/SauceConnectTest.java)
-
-## Best Practices
-* [Desktop](./best-practice/src/test/java/com/saucedemo/tests/DesktopTests.java) `junit4` `sauce-bindings`
-* [Emu/Sim Web](./best-practice/src/test/java/com/saucedemo/tests/EmuSimWebAppTests.java) `junit4` `sauce-bindings`
-* [Performance](./best-practice/src/test/java/com/saucedemo/tests/PerformanceTests.java) `junit4` `sauce-bindings`
-* [RealDevice](./best-practice/src/test/java/com/saucedemo/tests/RealDeviceWebTests.java) `junit4` `sauce-bindings`
-* [Visual E2E](./best-practice/src/test/java/com/saucedemo/tests/VisualCrossPlatformTests.java) `junit4` `sauce-bindings`
-
-## 🖥Web automation
-
-- Sauce Bindings With TestRunner Examples
- * [Junit 5](./selenium-examples/src/test/java/com/saucedemo/selenium/demo/SaucebindingsJunitTest.java) `junit5` `sauce-bindings`
- * [Junit 4](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/SauceBindingsJunit4Test.java) `junit4` `sauce-bindings`
- * [TestNg](./selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTestngTest.java) `testng` `sauce-bindings`
-
-- Sauce Bindings Examples
- * [Junit 5](./selenium-examples/src/test/java/com/saucedemo/selenium/demo/SauceBindingsTest.java) `junit4` `sauce-bindings`
- * [Junit 4](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/SauceBindingsTest.java) `junit4` `sauce-bindings`
- * [TestNg](./selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTest.java) `junit4` `sauce-bindings`
-
-- Selenium Examples
- * [Accessibility Test with Sauce Bindings](/selenium-examples/src/test/java/com/saucedemo/selenium/accessibility/SauceBindingsTest.java) `junit4` `sauce-bindings`
- * [Accessibility Test with Deque Axe](/selenium-examples/src/test/java/com/saucedemo/selenium/accessibility/DequeAxeTest.java) `junit4`
- * [Cucumber web test](./selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/RunTestsAT.java)
- * [Windows authentication](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/WindowsAuthentication.java) `junit4`
- * [Cross Browser/Platform in Parallel w/ TestNG](./selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/CrossBrowserPlatformTest.java) `testng`
- * [Performance, front-end with Sauce Bindings](/selenium-examples/src/test/java/com/saucedemo/selenium/PerformanceTest.java) `junit5` `sauce-bindings`
- * [Single Browser in Parallel w/ TestNG](./selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/ParallelSingleBrowserTest.java) `testng`
- * [Visual e2e test](./selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/SimpleVisualE2ETest.java) `visual` `junit4`
- * [Visual e2e test with branching strategy](./blob/54a4bfde9040d71f88f3b3aff79a047474d01be9/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/SimpleVisualE2ETest.java#L115-L158) `visual` `junit4`
+## 🖥Desktop browser automation
+
+There are 3 main test runners people use with Java:
+
+* [Junit 5](./selenium/src/test/java/com/saucedemo/selenium/) `junit5` `sauce-bindings`
+* [Junit 4](./selenium-junit4/src/test/java/com/saucedemo/selenium/junit4/) `junit4` `sauce-bindings`
+* [TestNg](./selenium-testng/src/test/java/com/saucedemo/selenium/testng/) `testng` `sauce-bindings`
+
+### Selenium Features
+
+* Running tests in Parallel
+* Running Cross Browser/Platform
+* RemoteWebDriverBuilder
+* Recommended Capabilities
+* Firefox-only Features
+* Chrome-only Features
+* Chrome DevTools
+
+### Sauce Labs Features
+
+* [Performance, front-end with Sauce Bindings](/selenium/src/test/java/com/saucedemo/selenium/sauce_features/PerformanceTest.java) `junit5` `sauce-bindings`
+* [Accessibility Test with Deque Axe](/selenium/src/test/java/com/saucedemo/selenium/sauce_features/AccessibilityTest.java) `junit4`
## 📱Mobile automation
[📚 Mobile Testing Training Tutorials](./TRAINING.md)
- Real Devices
- * [iOS native app](./appium-examples/src/test/java/com/appium_app/simple_example/IOSNativeAppTest.java)
- * [Android native app](./appium-examples/src/test/java/com/appium_app/simple_example/AndroidNativeAppTest.java)
- * [Upload app to Sauce Storage](./appium-examples/src/test/java/com/helpers/push_apps_to_storage.sh)
- * [Image Injection](./appium-examples/src/test/java/com/appium_app/image_injection)
- * [Biometric Login](./appium-examples/src/test/java/com/appium_app/biometric_login)
- * [Cucumber w/ Appium](./appium-junit4-cucumber-examples/src/test/resources/LoginPage.feature) `junit4` `cucumber`
+ * [iOS native app](./appium-examples/src/test/java/com/appium_app/simple_example/IOSNativeAppTest.java)
+ * [Android native app](./appium-examples/src/test/java/com/appium_app/simple_example/AndroidNativeAppTest.java)
+ * [Upload app to Sauce Storage](./appium-examples/src/test/java/com/helpers/push_apps_to_storage.sh)
+ * [Image Injection](./appium-examples/src/test/java/com/appium_app/image_injection)
+ * [Biometric Login](./appium-examples/src/test/java/com/appium_app/biometric_login)
+ * [Cucumber w/ Appium](./appium-junit4-cucumber-examples/src/test/resources/LoginPage.feature) `junit4` `cucumber`
- Emulators and Simulators
- * [iOS native app](./appium-examples/src/test/java/com/appium_app/simple_example/IOSNativeAppTest.java)
- * [Android native app](./appium-examples/src/test/java/com/appium_app/simple_example/AndroidNativeAppTest.java)
- * [Biometric Login](./appium-examples/src/test/java/com/appium_app/biometric_login)
+ * [iOS native app](./appium-examples/src/test/java/com/appium_app/simple_example/IOSNativeAppTest.java)
+ * [Android native app](./appium-examples/src/test/java/com/appium_app/simple_example/AndroidNativeAppTest.java)
+ * [Biometric Login](./appium-examples/src/test/java/com/appium_app/biometric_login)
## ⚙️Setup
-* Install [Git](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-git)
-* Install [IntelliJ (or another IDE)](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-intellij)
-* Install [JDK](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-the-jdk)
-* Install [Maven](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-maven)
+* Install [Git](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-git)
+* Install [IntelliJ (or another IDE)](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-intellij)
+* Install [JDK](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-the-jdk)
+* Install [Maven](https://github.com/saucelabs-training/demo-java/blob/main/docs/prerequisites.md#install-maven)
### Import the Project
@@ -92,44 +74,45 @@ everything that you need to get started with web, mobile, visual, functional and
5. Choose the **demo-java** directory as the **root** directory of the project.
### Set Your Sauce Labs Credentials
-1. Copy your Sauce Labs **username** and **accessKey** in the [User Settings](https://app.saucelabs.com/user-settings) section of the [Sauce Labs Dashboard](https://app.saucelabs.com/dashboard/builds).
+
+1. Copy your Sauce Labs **username** and **accessKey** in the [User Settings](https://app.saucelabs.com/user-settings)
+ section of the [Sauce Labs Dashboard](https://app.saucelabs.com/dashboard/builds).
2. Open a Terminal window (command prompt for Windows) and set your Sauce Labs Environment variables:
**Mac OSX:**
```
$ export SAUCE_USERNAME="your username"
$ export SAUCE_ACCESS_KEY="your accessKey"
- $ export SCREENER_API_KEY="your screener key"
```
**Windows:**
```
> set SAUCE_USERNAME="username"
> set SAUCE_ACCESS_KEY="accessKey"
- > set SCREENER_API_KEY="your screener key"
```
> To set an environment variables permanently in Windows, you must append it to the `PATH` variable.
-
- > Go to **Control Panel > System > Windows version > Advanced System Settings > Environment Variables > System Variables > Edit > New**
-
+
+ > Go to **Control Panel > System > Windows version > Advanced System Settings > Environment Variables > System
+ Variables > Edit > New**
+
> Then set the "Name" and "Value" for each variable
-
+
3. Test the environment variables
- **Mac OSX:**
+ **Mac OSX:**
```
$ echo $SAUCE_USERNAME
$ echo $SAUCE_ACCESS_KEY
```
- ***WARNING FOR UNIX USERS!***
-
- *If you have problems setting your environment variables, run the following commands in your terminal:*
+ ***WARNING FOR UNIX USERS!***
+
+ *If you have problems setting your environment variables, run the following commands in your terminal:*
```
$ launchctl setenv SAUCE_USERNAME $SAUCE_USERNAME
$ launchctl setenv SAUCE_ACCESS_KEY $SAUCE_ACCESS_KEY
```
- **Windows:**
+ **Windows:**
```
> echo %SAUCE_USERNAME%
> echo %SAUCE_ACCESS_KEY%
@@ -150,18 +133,24 @@ everything that you need to get started with web, mobile, visual, functional and
$ mvn test -pl best-practice -Dtest=DesktopTests
```
-
- You can run different tests from different modules. Check out some examples by looking at the [CI YML files](./.github/workflows)
-## Contributing
+ You can run different tests from different modules. Check out some examples by looking at
+ the [CI YML files](./.github/workflows)
-This repository is maintained by the Solutions Architect team at Sauce Labs. **We welcome all ideas and contributions!**
+## Contributing
-Guidance for contributing can be found [here](./CONTRIBUTING.md)
+This repository is maintained by the Solutions Architect team at Sauce Labs. **We welcome all ideas and contributions!**
+Guidance for contributing can be found [here](./CONTRIBUTING.md)
## Disclaimer
-> The code in these scripts is provided on an "AS-IS" basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. These scripts are provided for educational and demonstration purposes only, and should not be used in production. Issues regarding these scripts should be submitted through GitHub. These scripts are maintained by the Technical Services team at Sauce Labs.
+> The code in these scripts is provided on an "AS-IS" basis without warranty of any kind, either express or implied,
+> including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a
+> particular purpose, or non-infringement. These scripts are provided for educational and demonstration purposes only, and
+> should not be used in production. Issues regarding these scripts should be submitted through GitHub. These scripts are
+> maintained by the Technical Services team at Sauce Labs.
>
-> Some examples in this repository, such as `appium-example`, `parallel-testing`, and `headless`, may require a different account tier beyond free trial. Please contact the [Sauce Labs Sales Team](https://saucelabs.com/contact) for support and information.
+> Some examples in this repository, such as `appium-example`, `parallel-testing`, and `headless`, may require a
+> different account tier beyond free trial. Please contact the [Sauce Labs Sales Team](https://saucelabs.com/contact) for
+> support and information.
diff --git a/appium-rdc/README.md b/appium-rdc/README.md
new file mode 100644
index 00000000..28e85f06
--- /dev/null
+++ b/appium-rdc/README.md
@@ -0,0 +1,11 @@
+# Appium examples
+This folder contains Appium examples
+
+## Examples for Native Apps
+* [Simple examples to get you started with your native appium testing](src/test/java/com/examples/simple_example)
+* [Using biometric login on Sauce Labs](src/test/java/com/examples/biometric_login)
+* [Using image injection on Sauce Labs](src/test/java/com/examples/image_injection)
+* [Using gestures](src/test/java/com/examples/gestures)
+* [Upload and download file](src/test/java/com/examples/up_download_file)
+* [Using deep link](src/test/java/com/examples/deep_link)
+* [Test your allowlisting app](src/test/java/com/examples/allowlist)
diff --git a/appium/appium-app/appium-app-examples/pom.xml b/appium-rdc/pom.xml
similarity index 97%
rename from appium/appium-app/appium-app-examples/pom.xml
rename to appium-rdc/pom.xml
index 7a1a1336..63597b89 100644
--- a/appium/appium-app/appium-app-examples/pom.xml
+++ b/appium-rdc/pom.xml
@@ -6,7 +6,7 @@
demo-java
com.saucelabs
1.0-SNAPSHOT
- ../../../pom.xml
+ ../pom.xml
4.0.0
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/AndroidNativeAppTest.java b/appium-rdc/src/test/java/com/saucedemo/appium_rdc/AndroidNativeAppTest.java
similarity index 93%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/AndroidNativeAppTest.java
rename to appium-rdc/src/test/java/com/saucedemo/appium_rdc/AndroidNativeAppTest.java
index 267f5793..2461f3a3 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/AndroidNativeAppTest.java
+++ b/appium-rdc/src/test/java/com/saucedemo/appium_rdc/AndroidNativeAppTest.java
@@ -1,6 +1,7 @@
-package com.examples.simple_example;
+package com.saucedemo.appium_rdc;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.Constants;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Before;
import org.junit.Rule;
@@ -17,7 +18,6 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
/**
@@ -46,14 +46,14 @@ public void setup() throws MalformedURLException {
MutableCapabilities sauceOptions = new MutableCapabilities();
URL url;
- switch (region) {
+ switch (Constants.region) {
case "us":
- url = new URL(SAUCE_US_URL);
+ url = new URL(Constants.SAUCE_US_URL);
System.out.println("Sauce REGION US");
break;
case "eu":
default:
- url = new URL(SAUCE_EU_URL);
+ url = new URL(Constants.SAUCE_EU_URL);
System.out.println("Sauce REGION EU");
break;
}
@@ -65,7 +65,7 @@ public void setup() throws MalformedURLException {
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("appium:automationName", "UiAutomator2");
- if (rdc.equals("true")) {
+ if (Constants.rdc.equals("true")) {
//Allocate any avilable samsung device with Android version 12
capabilities.setCapability("appium:deviceName", "Samsung.*");
sauceOptions.setCapability("resigningEnabled", true);
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/IOSNativeAppTest.java b/appium-rdc/src/test/java/com/saucedemo/appium_rdc/IOSNativeAppTest.java
similarity index 92%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/IOSNativeAppTest.java
rename to appium-rdc/src/test/java/com/saucedemo/appium_rdc/IOSNativeAppTest.java
index 4346585f..fba80b7f 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/IOSNativeAppTest.java
+++ b/appium-rdc/src/test/java/com/saucedemo/appium_rdc/IOSNativeAppTest.java
@@ -1,6 +1,7 @@
-package com.examples.simple_example;
+package com.saucedemo.appium_rdc;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.Constants;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Before;
import org.junit.Rule;
@@ -17,7 +18,6 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
public class IOSNativeAppTest {
@@ -44,13 +44,13 @@ public void setUp() throws MalformedURLException {
URL url;
String appName;
- switch (region) {
+ switch (Constants.region) {
case "us":
- url = new URL(SAUCE_US_URL);
+ url = new URL(Constants.SAUCE_US_URL);
break;
case "eu":
default:
- url = new URL(SAUCE_EU_URL);
+ url = new URL(Constants.SAUCE_EU_URL);
break;
}
@@ -61,7 +61,7 @@ public void setUp() throws MalformedURLException {
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("appium:automationName", "XCuiTest");
- if (rdc.equals("true")) {
+ if (Constants.rdc.equals("true")) {
//Allocate any avilable iPhone device with version 14
capabilities.setCapability("appium:deviceName", "iPhone.*");
appName = "iOS.MyDemoAppRN.ipa";
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/README.md b/appium-rdc/src/test/java/com/saucedemo/appium_rdc/README.md
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/README.md
rename to appium-rdc/src/test/java/com/saucedemo/appium_rdc/README.md
index dde62025..98112055 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/simple_example/README.md
+++ b/appium-rdc/src/test/java/com/saucedemo/appium_rdc/README.md
@@ -41,7 +41,7 @@ Execute the following steps to manually upload the apps:
- Click on **App Upload** and OR select the folder, OR drag the apps to the screen to upload them
#### Automated upload
-You can find a script to upload them to, OR the US, OR EU DC in [this](../../helpers/push_apps_to_storage.sh)-file. You can push the files to the
+You can find a script to upload them to, OR the US, OR EU DC in [this](../../saucelabs/helpers/push_apps_to_storage.sh)-file. You can push the files to the
storage by doing the following from the folder `appium-app-examples`:
cd src/test/java/com/helpers/
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/allowlist/IOSAllowlistTest.java b/appium-rdc/src/test/java/com/saucelabs/allowlist/IOSAllowlistTest.java
similarity index 97%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/allowlist/IOSAllowlistTest.java
rename to appium-rdc/src/test/java/com/saucelabs/allowlist/IOSAllowlistTest.java
index d7ae5286..8393d28a 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/allowlist/IOSAllowlistTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/allowlist/IOSAllowlistTest.java
@@ -1,6 +1,6 @@
-package com.examples.allowlist;
+package com.saucelabs.allowlist;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Before;
import org.junit.Rule;
@@ -20,7 +20,7 @@
import java.util.HashMap;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
public class IOSAllowlistTest {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/allowlist/README.md b/appium-rdc/src/test/java/com/saucelabs/allowlist/README.md
similarity index 100%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/allowlist/README.md
rename to appium-rdc/src/test/java/com/saucelabs/allowlist/README.md
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/AndroidSettings.java b/appium-rdc/src/test/java/com/saucelabs/biometric_login/AndroidSettings.java
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/AndroidSettings.java
rename to appium-rdc/src/test/java/com/saucelabs/biometric_login/AndroidSettings.java
index 8f282834..ff9aa909 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/AndroidSettings.java
+++ b/appium-rdc/src/test/java/com/saucelabs/biometric_login/AndroidSettings.java
@@ -1,4 +1,4 @@
-package com.examples.biometric_login;
+package com.saucelabs.biometric_login;
import io.appium.java_client.android.AndroidDriver;
import org.openqa.selenium.By;
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginAndroidEmuTest.java b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginAndroidEmuTest.java
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginAndroidEmuTest.java
rename to appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginAndroidEmuTest.java
index b2df4dbc..3745d7bd 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginAndroidEmuTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginAndroidEmuTest.java
@@ -1,6 +1,6 @@
-package com.examples.biometric_login;
+package com.saucelabs.biometric_login;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Before;
import org.junit.Rule;
@@ -18,7 +18,7 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
public class BiometricLoginAndroidEmuTest {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginAndroidRDCTest.java b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginAndroidRDCTest.java
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginAndroidRDCTest.java
rename to appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginAndroidRDCTest.java
index ce4fd8ff..e9696ba5 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginAndroidRDCTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginAndroidRDCTest.java
@@ -1,6 +1,6 @@
-package com.examples.biometric_login;
+package com.saucelabs.biometric_login;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Before;
import org.junit.Rule;
@@ -18,7 +18,7 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
public class BiometricLoginAndroidRDCTest {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginIosRDCTest.java b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginIosRDCTest.java
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginIosRDCTest.java
rename to appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginIosRDCTest.java
index a19113a3..2da0a64f 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginIosRDCTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginIosRDCTest.java
@@ -1,6 +1,6 @@
-package com.examples.biometric_login;
+package com.saucelabs.biometric_login;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.AppiumBy;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Before;
@@ -22,7 +22,7 @@
import java.util.Collection;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(Parameterized.class)
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginIosSimTest.java b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginIosSimTest.java
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginIosSimTest.java
rename to appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginIosSimTest.java
index 8af33a32..84b8762b 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/BiometricLoginIosSimTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/biometric_login/BiometricLoginIosSimTest.java
@@ -1,6 +1,6 @@
-package com.examples.biometric_login;
+package com.saucelabs.biometric_login;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.AppiumBy;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Before;
@@ -22,7 +22,7 @@
import java.util.Collection;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(Parameterized.class)
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/README.md b/appium-rdc/src/test/java/com/saucelabs/biometric_login/README.md
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/README.md
rename to appium-rdc/src/test/java/com/saucelabs/biometric_login/README.md
index 9b3f8ae5..3d8029f8 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/biometric_login/README.md
+++ b/appium-rdc/src/test/java/com/saucelabs/biometric_login/README.md
@@ -40,7 +40,7 @@ Execute the following steps to manually upload the apps:
- Click on **App Upload** and OR select the folder, OR drag the apps to the screen to upload them
#### Automated upload
-You can find a script to upload them to, OR the US, OR EU DC in [this](../../helpers/push_apps_to_storage.sh)-file. You can push the files to the
+You can find a script to upload them to, OR the US, OR EU DC in [this](../helpers/push_apps_to_storage.sh)-file. You can push the files to the
storage by doing the following from the folder `appium-app-examples`:
cd src/test/java/com/helpers/
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/deep_link/DeepLinkAndroidTest.java b/appium-rdc/src/test/java/com/saucelabs/deep_link/DeepLinkAndroidTest.java
similarity index 97%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/deep_link/DeepLinkAndroidTest.java
rename to appium-rdc/src/test/java/com/saucelabs/deep_link/DeepLinkAndroidTest.java
index a83aaa40..84658300 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/deep_link/DeepLinkAndroidTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/deep_link/DeepLinkAndroidTest.java
@@ -1,6 +1,6 @@
-package com.examples.deep_link;
+package com.saucelabs.deep_link;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.AppiumBy;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Before;
@@ -19,7 +19,7 @@
import java.util.HashMap;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
/**
* Android Native App Tests
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/deep_link/README.md b/appium-rdc/src/test/java/com/saucelabs/deep_link/README.md
similarity index 97%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/deep_link/README.md
rename to appium-rdc/src/test/java/com/saucelabs/deep_link/README.md
index 806c5336..2c10c8fe 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/deep_link/README.md
+++ b/appium-rdc/src/test/java/com/saucelabs/deep_link/README.md
@@ -45,7 +45,7 @@ Execute the following steps to manually upload the apps:
- Click on **App Upload** and OR select the folder, OR drag the apps to the screen to upload them
#### Automated upload
-You can find a script to upload them to, OR the US, OR EU DC in [this](../../helpers/push_apps_to_storage.sh)-file. You can push the files to the
+You can find a script to upload them to, OR the US, OR EU DC in [this](../helpers/push_apps_to_storage.sh)-file. You can push the files to the
storage by doing the following from the folder `appium-app-examples`:
cd src/test/java/com/helpers/
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/GesturesAndroidNativeAppTest.java b/appium-rdc/src/test/java/com/saucelabs/gestures/GesturesAndroidNativeAppTest.java
similarity index 96%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/GesturesAndroidNativeAppTest.java
rename to appium-rdc/src/test/java/com/saucelabs/gestures/GesturesAndroidNativeAppTest.java
index 302cbf5c..890992e1 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/GesturesAndroidNativeAppTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/gestures/GesturesAndroidNativeAppTest.java
@@ -1,6 +1,7 @@
-package com.examples.gestures;
+package com.saucelabs.gestures;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.Constants;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Before;
import org.junit.Rule;
@@ -22,7 +23,6 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
/**
@@ -49,14 +49,14 @@ public void setup() throws MalformedURLException {
MutableCapabilities sauceOptions = new MutableCapabilities();
URL url;
- switch (region) {
+ switch (Constants.region) {
case "us":
- url = new URL(SAUCE_US_URL);
+ url = new URL(Constants.SAUCE_US_URL);
System.out.println("Sauce REGION US");
break;
case "eu":
default:
- url = new URL(SAUCE_EU_URL);
+ url = new URL(Constants.SAUCE_EU_URL);
System.out.println("Sauce REGION EU");
break;
}
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/GesturesIOSNativeAppTest.java b/appium-rdc/src/test/java/com/saucelabs/gestures/GesturesIOSNativeAppTest.java
similarity index 95%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/GesturesIOSNativeAppTest.java
rename to appium-rdc/src/test/java/com/saucelabs/gestures/GesturesIOSNativeAppTest.java
index 59d53600..45d95a5c 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/GesturesIOSNativeAppTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/gestures/GesturesIOSNativeAppTest.java
@@ -1,6 +1,7 @@
-package com.examples.gestures;
+package com.saucelabs.gestures;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.Constants;
import io.appium.java_client.AppiumBy;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Before;
@@ -22,7 +23,6 @@
import java.util.HashMap;
import java.util.List;
-import static com.helpers.Constants.*;
import static org.assertj.core.api.Assertions.assertThat;
public class GesturesIOSNativeAppTest {
@@ -46,13 +46,13 @@ public void setUp() throws MalformedURLException {
MutableCapabilities sauceOptions = new MutableCapabilities();
URL url;
- switch (region) {
+ switch (Constants.region) {
case "us":
- url = new URL(SAUCE_US_URL);
+ url = new URL(Constants.SAUCE_US_URL);
break;
case "eu":
default:
- url = new URL(SAUCE_EU_URL);
+ url = new URL(Constants.SAUCE_EU_URL);
break;
}
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/README.md b/appium-rdc/src/test/java/com/saucelabs/gestures/README.md
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/README.md
rename to appium-rdc/src/test/java/com/saucelabs/gestures/README.md
index 176b9778..ff7c4dd5 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/gestures/README.md
+++ b/appium-rdc/src/test/java/com/saucelabs/gestures/README.md
@@ -48,7 +48,7 @@ Execute the following steps to manually upload the apps:
- Click on **App Upload** and OR select the folder, OR drag the apps to the screen to upload them
#### Automated upload
-You can find a script to upload them to, OR the US, OR EU DC in [this](../../helpers/push_apps_to_storage.sh)-file. You can push the files to the
+You can find a script to upload them to, OR the US, OR EU DC in [this](../helpers/push_apps_to_storage.sh)-file. You can push the files to the
storage by doing the following from the folder `appium-app-examples`:
cd src/test/java/com/helpers/
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/helpers/Constants.java b/appium-rdc/src/test/java/com/saucelabs/helpers/Constants.java
similarity index 93%
rename from appium/appium-app/appium-app-examples/src/test/java/com/helpers/Constants.java
rename to appium-rdc/src/test/java/com/saucelabs/helpers/Constants.java
index ea538e48..c66227a8 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/helpers/Constants.java
+++ b/appium-rdc/src/test/java/com/saucelabs/helpers/Constants.java
@@ -1,4 +1,4 @@
-package com.helpers;
+package com.saucelabs.helpers;
public class Constants {
public static final String region = System.getProperty("region", "eu");
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/helpers/SauceAppiumTestWatcher.java b/appium-rdc/src/test/java/com/saucelabs/helpers/SauceAppiumTestWatcher.java
similarity index 96%
rename from appium/appium-app/appium-app-examples/src/test/java/com/helpers/SauceAppiumTestWatcher.java
rename to appium-rdc/src/test/java/com/saucelabs/helpers/SauceAppiumTestWatcher.java
index e2bb1e08..79d4de76 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/helpers/SauceAppiumTestWatcher.java
+++ b/appium-rdc/src/test/java/com/saucelabs/helpers/SauceAppiumTestWatcher.java
@@ -1,4 +1,4 @@
-package com.helpers;
+package com.saucelabs.helpers;
import io.appium.java_client.AppiumDriver;
import org.junit.rules.TestWatcher;
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/helpers/push_apps_to_storage.sh b/appium-rdc/src/test/java/com/saucelabs/helpers/push_apps_to_storage.sh
similarity index 100%
rename from appium/appium-app/appium-app-examples/src/test/java/com/helpers/push_apps_to_storage.sh
rename to appium-rdc/src/test/java/com/saucelabs/helpers/push_apps_to_storage.sh
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/ImageInjectionAndroidTest.java b/appium-rdc/src/test/java/com/saucelabs/image_injection/ImageInjectionAndroidTest.java
similarity index 97%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/ImageInjectionAndroidTest.java
rename to appium-rdc/src/test/java/com/saucelabs/image_injection/ImageInjectionAndroidTest.java
index b3aa5749..b637aaca 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/ImageInjectionAndroidTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/image_injection/ImageInjectionAndroidTest.java
@@ -1,7 +1,7 @@
-package com.examples.image_injection;
+package com.saucelabs.image_injection;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.AppiumBy;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Before;
@@ -23,7 +23,7 @@
import java.util.Base64;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
public class ImageInjectionAndroidTest {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/ImageInjectionIosTest.java b/appium-rdc/src/test/java/com/saucelabs/image_injection/ImageInjectionIosTest.java
similarity index 97%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/ImageInjectionIosTest.java
rename to appium-rdc/src/test/java/com/saucelabs/image_injection/ImageInjectionIosTest.java
index a836fda7..2f3fb9e9 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/ImageInjectionIosTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/image_injection/ImageInjectionIosTest.java
@@ -1,7 +1,7 @@
-package com.examples.image_injection;
+package com.saucelabs.image_injection;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.MobileBy;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Before;
@@ -21,7 +21,7 @@
import java.time.Duration;
import java.util.*;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
public class ImageInjectionIosTest {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/README.md b/appium-rdc/src/test/java/com/saucelabs/image_injection/README.md
similarity index 97%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/README.md
rename to appium-rdc/src/test/java/com/saucelabs/image_injection/README.md
index 3f3cfe7a..7e402ee5 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/README.md
+++ b/appium-rdc/src/test/java/com/saucelabs/image_injection/README.md
@@ -40,7 +40,7 @@ Execute the following steps to manually upload the apps:
- Click on **App Upload** and OR select the folder, OR drag the apps to the screen to upload them
#### Automated upload
-You can find a script to upload them to, OR the US, OR EU DC in [this](../../helpers/push_apps_to_storage.sh)-file. You can push the files to the
+You can find a script to upload them to, OR the US, OR EU DC in [this](../helpers/push_apps_to_storage.sh)-file. You can push the files to the
storage by doing the following from the folder `appium-app-examples`:
cd src/test/java/com/helpers/
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/images/qr-code.png b/appium-rdc/src/test/java/com/saucelabs/image_injection/images/qr-code.png
similarity index 100%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/image_injection/images/qr-code.png
rename to appium-rdc/src/test/java/com/saucelabs/image_injection/images/qr-code.png
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/mid_session_app_installs/MidSessionAppInstallsAndroidTest.java b/appium-rdc/src/test/java/com/saucelabs/mid_session_app_installs/MidSessionAppInstallsAndroidTest.java
similarity index 96%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/mid_session_app_installs/MidSessionAppInstallsAndroidTest.java
rename to appium-rdc/src/test/java/com/saucelabs/mid_session_app_installs/MidSessionAppInstallsAndroidTest.java
index aa9c63e6..b8f3d7f6 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/mid_session_app_installs/MidSessionAppInstallsAndroidTest.java
+++ b/appium-rdc/src/test/java/com/saucelabs/mid_session_app_installs/MidSessionAppInstallsAndroidTest.java
@@ -1,7 +1,7 @@
-package com.examples.mid_session_app_installs;
+package com.saucelabs.mid_session_app_installs;
import com.google.common.collect.ImmutableMap;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.android.AndroidDriver;
import lombok.var;
import org.junit.Before;
@@ -17,7 +17,7 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucelabs.helpers.Constants.*;
/**
* Android Native App Tests
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/mid_session_app_installs/README.md b/appium-rdc/src/test/java/com/saucelabs/mid_session_app_installs/README.md
similarity index 100%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/mid_session_app_installs/README.md
rename to appium-rdc/src/test/java/com/saucelabs/mid_session_app_installs/README.md
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/DownloadImageFromAndroidRealDevice.java b/appium-rdc/src/test/java/com/saucelabs/up_download_file/DownloadImageFromAndroidRealDevice.java
similarity index 95%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/DownloadImageFromAndroidRealDevice.java
rename to appium-rdc/src/test/java/com/saucelabs/up_download_file/DownloadImageFromAndroidRealDevice.java
index b3213373..d6a973e0 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/DownloadImageFromAndroidRealDevice.java
+++ b/appium-rdc/src/test/java/com/saucelabs/up_download_file/DownloadImageFromAndroidRealDevice.java
@@ -1,7 +1,7 @@
-package com.examples.up_download_file;
+package com.saucelabs.up_download_file;
-import com.helpers.Constants;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.Constants;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.android.AndroidDriver;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
@@ -19,8 +19,8 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.SAUCE_EU_URL;
-import static com.helpers.Constants.SAUCE_US_URL;
+import static com.saucelabs.helpers.Constants.SAUCE_EU_URL;
+import static com.saucelabs.helpers.Constants.SAUCE_US_URL;
import static org.assertj.core.api.Assertions.assertThat;
public class DownloadImageFromAndroidRealDevice {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/README.md b/appium-rdc/src/test/java/com/saucelabs/up_download_file/README.md
similarity index 95%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/README.md
rename to appium-rdc/src/test/java/com/saucelabs/up_download_file/README.md
index c5bde7be..3b2238e8 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/README.md
+++ b/appium-rdc/src/test/java/com/saucelabs/up_download_file/README.md
@@ -33,7 +33,7 @@ The examples in this repository that can run on Sauce Labs use environment varia
## Uploading files
### Android Real devices
-The script on how to use this can be found [here](./UploadImageToAndroidRealDevice.java) and the execution
+The script on how to use this can be found [here](UploadImageToAndroidRealDevice.java) and the execution
will look like this
![Upload Android real device](assets/upload-real-device.gif)
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/SamsungGallery.java b/appium-rdc/src/test/java/com/saucelabs/up_download_file/SamsungGallery.java
similarity index 98%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/SamsungGallery.java
rename to appium-rdc/src/test/java/com/saucelabs/up_download_file/SamsungGallery.java
index fa126745..909f9f94 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/SamsungGallery.java
+++ b/appium-rdc/src/test/java/com/saucelabs/up_download_file/SamsungGallery.java
@@ -1,4 +1,4 @@
-package com.examples.up_download_file;
+package com.saucelabs.up_download_file;
import io.appium.java_client.android.Activity;
import io.appium.java_client.android.AndroidDriver;
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/UploadImageToAndroidRealDevice.java b/appium-rdc/src/test/java/com/saucelabs/up_download_file/UploadImageToAndroidRealDevice.java
similarity index 94%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/UploadImageToAndroidRealDevice.java
rename to appium-rdc/src/test/java/com/saucelabs/up_download_file/UploadImageToAndroidRealDevice.java
index 1a1568c4..c5219285 100644
--- a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/UploadImageToAndroidRealDevice.java
+++ b/appium-rdc/src/test/java/com/saucelabs/up_download_file/UploadImageToAndroidRealDevice.java
@@ -1,7 +1,7 @@
-package com.examples.up_download_file;
+package com.saucelabs.up_download_file;
-import com.helpers.Constants;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucelabs.helpers.Constants;
+import com.saucelabs.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Assert;
import org.junit.Before;
@@ -16,8 +16,8 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.SAUCE_EU_URL;
-import static com.helpers.Constants.SAUCE_US_URL;
+import static com.saucelabs.helpers.Constants.SAUCE_EU_URL;
+import static com.saucelabs.helpers.Constants.SAUCE_US_URL;
import static org.assertj.core.api.Assertions.assertThat;
public class UploadImageToAndroidRealDevice {
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/assets/upload-real-device.gif b/appium-rdc/src/test/java/com/saucelabs/up_download_file/assets/upload-real-device.gif
similarity index 100%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/assets/upload-real-device.gif
rename to appium-rdc/src/test/java/com/saucelabs/up_download_file/assets/upload-real-device.gif
diff --git a/appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/sauce-bot-coding.png b/appium-rdc/src/test/java/com/saucelabs/up_download_file/sauce-bot-coding.png
similarity index 100%
rename from appium/appium-app/appium-app-examples/src/test/java/com/examples/up_download_file/sauce-bot-coding.png
rename to appium-rdc/src/test/java/com/saucelabs/up_download_file/sauce-bot-coding.png
diff --git a/appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/README.md b/appium-vdc/README.md
similarity index 85%
rename from appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/README.md
rename to appium-vdc/README.md
index 0b472d7d..67c7e508 100644
--- a/appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/README.md
+++ b/appium-vdc/README.md
@@ -25,7 +25,7 @@ If you want to run the tests on Sauce Labs Android Real Devices then you can run
// If using the EU DC
mvn clean test -Dtest=AndroidWebAppTest -Dregion=eu
-The tests, which can be found [here](AndroidWebAppTest.java), will be executed on:
+The tests, which can be found [here](src/test/java/com/saucedemo/appium_vdc/AndroidWebAppTest.java), will be executed on:
- Any available Samsung device with OS Android 12
> The devices use *dynamic* allocation, meaning they will try to find an available device that matches a regular expression.
@@ -40,7 +40,7 @@ If you want to run the tests on Sauce Labs Android emulators then you can run th
// If using the EU DC
mvn clean test -Dtest=AndroidWebAppTest -Dregion=eu -Drdc=false
-The tests, which can be found [here](AndroidWebAppTest.java), will be executed on:
+The tests, which can be found [here](src/test/java/com/saucedemo/appium_vdc/AndroidWebAppTest.java), will be executed on:
- Android GoogleAPI Emulator with OS Android 12
> NOTE: Make sure you are in the folder `appium-web-examples` when you execute this command
@@ -54,7 +54,7 @@ If you want to run the tests on iOS Sauce Labs Real Devices then you can run the
// If using the EU DC
mvn clean install -Dtest=IOSWebAppTest -Dregion=eu
-The tests, which can be found [here](IOSWebAppTest.java), will be executed on:
+The tests, which can be found [here](src/test/java/com/saucedemo/appium_vdc/IOSWebAppTest.java), will be executed on:
- Any available iPhone with OS 14
@@ -71,7 +71,7 @@ If you want to run the tests on Sauce Labs iOS simulators then you can run the A
// If using the EU DC
mvn clean install -Dtest=IOSWebAppTest -Dregion=eu -Drdc=false
-The tests, which can be found [here](IOSWebAppTest.java), will be executed on:
+The tests, which can be found [here](src/test/java/com/saucedemo/appium_vdc/IOSWebAppTest.java), will be executed on:
- iPhone 11 Simulator with OS 14
> NOTE: Make sure you are in the folder `appium-web-examples` when you execute this command
diff --git a/appium/appium-web/appium-web-examples/pom.xml b/appium-vdc/pom.xml
similarity index 97%
rename from appium/appium-web/appium-web-examples/pom.xml
rename to appium-vdc/pom.xml
index 65f6a9df..58f2bf19 100644
--- a/appium/appium-web/appium-web-examples/pom.xml
+++ b/appium-vdc/pom.xml
@@ -6,7 +6,7 @@
demo-java
com.saucelabs
1.0-SNAPSHOT
- ../../../pom.xml
+ ../pom.xml
4.0.0
diff --git a/appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/AndroidWebAppTest.java b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/AndroidWebAppTest.java
similarity index 96%
rename from appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/AndroidWebAppTest.java
rename to appium-vdc/src/test/java/com/saucedemo/appium_vdc/AndroidWebAppTest.java
index c6483c09..3be7ca59 100644
--- a/appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/AndroidWebAppTest.java
+++ b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/AndroidWebAppTest.java
@@ -1,6 +1,6 @@
-package com.examples.simple_example;
+package com.saucedemo.appium_vdc;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucedemo.appium_vdc.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import org.junit.Assert;
@@ -16,7 +16,7 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucedemo.appium_vdc.helpers.Constants.*;
/**
* Android Native App Tests
diff --git a/appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/IOSWebAppTest.java b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/IOSWebAppTest.java
similarity index 96%
rename from appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/IOSWebAppTest.java
rename to appium-vdc/src/test/java/com/saucedemo/appium_vdc/IOSWebAppTest.java
index bf077027..a100ebcc 100644
--- a/appium/appium-web/appium-web-examples/src/test/java/com/examples/simple_example/IOSWebAppTest.java
+++ b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/IOSWebAppTest.java
@@ -1,6 +1,6 @@
-package com.examples.simple_example;
+package com.saucedemo.appium_vdc;
-import com.helpers.SauceAppiumTestWatcher;
+import com.saucedemo.appium_vdc.helpers.SauceAppiumTestWatcher;
import io.appium.java_client.ios.IOSDriver;
import org.junit.Assert;
import org.junit.Before;
@@ -15,7 +15,7 @@
import java.util.Arrays;
import java.util.List;
-import static com.helpers.Constants.*;
+import static com.saucedemo.appium_vdc.helpers.Constants.*;
public class IOSWebAppTest {
diff --git a/appium/appium-web/appium-web-examples/src/test/java/com/helpers/Constants.java b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/helpers/Constants.java
similarity index 91%
rename from appium/appium-web/appium-web-examples/src/test/java/com/helpers/Constants.java
rename to appium-vdc/src/test/java/com/saucedemo/appium_vdc/helpers/Constants.java
index ea538e48..d734d309 100644
--- a/appium/appium-web/appium-web-examples/src/test/java/com/helpers/Constants.java
+++ b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/helpers/Constants.java
@@ -1,4 +1,4 @@
-package com.helpers;
+package com.saucedemo.appium_vdc.helpers;
public class Constants {
public static final String region = System.getProperty("region", "eu");
diff --git a/appium/appium-web/appium-web-examples/src/test/java/com/helpers/SauceAppiumTestWatcher.java b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/helpers/SauceAppiumTestWatcher.java
similarity index 95%
rename from appium/appium-web/appium-web-examples/src/test/java/com/helpers/SauceAppiumTestWatcher.java
rename to appium-vdc/src/test/java/com/saucedemo/appium_vdc/helpers/SauceAppiumTestWatcher.java
index e2bb1e08..58475341 100644
--- a/appium/appium-web/appium-web-examples/src/test/java/com/helpers/SauceAppiumTestWatcher.java
+++ b/appium-vdc/src/test/java/com/saucedemo/appium_vdc/helpers/SauceAppiumTestWatcher.java
@@ -1,4 +1,4 @@
-package com.helpers;
+package com.saucedemo.appium_vdc.helpers;
import io.appium.java_client.AppiumDriver;
import org.junit.rules.TestWatcher;
diff --git a/appium/appium-app/appium-app-examples/README.md b/appium/appium-app/appium-app-examples/README.md
deleted file mode 100644
index 8db4b692..00000000
--- a/appium/appium-app/appium-app-examples/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Appium examples
-This folder contains Appium examples
-
-## Examples for Native Apps
-* [Simple examples to get you started with your native appium testing](./src/test/java/com/examples/simple_example)
-* [Using biometric login on Sauce Labs](./src/test/java/com/examples/biometric_login)
-* [Using image injection on Sauce Labs](./src/test/java/com/examples/image_injection)
-* [Using gestures](./src/test/java/com/examples/gestures)
-* [Upload and download file](./src/test/java/com/examples/up_download_file)
-* [Using deep link](./src/test/java/com/examples/deep_link)
-* [Test your allowlisting app](./src/test/java/com/examples/allowlist)
diff --git a/gitpod/README.md b/gitpod/README.md
deleted file mode 100644
index 8b38cc3f..00000000
--- a/gitpod/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# Selenium examples
-This folder contains Gitpod examples
-
-## How to run tests
-
-### JUnit 5 test
-```bash
-cd gitpod
-mvn test -Dtest=
-```
-
-Your output will look like this if done correctly
-
-```java
-[INFO] Scanning for projects...
-[INFO]
-[INFO] ------------------< com.saucelabs:gitpod >-------------------
-[INFO] Building gitpod 1.0-SNAPSHOT
-[INFO] --------------------------------[ jar ]---------------------------------
-[INFO]
-[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gitpod ---
-[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
-[INFO] Copying 0 resource
-[INFO]
-[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ gitpod ---
-[INFO] Nothing to compile - all classes are up to date
-[INFO]
-[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gitpod ---
-[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
-[INFO] skip non existing resourceDirectory /Users/nikolayadvolodkin/Documents/source/java/demo-java/gitpod/src/test/resources
-[INFO]
-[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ gitpod ---
-[INFO] Nothing to compile - all classes are up to date
-[INFO]
-[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ gitpod ---
-[INFO]
-[INFO] -------------------------------------------------------
-[INFO] T E S T S
-[INFO] -------------------------------------------------------
-[INFO] Running com.saucedemo.JUnit5W3CChromeTest
-Apr 05, 2021 1:48:11 PM org.openqa.selenium.remote.ProtocolHandshake createSession
-INFO: Detected dialect: W3C
-SauceOnDemandSessionID=c36e76bd99964b29824e3c9597558659 job-name=Junit5W3CChromeTest
-Test Job Link: https://app.saucelabs.com/tests/c36e76bd99964b29824e3c9597558659
-[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.44 s - in com.saucedemo.JUnit5W3CChromeTest
-[INFO]
-[INFO] Results:
-[INFO]
-[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-[INFO]
-[INFO] ------------------------------------------------------------------------
-[INFO] BUILD SUCCESS
-[INFO] ------------------------------------------------------------------------
-[INFO] Total time: 9.728 s
-[INFO] Finished at: 2021-04-05T13:48:14-04:00
-
-```
-
diff --git a/gitpod/pom.xml b/gitpod/pom.xml
deleted file mode 100644
index 850d5007..00000000
--- a/gitpod/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
- demo-java
- com.saucelabs
- 1.0-SNAPSHOT
-
- 4.0.0
-
- gitpod
-
-
-
- com.saucelabs
- saucebindings-junit5
- 1.0.0
- test
-
-
- org.seleniumhq.selenium
- selenium-java
- 4.11.0
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven.surefire.version}
-
-
- 20
- 20
- 20
- 20
-
-
-
- junit.jupiter.execution.parallel.enabled = true
- junit.jupiter.execution.parallel.mode.default = concurrent
- junit.jupiter.execution.parallel.mode.classes.default = concurrent
- junit.jupiter.execution.parallel.config.strategy = fixed
- junit.jupiter.execution.parallel.config.strategy = custom
- junit.jupiter.execution.parallel.config.custom.class = com.saucelabs.saucebindings.junit5.CustomStrategy
-
-
-
-
-
-
-
diff --git a/gitpod/src/test/java/com/saucedemo/selenium/AppiumTest.java b/gitpod/src/test/java/com/saucedemo/selenium/AppiumTest.java
deleted file mode 100644
index ac7d9769..00000000
--- a/gitpod/src/test/java/com/saucedemo/selenium/AppiumTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.saucedemo.selenium.demo;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
-import org.junit.jupiter.api.extension.ExtensionContext;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.junit.jupiter.api.extension.TestWatcher;
-import org.openqa.selenium.MutableCapabilities;
-import org.openqa.selenium.remote.RemoteWebDriver;
-import io.appium.java_client.android.AndroidDriver;
-import io.appium.java_client.ios.IOSDriver;
-import io.appium.java_client.AppiumDriver;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ArrayList;
-
-/**
- * Demo tests with Appium.
- */
-public class AppiumTest {
- public AppiumDriver driver;
- public MutableCapabilities options;
-
- /**
- * A Test Watcher is needed to be able to get the results of a Test so that it can be sent to Sauce Labs.
- * Note that the name is never actually used
- */
- @RegisterExtension
- public SauceTestWatcher watcher = new SauceTestWatcher();
-
- @BeforeEach
- public void setup(TestInfo testInfo) throws MalformedURLException, InterruptedException {
- String platformName = System.getenv().getOrDefault("PLATFORM_NAME", "Android");
- options = new MutableCapabilities();
- String appName = System.getenv().getOrDefault("APP_NAME", null);
- String defaultBrowser = appName != null ? null : "Chrome";
- options.setCapability("browserName", System.getenv().getOrDefault("BROWSER_NAME", defaultBrowser));
- options.setCapability("platformName", platformName);
- options.setCapability("appium:app", "storage:filename=" + appName);
- options.setCapability("appium:platformVersion", System.getenv("PLATFORM_VERSION"));
- options.setCapability("appium:deviceName", System.getenv().getOrDefault("DEVICE_NAME", "Google.*"));
- options.setCapability("appium:automationName", System.getenv().getOrDefault("AUTOMATION_NAME", "UiAutomator2"));
-
- ArrayList tags = new ArrayList();
- if (System.getenv("GITPOD_WORKSPACE_ID") != null) {
- tags.add("gitpod");
- }
-
- Map sauceOptions = new HashMap<>();
- sauceOptions.put("appiumVersion", "2.0.0");
- sauceOptions.put("username", System.getenv("SAUCE_USERNAME"));
- sauceOptions.put("accessKey", System.getenv("SAUCE_ACCESS_KEY"));
- sauceOptions.put("build", System.getenv("BUILD"));
- sauceOptions.put("name", testInfo.getDisplayName());
- sauceOptions.put("tags", tags);
- options.setCapability("sauce:options", sauceOptions);
-
- String region = System.getenv().getOrDefault("REGION", "us-west-1");
- String ondemandUrl = "https://ondemand." + region + ".saucelabs.com:443/wd/hub";
- URL url = new URL(ondemandUrl);
-
- boolean isIos = platformName.toLowerCase() == "ios";
- if (isIos) {
- driver = new IOSDriver(url, options);
- } else {
- driver = new AndroidDriver(url, options);
- }
-
- }
-
- @DisplayName("Appium Test from Gitpod")
- @Test
- public void navigateAndClose() throws InterruptedException {
- // Add tests and assertions here
- if (options.getCapability("browserName") != null) {
- driver.get("https://saucedemo.com");
- }
-
- // Replace this with commands and assertions
- Thread.sleep(5000);
- }
-
- /**
- * Custom TestWatcher for Sauce Labs projects.
- */
- public class SauceTestWatcher implements TestWatcher {
- @Override
- public void testSuccessful(ExtensionContext context) {
- driver.executeScript("sauce:job-result=passed");
- driver.quit();
- }
-
- @Override
- public void testFailed(ExtensionContext context, Throwable cause) {
- driver.executeScript("sauce:job-result=failed");
- driver.quit();
- }
- }
-}
diff --git a/gitpod/src/test/java/com/saucedemo/selenium/SeleniumTest.java b/gitpod/src/test/java/com/saucedemo/selenium/SeleniumTest.java
deleted file mode 100644
index 412ce3e3..00000000
--- a/gitpod/src/test/java/com/saucedemo/selenium/SeleniumTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.saucedemo.selenium.demo;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
-import org.junit.jupiter.api.extension.ExtensionContext;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.junit.jupiter.api.extension.TestWatcher;
-import org.openqa.selenium.MutableCapabilities;
-import org.openqa.selenium.remote.RemoteWebDriver;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ArrayList;
-
-/**
- * Demo tests with Selenium.
- */
-public class SeleniumTest {
- public RemoteWebDriver driver;
-
- /**
- * A Test Watcher is needed to be able to get the results of a Test so that it can be sent to Sauce Labs.
- * Note that the name is never actually used
- */
- @RegisterExtension
- public SauceTestWatcher watcher = new SauceTestWatcher();
-
- @BeforeEach
- public void setup(TestInfo testInfo) throws MalformedURLException {
- MutableCapabilities options = new MutableCapabilities();
- options.setCapability("platformName", System.getenv("PLATFORM_NAME"));
- options.setCapability("browserName", System.getenv().getOrDefault("BROWSER_NAME", "chrome"));
- options.setCapability("browserVersion", System.getenv().getOrDefault("BROWSER_VERSION", "latest"));
-
- ArrayList tags = new ArrayList();
- if (System.getenv("GITPOD_WORKSPACE_ID") != null) {
- tags.add("gitpod");
- }
-
- Map sauceOptions = new HashMap<>();
- sauceOptions.put("username", System.getenv("SAUCE_USERNAME"));
- sauceOptions.put("accessKey", System.getenv("SAUCE_ACCESS_KEY"));
- sauceOptions.put("build", System.getenv("BUILD"));
- sauceOptions.put("name", testInfo.getDisplayName());
- sauceOptions.put("tags", tags);
- options.setCapability("sauce:options", sauceOptions);
-
- String region = System.getenv().getOrDefault("REGION", "us-west-1");
- String ondemandUrl = "https://ondemand." + region + ".saucelabs.com:443/wd/hub";
- URL url = new URL(ondemandUrl);
-
- driver = new RemoteWebDriver(url, options);
- }
-
- @DisplayName("Selenium Test from Gitpod")
- @Test
- public void navigateAndClose() {
- driver.navigate().to("https://www.saucedemo.com");
- Assertions.assertEquals("Swag Labs", driver.getTitle());
- }
-
- /**
- * Custom TestWatcher for Sauce Labs projects.
- */
- public class SauceTestWatcher implements TestWatcher {
- @Override
- public void testSuccessful(ExtensionContext context) {
- driver.executeScript("sauce:job-result=passed");
- driver.quit();
- }
-
- @Override
- public void testFailed(ExtensionContext context, Throwable cause) {
- driver.executeScript("sauce:job-result=failed");
- driver.quit();
- }
- }
-}
diff --git a/pom.xml b/pom.xml
index 3c2b1905..34a41577 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,15 +21,18 @@
best-practice
- appium-junit4-cucumber-examples
- gitpod
- selenium-cucumber-examples
- selenium-examples
- selenium-junit4-examples
- selenium-testng-examples
- appium/appium-app/appium-app-examples
+ appium-rdc
appium/appium-app/appium-app-best-practice
- appium/appium-web/appium-web-examples
+ appium-vdc
+ appium-junit4-cucumber-examples
+ best-practice
+ sauce-bindings
+ selenium
+ selenium-junit4
+ selenium-junit5
+ selenium-testng
+ training-advanced
+ training-sync
@@ -43,7 +46,6 @@
${selenium.version}
test
-
io.appium
java-client
diff --git a/selenium-cucumber-examples/.gitignore b/selenium-cucumber-examples/.gitignore
deleted file mode 100644
index bb8fc79d..00000000
--- a/selenium-cucumber-examples/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-*.class
-
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-
-# Package Files #
-*.jar
-*.war
-*.ear
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-.idea/
-target/
-*.iml
diff --git a/selenium-cucumber-examples/Makefile b/selenium-cucumber-examples/Makefile
deleted file mode 100644
index d5842b39..00000000
--- a/selenium-cucumber-examples/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-export START_TIME = $(shell date +%FT%T%Z)
-
-clean_it:
- mvn clean
-
-test_parallel:
- make -j windows_10_edge mac_sierra_chrome windows_7_ff windows_8_ie mac_mojave_safari
-
-sauce_demo:
- make clean_it test_parallel
-
-windows_10_edge:
- mvn clean test -Dplatform=$@
-
-mac_sierra_chrome:
- mvn clean test -Dplatform=$@
-
-windows_7_ff:
- mvn clean test -Dplatform=$@
-
-windows_8_ie:
- mvn clean test -Dplatform=$@
-
-mac_mojave_safari:
- mvn clean test -Dplatform=$@
diff --git a/selenium-cucumber-examples/README.md b/selenium-cucumber-examples/README.md
deleted file mode 100644
index 339056af..00000000
--- a/selenium-cucumber-examples/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Selenium Cucumber Examples
-
-## Changes to be made (reference Sauce Account)
-
-```bash
- export SAUCE_USERNAME=your_username
- export SAUCE_ACCESS_KEY=your_access_key
-```
-
-## Running the tests
-to run: `make run_all_in_parallel`
-
-## Running the tests with a proxy
-*replace PORT with port number and localhost as necessary*
-```shell
-mvn -Dhttp.proxyHost=localhost -Dhttp.proxyPort=PORT -Dhttps.proxyHost=localhost -Dhttps.proxyPort=PORT -Dhttps.proxyPort=PORT test
-```
diff --git a/selenium-cucumber-examples/pom.xml b/selenium-cucumber-examples/pom.xml
deleted file mode 100644
index f22e9ea0..00000000
--- a/selenium-cucumber-examples/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
- demo-java
- com.saucelabs
- 1.0-SNAPSHOT
-
- 4.0.0
-
- selenium-cucumber-examples
-
-
-
- info.cukes
- cucumber-java
- 1.2.4
-
-
- info.cukes
- cucumber-picocontainer
- 1.2.4
- test
-
-
- info.cukes
- cucumber-testng
- 1.2.4
-
-
- org.testng
- testng
- 6.9.10
- test
-
-
- org.apache.commons
- commons-io
- 1.3.2
-
-
- org.apache.maven.plugins
- maven-resources-plugin
- 2.7
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${maven.surefire.version}
-
- 6
- false
- -Duser.language=en
- -Xmx1024m
- -XX:MaxPermSize=256m
- -Dfile.encoding=UTF-8
- false
-
- **/*AT.class
-
- true
-
-
-
- maven-resources-plugin
- 2.7
-
-
- copy-resources
-
- validate
-
- copy-resources
-
-
- target/test-classes/com/yourcompany/saucecucumberjvm
-
-
- src/test/resources
- true
-
-
-
-
-
-
-
-
-
diff --git a/selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/RunTestsAT.java b/selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/RunTestsAT.java
deleted file mode 100644
index b0bcb140..00000000
--- a/selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/RunTestsAT.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.saucedemo.selenium.cucumber;
-
-import cucumber.api.CucumberOptions;
-import cucumber.api.testng.AbstractTestNGCucumberTests;
-
-@CucumberOptions(plugin = {"pretty"})
-public class RunTestsAT extends AbstractTestNGCucumberTests{
-}
diff --git a/selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/StepDefinitions.java b/selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/StepDefinitions.java
deleted file mode 100644
index b59c5f75..00000000
--- a/selenium-cucumber-examples/src/test/java/com/saucedemo/selenium/cucumber/StepDefinitions.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package com.saucedemo.selenium.cucumber;
-
-import com.saucelabs.saucebindings.Browser;
-import com.saucelabs.saucebindings.SaucePlatform;
-import com.saucelabs.saucebindings.SauceSession;
-import com.saucelabs.saucebindings.options.SauceOptions;
-import cucumber.api.Scenario;
-import cucumber.api.java.After;
-import cucumber.api.java.Before;
-import cucumber.api.java.en.And;
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
-import org.junit.Assert;
-import org.openqa.selenium.By;
-import org.openqa.selenium.remote.RemoteWebDriver;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import java.time.Duration;
-import java.util.stream.IntStream;
-
-public class StepDefinitions {
- private WebDriverWait wait;
-
- protected static ThreadLocal session = new ThreadLocal<>();
- protected static ThreadLocal options = new ThreadLocal<>();
-
- public SauceSession getSession() {
- return session.get();
- }
-
- public RemoteWebDriver getDriver() {
- return getSession().getDriver();
- }
-
-
- @Before
- public void setUp(Scenario scenario) {
- options.set(new SauceOptions());
- options.get().sauce().setName(scenario.getName());
-
- if (System.getenv("START_TIME") != null) {
- options.get().sauce().setBuild("Build Time: " + System.getenv("START_TIME"));
- }
-
- String platform;
- if (System.getProperty("platform") != null) {
- platform = System.getProperty("platform");
- } else {
- platform = "default";
- }
-
- switch(platform) {
- case "windows_10_edge":
- options.get().setPlatformName(SaucePlatform.WINDOWS_10);
- options.get().setBrowserName(Browser.EDGE);
- break;
- case "mac_sierra_chrome":
- options.get().setPlatformName(SaucePlatform.MAC_SIERRA);
- options.get().setBrowserName(Browser.CHROME);
- break;
- case "windows_8_ff":
- options.get().setPlatformName(SaucePlatform.WINDOWS_8);
- options.get().setBrowserName(Browser.FIREFOX);
- break;
- case "windows_8_1_ie":
- options.get().setPlatformName(SaucePlatform.WINDOWS_8_1);
- options.get().setBrowserName(Browser.INTERNET_EXPLORER);
- break;
- case "mac_mojave_safari":
- options.get().setPlatformName(SaucePlatform.MAC_MOJAVE);
- options.get().setBrowserName(Browser.SAFARI);
- break;
- default:
- // accept Sauce defaults
- break;
- }
-
- session.set(new SauceSession(options.get()));
-
- getSession().start();
- wait = new WebDriverWait(getDriver(), Duration.ofSeconds(10));
- }
-
- @After
- public void tearDown(Scenario scenario){
- getSession().stop(!scenario.isFailed());
- }
-
- @Given("^I go to the login page$")
- public void go_to_login_page() {
- getDriver().get("https://www.saucedemo.com");
- }
-
- @Given("I am on the inventory page")
- public void go_to_the_inventory_page(){
- getDriver().get("https://www.saucedemo.com/inventory.html");
- }
-
- @When("I login as a valid user")
- public void login_as_valid_user() {
- login("standard_user", "secret_sauce");
- }
-
- @When("I login as an invalid user")
- public void login_as_invalid_user() {
- login("doesnt_exist", "secret_sauce");
- }
-
- /**
- * Use this method to send any number of login/password parameters, to test different edge cases or roles within
- * the software. This method exists to show an example of how steps can call other parameterized methods.
- * @param username The user name to login with
- * @param password The password to use (for testing the password field
- */
- private void login(String username, String password) {
- wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("user-name")));
- getDriver().findElement(By.id("user-name")).sendKeys(username);
-
- wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("password")));
- getDriver().findElement(By.id("password")).sendKeys(password);
-
- getDriver().findElement(By.className("btn_action")).click();
- }
-
- @When("^I add (\\d+) items? to the cart$")
- public void add_items_to_cart(int items){
- By itemButton = By.className("btn_primary");
-
- IntStream.range(0, items).forEach(i -> {
- wait.until(ExpectedConditions.elementToBeClickable(getDriver().findElement(itemButton)));
- getDriver().findElement(itemButton).click();
- });
- }
-
- @And("I remove an item")
- public void remove_an_item(){
- By itemButton = By.className("btn_secondary");
-
- wait.until(ExpectedConditions.elementToBeClickable(getDriver().findElement(itemButton)));
- getDriver().findElement(itemButton).click();
- }
-
- @Then("I have (\\d) items? in my cart")
- public void one_item_in_cart(Integer items) {
- String expected_items = items.toString();
-
- By itemsInCart = By.className("shopping_cart_badge");
-
- wait.until(ExpectedConditions.elementToBeClickable(getDriver().findElement(itemsInCart)));
- Assert.assertEquals(getDriver().findElement(itemsInCart).getText(), expected_items);
- }
-
- @Then("The item list is not displayed")
- public void item_list_is_not_diplayed() {
- Assert.assertEquals(getDriver().findElements(By.id("inventory_container")).size(), 0);
- }
-
- @Then("The item list is displayed")
- public void item_list_is_diplayed() {
- Assert.assertTrue(getDriver().findElement(By.id("inventory_container")).isDisplayed());
- }
-}
diff --git a/selenium-cucumber-examples/src/test/resources/AddItem.feature b/selenium-cucumber-examples/src/test/resources/AddItem.feature
deleted file mode 100644
index d82b254a..00000000
--- a/selenium-cucumber-examples/src/test/resources/AddItem.feature
+++ /dev/null
@@ -1,11 +0,0 @@
-Feature: Add Item To Cart
-
- Scenario: Adding one item to a cart
- Given I am on the inventory page
- When I add 1 item to the cart
- Then I have 1 item in my cart
-
- Scenario: Adding two items to a cart
- Given I am on the inventory page
- When I add 2 item to the cart
- Then I have 2 items in my cart
\ No newline at end of file
diff --git a/selenium-cucumber-examples/src/test/resources/InvalidLogin.feature b/selenium-cucumber-examples/src/test/resources/InvalidLogin.feature
deleted file mode 100644
index 5f770813..00000000
--- a/selenium-cucumber-examples/src/test/resources/InvalidLogin.feature
+++ /dev/null
@@ -1,6 +0,0 @@
-Feature: Invalid Login
-
- Scenario: Login as invalid user
- Given I go to the login page
- When I login as an invalid user
- Then The item list is not displayed
\ No newline at end of file
diff --git a/selenium-cucumber-examples/src/test/resources/RemoveItem.feature b/selenium-cucumber-examples/src/test/resources/RemoveItem.feature
deleted file mode 100644
index 43a35120..00000000
--- a/selenium-cucumber-examples/src/test/resources/RemoveItem.feature
+++ /dev/null
@@ -1,7 +0,0 @@
-Feature: Remove Item from Cart
-
- Scenario: Removing one item from cart
- Given I am on the inventory page
- When I add 2 items to the cart
- And I remove an item
- Then I have 1 item in my cart
diff --git a/selenium-cucumber-examples/src/test/resources/ValidLogin.feature b/selenium-cucumber-examples/src/test/resources/ValidLogin.feature
deleted file mode 100644
index e5345491..00000000
--- a/selenium-cucumber-examples/src/test/resources/ValidLogin.feature
+++ /dev/null
@@ -1,6 +0,0 @@
-Feature: Valid Login
-
- Scenario: Login as valid user
- Given I go to the login page
- When I login as a valid user
- Then The item list is displayed
\ No newline at end of file
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/AuthenticationTest.java b/selenium-examples/src/test/java/com/saucedemo/selenium/demo/AuthenticationTest.java
deleted file mode 100644
index 03273aa0..00000000
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/AuthenticationTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.saucedemo.selenium.demo;
-
-import com.saucedemo.selenium.TestBase;
-import org.junit.jupiter.api.*;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-public class AuthenticationTest extends TestBase {
-
- @BeforeEach
- public void setup(TestInfo testInfo) {
- startFirefoxSession(testInfo);
- }
-
- @Test
- public void signInUnsuccessful() {
- driver.get("https://www.saucedemo.com/");
-
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("locked_out_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
-
- WebElement errorElement = driver.findElement(By.cssSelector("[data-test='error']"));
- Assertions.assertTrue(
- errorElement.getText().contains("Sorry, this user has been locked out"), "Error Not Found");
- }
-
- @Test
- public void signInSuccessful() {
- driver.get("https://www.saucedemo.com/");
-
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
-
- Assertions.assertEquals(
- "https://www.saucedemo.com/inventory.html", driver.getCurrentUrl(), "Login Not Successful");
- }
-
- @Test
- public void logout() throws InterruptedException {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.id("react-burger-menu-btn")).click();
- Thread.sleep(1000);
-
- driver.findElement(By.id("logout_sidebar_link")).click();
-
- Assertions.assertEquals(
- "https://www.saucedemo.com/", driver.getCurrentUrl(), "Logout Not Successful");
- }
-}
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/CartTest.java b/selenium-examples/src/test/java/com/saucedemo/selenium/demo/CartTest.java
deleted file mode 100644
index 672b19c5..00000000
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/CartTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.saucedemo.selenium.demo;
-
-import com.saucedemo.selenium.TestBase;
-import org.junit.jupiter.api.*;
-import org.openqa.selenium.By;
-
-public class CartTest extends TestBase {
-
- @BeforeEach
- public void setup(TestInfo testInfo) {
- startFirefoxSession(testInfo);
- }
-
- @Test
- public void addFromProductPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
-
- driver.findElement(By.id("item_1_title_link")).click();
-
- driver
- .findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-bolt-t-shirt']"))
- .click();
-
- Assertions.assertEquals(
- "1",
- driver.findElement(By.className("shopping_cart_badge")).getText(),
- "Item not correctly added to cart");
- }
-
- @Test
- public void removeFromProductPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.id("item_1_title_link")).click();
- driver
- .findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-bolt-t-shirt']"))
- .click();
-
- driver
- .findElement(By.cssSelector("button[data-test='remove-sauce-labs-bolt-t-shirt']"))
- .click();
-
- Assertions.assertTrue(
- driver.findElements(By.className("shopping_cart_badge")).isEmpty(),
- "Item not correctly removed from cart");
- }
-
- @Test
- public void addFromInventoryPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
-
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
-
- Assertions.assertEquals("1", driver.findElement(By.className("shopping_cart_badge")).getText());
- }
-
- @Test
- public void removeFromInventoryPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver
- .findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-bike-light']"))
- .click();
-
- driver.findElement(By.cssSelector("button[data-test='remove-sauce-labs-bike-light']")).click();
-
- Assertions.assertTrue(
- driver.findElements(By.className("shopping_cart_badge")).isEmpty(),
- "Shopping Cart is not empty");
- }
-
- @Test
- public void removeFromCartPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver
- .findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-backpack']"))
- .click();
- driver.findElement(By.className("shopping_cart_link")).click();
-
- driver.findElement(By.cssSelector("button[data-test='remove-sauce-labs-backpack']")).click();
-
- Assertions.assertTrue(
- driver.findElements(By.className("shopping_cart_badge")).isEmpty(),
- "Shopping Cart is not empty");
- }
-}
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/CheckoutTest.java b/selenium-examples/src/test/java/com/saucedemo/selenium/demo/CheckoutTest.java
deleted file mode 100644
index a4f64258..00000000
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/CheckoutTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.saucedemo.selenium.demo;
-
-import com.saucedemo.selenium.TestBase;
-import org.junit.jupiter.api.*;
-import org.openqa.selenium.By;
-
-public class CheckoutTest extends TestBase {
-
- @BeforeEach
- public void setup(TestInfo testInfo) {
- startFirefoxSession(testInfo);
- }
-
- @Test
- public void badInfo() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
- driver.findElement(By.cssSelector("button[data-test='checkout']")).click();
-
- driver.findElement(By.cssSelector("input[data-test='continue']")).click();
-
- Assertions.assertTrue(
- driver
- .findElement(By.cssSelector("input[data-test='firstName']"))
- .getAttribute("class")
- .contains("error"),
- "Expected error not found on page");
- }
-
- @Test
- public void goodInfo() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
- driver.findElement(By.cssSelector("button[data-test='checkout']")).click();
-
- driver.findElement(By.cssSelector("input[data-test='firstName']")).sendKeys("Luke");
- driver.findElement(By.cssSelector("input[data-test='lastName']")).sendKeys("Perry");
- driver.findElement(By.cssSelector("input[data-test='postalCode']")).sendKeys("90210");
-
- driver.findElement(By.cssSelector("input[data-test='continue']")).click();
-
- Assertions.assertEquals(
- "https://www.saucedemo.com/checkout-step-two.html",
- driver.getCurrentUrl(),
- "Information Submission Unsuccessful");
- }
-
- @Test
- public void completeCheckout() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
- driver.findElement(By.cssSelector("button[data-test='checkout']")).click();
- driver.findElement(By.cssSelector("input[data-test='firstName']")).sendKeys("Luke");
- driver.findElement(By.cssSelector("input[data-test='lastName']")).sendKeys("Perry");
- driver.findElement(By.cssSelector("input[data-test='postalCode']")).sendKeys("90210");
- driver.findElement(By.cssSelector("input[data-test='continue']")).click();
-
- driver.findElement(By.cssSelector("button[data-test='finish']")).click();
-
- Assertions.assertEquals(
- "https://www.saucedemo.com/checkout-complete.html", driver.getCurrentUrl());
-
- Assertions.assertTrue(driver.findElement(By.className("complete-text")).isDisplayed());
- }
-}
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/NavigationTest.java b/selenium-examples/src/test/java/com/saucedemo/selenium/demo/NavigationTest.java
deleted file mode 100644
index 6b538d14..00000000
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/demo/NavigationTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.saucedemo.selenium.demo;
-
-import com.saucedemo.selenium.TestBase;
-import org.junit.jupiter.api.*;
-import org.openqa.selenium.By;
-
-public class NavigationTest extends TestBase {
-
- @BeforeEach
- public void setup(TestInfo testInfo) {
- startFirefoxSession(testInfo);
- }
-
- @Test
- public void cancelFromCart() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
-
- driver.findElement(By.cssSelector("button[data-test='continue-shopping']")).click();
-
- Assertions.assertEquals("https://www.saucedemo.com/inventory.html", driver.getCurrentUrl());
- }
-
- @Test
- public void cancelFromInfoPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
- driver.findElement(By.cssSelector("button[data-test='checkout']")).click();
-
- driver.findElement(By.cssSelector("button[data-test='cancel']")).click();
-
- Assertions.assertEquals("https://www.saucedemo.com/cart.html", driver.getCurrentUrl());
- }
-
- @Test
- public void cancelFromCheckoutPage() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
- driver.findElement(By.cssSelector("button[data-test='checkout']")).click();
- driver.findElement(By.cssSelector("input[data-test='firstName']")).sendKeys("Luke");
- driver.findElement(By.cssSelector("input[data-test='lastName']")).sendKeys("Perry");
- driver.findElement(By.cssSelector("input[data-test='postalCode']")).sendKeys("90210");
- driver.findElement(By.cssSelector("input[data-test='continue']")).click();
-
- driver.findElement(By.cssSelector("button[data-test='cancel']")).click();
-
- Assertions.assertEquals("https://www.saucedemo.com/inventory.html", driver.getCurrentUrl());
- }
-
- @Test
- public void startCheckout() {
- driver.get("https://www.saucedemo.com/");
- driver.findElement(By.cssSelector("input[data-test='username']")).sendKeys("standard_user");
- driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
- driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- driver.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-onesie']")).click();
- driver.findElement(By.className("shopping_cart_link")).click();
-
- driver.findElement(By.cssSelector("button[data-test='checkout']")).click();
-
- Assertions.assertEquals(
- "https://www.saucedemo.com/checkout-step-one.html", driver.getCurrentUrl());
- }
-}
diff --git a/selenium-junit4-examples/README.md b/selenium-junit4/README.md
similarity index 100%
rename from selenium-junit4-examples/README.md
rename to selenium-junit4/README.md
diff --git a/selenium-junit4-examples/pom.xml b/selenium-junit4/pom.xml
similarity index 90%
rename from selenium-junit4-examples/pom.xml
rename to selenium-junit4/pom.xml
index eac37351..96ebb23f 100644
--- a/selenium-junit4-examples/pom.xml
+++ b/selenium-junit4/pom.xml
@@ -5,7 +5,7 @@
4.0.0
com.com.saucelabs
- selenium_junit4_examples
+ selenium-junit4
1.0-SNAPSHOT
Sauce Labs Selenium Examples
@@ -28,10 +28,9 @@
- com.saucelabs
- saucebindings-junit4
- 1.0.1
- test
+ junit
+ junit
+ 4.13.2
org.seleniumhq.selenium
diff --git a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/AuthenticationTest.java b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/AuthenticationTest.java
similarity index 85%
rename from selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/AuthenticationTest.java
rename to selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/AuthenticationTest.java
index 4f96fa13..9695a2e8 100644
--- a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/AuthenticationTest.java
+++ b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/AuthenticationTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.junit4.demo;
+package com.saucedemo.selenium_junit4;
import org.junit.Assert;
import org.junit.Before;
@@ -33,8 +33,7 @@ public void signInSuccessful() {
driver.findElement(By.cssSelector("input[data-test='password']")).sendKeys("secret_sauce");
driver.findElement(By.cssSelector("input[data-test='login-button']")).click();
- Assert.assertEquals(
- "https://www.saucedemo.com/inventory.html", driver.getCurrentUrl(), "Login Not Successful");
+ Assert.assertEquals("https://www.saucedemo.com/inventory.html", driver.getCurrentUrl());
}
@Test
@@ -48,7 +47,6 @@ public void logout() throws InterruptedException {
driver.findElement(By.id("logout_sidebar_link")).click();
- Assert.assertEquals(
- "https://www.saucedemo.com/", driver.getCurrentUrl(), "Logout Not Successful");
+ Assert.assertEquals("https://www.saucedemo.com/", driver.getCurrentUrl());
}
}
diff --git a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/CartTest.java b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/CartTest.java
similarity index 94%
rename from selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/CartTest.java
rename to selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/CartTest.java
index c357113b..51a282f4 100644
--- a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/CartTest.java
+++ b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/CartTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.junit4.demo;
+package com.saucedemo.selenium_junit4;
import org.junit.Assert;
import org.junit.Before;
@@ -25,10 +25,7 @@ public void addFromProductPage() {
.findElement(By.cssSelector("button[data-test='add-to-cart-sauce-labs-bolt-t-shirt']"))
.click();
- Assert.assertEquals(
- "1",
- driver.findElement(By.className("shopping_cart_badge")).getText(),
- "Item not correctly added to cart");
+ Assert.assertEquals("1", driver.findElement(By.className("shopping_cart_badge")).getText());
}
@Test
diff --git a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/CheckoutTest.java b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/CheckoutTest.java
similarity index 94%
rename from selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/CheckoutTest.java
rename to selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/CheckoutTest.java
index d5e36487..33e88d77 100644
--- a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/CheckoutTest.java
+++ b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/CheckoutTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.junit4.demo;
+package com.saucedemo.selenium_junit4;
import org.junit.Assert;
import org.junit.Before;
@@ -47,10 +47,7 @@ public void goodInfo() {
driver.findElement(By.cssSelector("input[data-test='continue']")).click();
- Assert.assertEquals(
- "https://www.saucedemo.com/checkout-step-two.html",
- driver.getCurrentUrl(),
- "Information Submission Unsuccessful");
+ Assert.assertEquals("https://www.saucedemo.com/checkout-step-two.html", driver.getCurrentUrl());
}
@Test
diff --git a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/NavigationTest.java b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/NavigationTest.java
similarity index 98%
rename from selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/NavigationTest.java
rename to selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/NavigationTest.java
index b74095f5..67c9fee3 100644
--- a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/NavigationTest.java
+++ b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/NavigationTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.junit4.demo;
+package com.saucedemo.selenium_junit4;
import org.junit.Assert;
import org.junit.Before;
diff --git a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/TestBase.java b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/TestBase.java
similarity index 96%
rename from selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/TestBase.java
rename to selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/TestBase.java
index f3677070..dd3d6649 100644
--- a/selenium-junit4-examples/src/test/java/com/saucedemo/selenium/junit4/demo/TestBase.java
+++ b/selenium-junit4/src/test/java/com/saucedemo/selenium_junit4/TestBase.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.junit4.demo;
+package com.saucedemo.selenium_junit4;
import java.net.MalformedURLException;
import java.net.URL;
@@ -46,7 +46,7 @@ protected void startSession(Capabilities options, Map sauceOptio
sauceOptions.put("username", System.getenv("SAUCE_USERNAME"));
sauceOptions.put("accessKey", System.getenv("SAUCE_ACCESS_KEY"));
- sauceOptions.put("name", testName);
+ sauceOptions.put("name", testName.getMethodName());
sauceOptions.put("seleniumVersion", "4.14.1");
((MutableCapabilities) options).setCapability("sauce:options", sauceOptions);
((AbstractDriverOptions>) options).setPlatformName("Windows 11");
diff --git a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTest.java b/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTest.java
deleted file mode 100644
index 8a985229..00000000
--- a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.saucedemo.selenium.testng.demo;
-
-import com.saucelabs.saucebindings.SauceSession;
-import com.saucelabs.saucebindings.options.SauceOptions;
-import org.openqa.selenium.remote.RemoteWebDriver;
-import org.testng.Assert;
-import org.testng.ITestResult;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.lang.reflect.Method;
-
-/**
- * Example Tests for running with Sauce Bindings diriectly without test runner jar.
- */
-public class SauceBindingsTest {
- protected SauceSession session;
- protected RemoteWebDriver driver;
-
- @BeforeMethod
- public void setup(Method method) {
- SauceOptions options = SauceOptions.chrome().setName(method.getName()).build();
- session = new SauceSession(options);
- driver = session.start();
- }
-
- @Test
- public void correctTitle() {
- driver.navigate().to("https://www.saucedemo.com");
- Assert.assertEquals("Swag Labs", driver.getTitle());
- }
-
- @AfterMethod
- public void teardown(ITestResult result) {
- session.stop(result.isSuccess());
- }
-}
diff --git a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTestngTest.java b/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTestngTest.java
deleted file mode 100644
index 3d3dae6d..00000000
--- a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SauceBindingsTestngTest.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.saucedemo.selenium.testng.demo;
-
-import com.saucelabs.saucebindings.testng.SauceBaseTest;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Example Test for running with the TestNG Sauce Bindings library.
- */
-public class SauceBindingsTestngTest extends SauceBaseTest {
- @Test
- public void correctTitle() {
- getDriver().navigate().to("https://www.saucedemo.com");
- Assert.assertEquals("Swag Labs", getDriver().getTitle());
- }
-}
diff --git a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SeleniumTest.java b/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SeleniumTest.java
deleted file mode 100644
index 17ddd086..00000000
--- a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/demo/SeleniumTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.saucedemo.selenium.testng.demo;
-
-import org.openqa.selenium.MutableCapabilities;
-import org.openqa.selenium.chrome.ChromeOptions;
-import org.openqa.selenium.remote.RemoteWebDriver;
-import org.testng.Assert;
-import org.testng.ITestResult;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * Example of running a TestNG test without using Sauce Bindings.
- */
-public class SeleniumTest {
- protected RemoteWebDriver driver;
-
- @BeforeMethod
- public void setup(Method method) throws MalformedURLException {
- MutableCapabilities sauceOptions = new MutableCapabilities();
- sauceOptions.setCapability("username", System.getenv("SAUCE_USERNAME"));
- sauceOptions.setCapability("accessKey", System.getenv("SAUCE_ACCESS_KEY"));
- sauceOptions.setCapability("name", method.getName());
- sauceOptions.setCapability("browserVersion", "latest");
-
- ChromeOptions options = new ChromeOptions();
- options.setCapability("sauce:options", sauceOptions);
- URL url = new URL("https://ondemand.us-west-1.saucelabs.com/wd/hub");
-
- driver = new RemoteWebDriver(url, options);
- }
-
- @Test
- public void correctTitle() {
- driver.navigate().to("https://www.saucedemo.com");
- Assert.assertEquals("Swag Labs", driver.getTitle());
- }
-
- @AfterMethod
- public void teardown(ITestResult result) {
- String status = result.isSuccess() ? "passed" : "failed";
- driver.executeScript("sauce:job-result=" + status);
- }
-}
diff --git a/selenium-testng-examples/README.md b/selenium-testng/README.md
similarity index 100%
rename from selenium-testng-examples/README.md
rename to selenium-testng/README.md
diff --git a/selenium-testng-examples/pom.xml b/selenium-testng/pom.xml
similarity index 95%
rename from selenium-testng-examples/pom.xml
rename to selenium-testng/pom.xml
index bf746b0b..fc59062d 100644
--- a/selenium-testng-examples/pom.xml
+++ b/selenium-testng/pom.xml
@@ -9,7 +9,7 @@
4.0.0
- selenium-testng-examples
+ selenium-testng
diff --git a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/CrossBrowserPlatformTest.java b/selenium-testng/src/test/java/com/saucedemo/selenium_testng/CrossBrowserPlatformTest.java
similarity index 98%
rename from selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/CrossBrowserPlatformTest.java
rename to selenium-testng/src/test/java/com/saucedemo/selenium_testng/CrossBrowserPlatformTest.java
index feeac32a..47639534 100644
--- a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/CrossBrowserPlatformTest.java
+++ b/selenium-testng/src/test/java/com/saucedemo/selenium_testng/CrossBrowserPlatformTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.testng;
+package com.saucedemo.selenium_testng;
import com.saucelabs.saucebindings.options.SauceOptions;
import com.saucelabs.saucebindings.testng.SauceParameterizedBaseTest;
diff --git a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/ParallelSingleBrowserTest.java b/selenium-testng/src/test/java/com/saucedemo/selenium_testng/ParallelSingleBrowserTest.java
similarity index 98%
rename from selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/ParallelSingleBrowserTest.java
rename to selenium-testng/src/test/java/com/saucedemo/selenium_testng/ParallelSingleBrowserTest.java
index 3b815db4..612b33c0 100644
--- a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/ParallelSingleBrowserTest.java
+++ b/selenium-testng/src/test/java/com/saucedemo/selenium_testng/ParallelSingleBrowserTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.testng;
+package com.saucedemo.selenium_testng;
import com.saucelabs.saucebindings.testng.SauceBaseTest;
import org.testng.Assert;
diff --git a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/SampleHeadlessSauceTest.java b/selenium-testng/src/test/java/com/saucedemo/selenium_testng/SampleHeadlessSauceTest.java
similarity index 97%
rename from selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/SampleHeadlessSauceTest.java
rename to selenium-testng/src/test/java/com/saucedemo/selenium_testng/SampleHeadlessSauceTest.java
index dd220877..7fbddf8d 100644
--- a/selenium-testng-examples/src/test/java/com/saucedemo/selenium/testng/SampleHeadlessSauceTest.java
+++ b/selenium-testng/src/test/java/com/saucedemo/selenium_testng/SampleHeadlessSauceTest.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium.testng;
+package com.saucedemo.selenium_testng;
import com.saucelabs.saucebindings.DataCenter;
import com.saucelabs.saucebindings.SauceOptions;
diff --git a/selenium-examples/README.md b/selenium/README.md
similarity index 100%
rename from selenium-examples/README.md
rename to selenium/README.md
diff --git a/selenium-examples/pom.xml b/selenium/pom.xml
similarity index 98%
rename from selenium-examples/pom.xml
rename to selenium/pom.xml
index b46d9bca..d07de7cc 100644
--- a/selenium-examples/pom.xml
+++ b/selenium/pom.xml
@@ -5,7 +5,7 @@
4.0.0
com.saucelabs
- selenium_examples
+ selenium
1.0-SNAPSHOT
Sauce Labs Selenium Examples
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/AttributePropertyTest.java b/selenium/src/test/java/com/saucelabs/selenium/AttributePropertyTest.java
similarity index 98%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/AttributePropertyTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/AttributePropertyTest.java
index 891687c3..57064cfe 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/AttributePropertyTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/AttributePropertyTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.*;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/CapabilitiesMergeTest.java b/selenium/src/test/java/com/saucelabs/selenium/CapabilitiesMergeTest.java
similarity index 93%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/CapabilitiesMergeTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/CapabilitiesMergeTest.java
index f4a435de..05ec694f 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/CapabilitiesMergeTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/CapabilitiesMergeTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.*;
import org.openqa.selenium.PageLoadStrategy;
import org.openqa.selenium.UnexpectedAlertBehaviour;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/CdpEndpointTest.java b/selenium/src/test/java/com/saucelabs/selenium/CdpEndpointTest.java
similarity index 96%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/CdpEndpointTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/CdpEndpointTest.java
index 697efd8c..6ff8d79c 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/CdpEndpointTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/CdpEndpointTest.java
@@ -1,7 +1,7 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
import com.google.common.collect.ImmutableMap;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.util.*;
import org.junit.jupiter.api.*;
import org.openqa.selenium.*;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ChromeNetworkTest.java b/selenium/src/test/java/com/saucelabs/selenium/ChromeNetworkTest.java
similarity index 93%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ChromeNetworkTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/ChromeNetworkTest.java
index 7123ba10..b6ca544c 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ChromeNetworkTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/ChromeNetworkTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/DevToolsTest.java b/selenium/src/test/java/com/saucelabs/selenium/DevToolsTest.java
similarity index 99%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/DevToolsTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/DevToolsTest.java
index 0bd27acb..d4c75460 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/DevToolsTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/DevToolsTest.java
@@ -1,11 +1,11 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
import static org.openqa.selenium.devtools.events.CdpEventTypes.consoleEvent;
import static org.openqa.selenium.devtools.events.CdpEventTypes.domMutation;
import com.google.common.collect.ImmutableMap;
import com.google.common.net.MediaType;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.net.URI;
import java.time.Duration;
import java.util.*;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/DurationParameterTest.java b/selenium/src/test/java/com/saucelabs/selenium/DurationParameterTest.java
similarity index 91%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/DurationParameterTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/DurationParameterTest.java
index 637d5c81..a3ba3ecf 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/DurationParameterTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/DurationParameterTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.time.Duration;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FindByTest.java b/selenium/src/test/java/com/saucelabs/selenium/FindByTest.java
similarity index 89%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FindByTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/FindByTest.java
index a03a42d4..1aff72fb 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FindByTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/FindByTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FirefoxAddonTest.java b/selenium/src/test/java/com/saucelabs/selenium/FirefoxAddonTest.java
similarity index 93%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FirefoxAddonTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/FirefoxAddonTest.java
index 1239c34f..f4e17ce3 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FirefoxAddonTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/FirefoxAddonTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.nio.file.Paths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FirefoxContextTest.java b/selenium/src/test/java/com/saucelabs/selenium/FirefoxContextTest.java
similarity index 94%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FirefoxContextTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/FirefoxContextTest.java
index 18296aeb..1e719155 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/FirefoxContextTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/FirefoxContextTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/MSEdgeTest.java b/selenium/src/test/java/com/saucelabs/selenium/MSEdgeTest.java
similarity index 91%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/MSEdgeTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/MSEdgeTest.java
index 57cfbdd2..e2dfd32e 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/MSEdgeTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/MSEdgeTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.util.Collections;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/NewWindowTest.java b/selenium/src/test/java/com/saucelabs/selenium/NewWindowTest.java
similarity index 89%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/NewWindowTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/NewWindowTest.java
index 22ef7202..07fa8a77 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/NewWindowTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/NewWindowTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/RelativeLocatorsTest.java b/selenium/src/test/java/com/saucelabs/selenium/RelativeLocatorsTest.java
similarity index 91%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/RelativeLocatorsTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/RelativeLocatorsTest.java
index 7f2ab427..25457f68 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/RelativeLocatorsTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/RelativeLocatorsTest.java
@@ -1,8 +1,8 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
import static org.openqa.selenium.support.locators.RelativeLocator.with;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/RemoteWebDriverBuilderTest.java b/selenium/src/test/java/com/saucelabs/selenium/RemoteWebDriverBuilderTest.java
similarity index 96%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/RemoteWebDriverBuilderTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/RemoteWebDriverBuilderTest.java
index 50caa97d..762db41b 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/RemoteWebDriverBuilderTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/RemoteWebDriverBuilderTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/TestBase.java b/selenium/src/test/java/com/saucelabs/selenium/TestBase.java
similarity index 99%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/TestBase.java
rename to selenium/src/test/java/com/saucelabs/selenium/TestBase.java
index 9b57ca10..a2ef8110 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/TestBase.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/TestBase.java
@@ -1,4 +1,4 @@
-package com.saucedemo.selenium;
+package com.saucelabs.selenium;
import java.net.MalformedURLException;
import java.net.URL;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/TimeoutsTest.java b/selenium/src/test/java/com/saucelabs/selenium/TimeoutsTest.java
similarity index 91%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/TimeoutsTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/TimeoutsTest.java
index 345bd2f9..27ff393f 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/TimeoutsTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/TimeoutsTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ViewPageChromeTest.java b/selenium/src/test/java/com/saucelabs/selenium/ViewPageChromeTest.java
similarity index 94%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ViewPageChromeTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/ViewPageChromeTest.java
index fdbaf77d..d9f30b08 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ViewPageChromeTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/ViewPageChromeTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ViewPageFirefoxTest.java b/selenium/src/test/java/com/saucelabs/selenium/ViewPageFirefoxTest.java
similarity index 95%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ViewPageFirefoxTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/ViewPageFirefoxTest.java
index 62535b6a..6420e34e 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/selenium_features/ViewPageFirefoxTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/ViewPageFirefoxTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.selenium_features;
+package com.saucelabs.selenium;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/sauce_features/AccessibilityTest.java b/selenium/src/test/java/com/saucelabs/selenium/sauce/AccessibilityTest.java
similarity index 90%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/sauce_features/AccessibilityTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/sauce/AccessibilityTest.java
index 74eb69f2..62bcd426 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/sauce_features/AccessibilityTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/sauce/AccessibilityTest.java
@@ -1,8 +1,8 @@
-package com.saucedemo.selenium.sauce_features;
+package com.saucelabs.selenium.sauce;
import com.deque.html.axecore.results.Results;
import com.deque.html.axecore.selenium.AxeBuilder;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
diff --git a/selenium-examples/src/test/java/com/saucedemo/selenium/sauce_features/PerformanceTest.java b/selenium/src/test/java/com/saucelabs/selenium/sauce/PerformanceTest.java
similarity index 92%
rename from selenium-examples/src/test/java/com/saucedemo/selenium/sauce_features/PerformanceTest.java
rename to selenium/src/test/java/com/saucelabs/selenium/sauce/PerformanceTest.java
index 1800301f..c02db5a6 100644
--- a/selenium-examples/src/test/java/com/saucedemo/selenium/sauce_features/PerformanceTest.java
+++ b/selenium/src/test/java/com/saucelabs/selenium/sauce/PerformanceTest.java
@@ -1,6 +1,6 @@
-package com.saucedemo.selenium.sauce_features;
+package com.saucelabs.selenium.sauce;
-import com.saucedemo.selenium.TestBase;
+import com.saucelabs.selenium.TestBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -89,6 +89,9 @@ public void jankiness() {
Map metrics =
(Map) ((JavascriptExecutor) driver).executeScript("sauce:jankinessCheck");
- Assertions.assertTrue((Double) metrics.get("score") > 0.5);
+ // Sauce is sometimes returning this as null for some reason
+ if (metrics.get("score") != null) {
+ Assertions.assertTrue((Double) metrics.get("score") > 0.5);
+ }
}
}
diff --git a/selenium-examples/src/test/resources/selenium-example.xpi b/selenium/src/test/resources/selenium-example.xpi
similarity index 100%
rename from selenium-examples/src/test/resources/selenium-example.xpi
rename to selenium/src/test/resources/selenium-example.xpi
diff --git a/selenium3-examples/README.md b/selenium3-examples/README.md
deleted file mode 100644
index 9bfdf7de..00000000
--- a/selenium3-examples/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-## Selenium 3
-
-This code is provided on an "AS-IS” basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. Your tests and testing environments may require you to modify this framework. Issues regarding this framework should be submitted through GitHub. For questions regarding Sauce Labs integration, please see the Sauce Labs documentation at https://wiki.saucelabs.com/. This framework is not maintained by Sauce Labs Support.
-
-This project is just for comparison purposes with Selenium 4 Code
\ No newline at end of file
diff --git a/selenium3-examples/pom.xml b/selenium3-examples/pom.xml
deleted file mode 100644
index 6e12fe75..00000000
--- a/selenium3-examples/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
- 4.0.0
-
- org.example
- selenium3
- 1.0-SNAPSHOT
-
-
-
- com.saucelabs
- saucebindings-junit5
- 1.0.0
-
-
- org.seleniumhq.selenium
- selenium-java
- 3.141.59
- test
-
-
-
-
- 8
- 8
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.0.0-M5
-
-
- 20
- 20
- 20
- 20
-
-
-
- junit.jupiter.execution.parallel.enabled = true
- junit.jupiter.execution.parallel.mode.default = concurrent
- junit.jupiter.execution.parallel.mode.classes.default = concurrent
- junit.jupiter.execution.parallel.config.strategy = fixed
- junit.jupiter.execution.parallel.config.strategy = custom
- junit.jupiter.execution.parallel.config.custom.class = com.saucelabs.saucebindings.junit5.CustomStrategy
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/CapabilitiesMergeTest.java b/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/CapabilitiesMergeTest.java
deleted file mode 100644
index d279238d..00000000
--- a/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/CapabilitiesMergeTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.saucelabs.selenium3.changes;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.openqa.selenium.PageLoadStrategy;
-import org.openqa.selenium.UnexpectedAlertBehaviour;
-import org.openqa.selenium.chrome.ChromeOptions;
-public class CapabilitiesMergeTest {
-
- @DisplayName("Selenium 3 Can merge in place")
- @Test
- public void mergesInPlace() {
- ChromeOptions options1 = new ChromeOptions();
- ChromeOptions options2 = new ChromeOptions();
-
- options1.setPageLoadStrategy(PageLoadStrategy.EAGER);
- options2.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
-
- options1.merge(options2);
-
- Assertions.assertEquals(UnexpectedAlertBehaviour.IGNORE, options1.getCapability("unhandledPromptBehavior"));
- }
-
- @DisplayName("Selenium 3 Can merge as a new object")
- @Test
- public void mergesNewObject() {
- ChromeOptions options1 = new ChromeOptions();
- ChromeOptions options2 = new ChromeOptions();
-
- options1.setPageLoadStrategy(PageLoadStrategy.EAGER);
- options2.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
-
- options1.merge(options2);
-
- Assertions.assertEquals(UnexpectedAlertBehaviour.IGNORE, options1.getCapability("unhandledPromptBehavior"));
- }
-}
diff --git a/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/DurationParameterTest.java b/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/DurationParameterTest.java
deleted file mode 100644
index d168725a..00000000
--- a/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/DurationParameterTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.saucelabs.selenium3.changes;
-
-import com.saucelabs.saucebindings.junit5.SauceBaseTest;
-import org.junit.jupiter.api.Test;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import java.util.concurrent.TimeUnit;
-public class DurationParameterTest extends SauceBaseTest {
-
- @Test
- public void timeoutUnit() {
- // Uses Seconds
- WebDriverWait wait = new WebDriverWait(driver,5);
-
- // Uses Long / TimeUnit
- driver.manage().timeouts().implicitlyWait(555, TimeUnit.MILLISECONDS);
- }
-}
diff --git a/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/FindByTest.java b/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/FindByTest.java
deleted file mode 100644
index 5fc04124..00000000
--- a/selenium3-examples/src/test/java/com/saucelabs/selenium3/changes/FindByTest.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.saucelabs.selenium3.changes;
-
-import com.saucelabs.saucebindings.junit5.SauceBaseTest;
-import org.junit.jupiter.api.Test;
-public class FindByTest extends SauceBaseTest {
-
- @Test
- public void findElementBy() {
- driver.navigate().to("https://www.saucedemo.com");
-
- driver.findElementById("user-name");
- driver.findElementByCssSelector("#password");
- driver.findElementByClassName("btn_action");
- }
-}
diff --git a/training-sessions/advanced_demo/.gitignore b/training-advanced/.gitignore
similarity index 100%
rename from training-sessions/advanced_demo/.gitignore
rename to training-advanced/.gitignore
diff --git a/training-sessions/advanced_demo/README.md b/training-advanced/README.md
similarity index 100%
rename from training-sessions/advanced_demo/README.md
rename to training-advanced/README.md
diff --git a/training-sessions/advanced_demo/pom.xml b/training-advanced/pom.xml
similarity index 96%
rename from training-sessions/advanced_demo/pom.xml
rename to training-advanced/pom.xml
index de98cde1..bb01039b 100644
--- a/training-sessions/advanced_demo/pom.xml
+++ b/training-advanced/pom.xml
@@ -5,7 +5,7 @@
4.0.0
org.example
- advanced_demo
+ training-advanced
1.0-SNAPSHOT
diff --git a/training-sessions/advanced_demo/src/test/java/ExtendedDebuggingTest.java b/training-advanced/src/test/java/ExtendedDebuggingTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/ExtendedDebuggingTest.java
rename to training-advanced/src/test/java/ExtendedDebuggingTest.java
diff --git a/training-sessions/advanced_demo/src/test/java/ExtraSauceTest.java b/training-advanced/src/test/java/ExtraSauceTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/ExtraSauceTest.java
rename to training-advanced/src/test/java/ExtraSauceTest.java
diff --git a/training-sessions/advanced_demo/src/test/java/LocalExecutionTest.java b/training-advanced/src/test/java/LocalExecutionTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/LocalExecutionTest.java
rename to training-advanced/src/test/java/LocalExecutionTest.java
diff --git a/training-sessions/advanced_demo/src/test/java/SauceConnectTest.java b/training-advanced/src/test/java/SauceConnectTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/SauceConnectTest.java
rename to training-advanced/src/test/java/SauceConnectTest.java
diff --git a/training-sessions/advanced_demo/src/test/java/SauceDemoTest.java b/training-advanced/src/test/java/SauceDemoTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/SauceDemoTest.java
rename to training-advanced/src/test/java/SauceDemoTest.java
diff --git a/training-sessions/advanced_demo/src/test/java/SauceExecutionTest.java b/training-advanced/src/test/java/SauceExecutionTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/SauceExecutionTest.java
rename to training-advanced/src/test/java/SauceExecutionTest.java
diff --git a/training-sessions/advanced_demo/src/test/java/TestWatcherTest.java b/training-advanced/src/test/java/TestWatcherTest.java
similarity index 100%
rename from training-sessions/advanced_demo/src/test/java/TestWatcherTest.java
rename to training-advanced/src/test/java/TestWatcherTest.java
diff --git a/training-sessions/synchronization/.gitignore b/training-sync/.gitignore
similarity index 100%
rename from training-sessions/synchronization/.gitignore
rename to training-sync/.gitignore
diff --git a/training-sessions/synchronization/README.md b/training-sync/README.md
similarity index 100%
rename from training-sessions/synchronization/README.md
rename to training-sync/README.md
diff --git a/training-sessions/synchronization/pom.xml b/training-sync/pom.xml
similarity index 100%
rename from training-sessions/synchronization/pom.xml
rename to training-sync/pom.xml
diff --git a/training-sessions/synchronization/src/test/java/DeclarativeTest.java b/training-sync/src/test/java/DeclarativeTest.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/DeclarativeTest.java
rename to training-sync/src/test/java/DeclarativeTest.java
diff --git a/training-sessions/synchronization/src/test/java/NoSynchTest.java b/training-sync/src/test/java/NoSynchTest.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/NoSynchTest.java
rename to training-sync/src/test/java/NoSynchTest.java
diff --git a/training-sessions/synchronization/src/test/java/SynchAbstractTest.java b/training-sync/src/test/java/SynchAbstractTest.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/SynchAbstractTest.java
rename to training-sync/src/test/java/SynchAbstractTest.java
diff --git a/training-sessions/synchronization/src/test/java/SynchExplicitTest.java b/training-sync/src/test/java/SynchExplicitTest.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/SynchExplicitTest.java
rename to training-sync/src/test/java/SynchExplicitTest.java
diff --git a/training-sessions/synchronization/src/test/java/SynchSalsaVerdeTest.java b/training-sync/src/test/java/SynchSalsaVerdeTest.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/SynchSalsaVerdeTest.java
rename to training-sync/src/test/java/SynchSalsaVerdeTest.java
diff --git a/training-sessions/synchronization/src/test/java/data/UserData.java b/training-sync/src/test/java/data/UserData.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/data/UserData.java
rename to training-sync/src/test/java/data/UserData.java
diff --git a/training-sessions/synchronization/src/test/java/pages/LoginPage.java b/training-sync/src/test/java/pages/LoginPage.java
similarity index 100%
rename from training-sessions/synchronization/src/test/java/pages/LoginPage.java
rename to training-sync/src/test/java/pages/LoginPage.java