This code shows you how to execute tests three different ways:hosted by Sauce Labs, remotely on Sauce Labs and locally.
- Hosted by Sauce Labs
- Remotely on Sauce Labs
- Locally
Please see the primary README for the common prerequisites.
Please see the primary README for the instructions on how to execute these tests on Github Actions.
This is the exciting new way to run your tests on Sauce Labs. The overall execution time should be less (the longer the tests the more performance improvements), but there is going to be some overhead for the container to get loaded and the tests to start.
- Login to Docker Hub
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- Name the Docker image with unique tag (important: make sure you do not duplicate an existing tag):
export DOCKER_IMAGE=$DOCKER_USERNAME/hto-demo-java:0.0.1
- Build with tag
docker build -t $DOCKER_IMAGE ./
- Push to Docker Hub
docker push $DOCKER_IMAGE
- Download saucectl
- Execute (saucectl looks at details in
~/.sauce/config.yml
to know what to do):saucectl run
This skips Sauce Labs all together and runs your tests on your local machine without parallel:
mvn clean test
This is the traditional way of running tests on Sauce Labs.
This repo uses maven-surefire for running tests in parallel. Specify the amount of parallel execution with -n
.
This will run all 15 tests in parallel:
mvn clean test -Dselenium.parallel=15
Bug reports and pull requests are welcome on GitHub at https://github.com/saucelabs-training/hto.
The code is available as open source under the terms of the MIT License.