Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nadvolod/selenium-automation-advanced
A repo that shows some advanced automated testing techniques using Selenium and Sauce Labs
https://github.com/nadvolod/selenium-automation-advanced
Last synced: 12 days ago
JSON representation
A repo that shows some advanced automated testing techniques using Selenium and Sauce Labs
- Host: GitHub
- URL: https://github.com/nadvolod/selenium-automation-advanced
- Owner: nadvolod
- License: mit
- Created: 2022-08-09T18:09:25.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-28T18:05:26.000Z (about 2 years ago)
- Last Synced: 2024-10-10T20:58:00.254Z (29 days ago)
- Language: Java
- Size: 3.48 MB
- Stars: 5
- Watchers: 1
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## You will learn to:
In this automation best practices workshop you will learn the latest and greatest tools and techniques to drastically
improve your testing!We will focus on a holistic approach of risk mitigation by doing:
- Functional web testing
- Create a framework for doing comprehensive web testing
- Use industry-standard best practices
- Create functional browser tests using Selenium
- Many other things in between
- Accessibility testing
- Run in massive parallel (100s of tests in < 5 min)
- Automatically get robust test reports which includes logs + videos## Technologies you will use:
[![Java](https://img.shields.io/badge/Java-3A75B0?style=for-the-badge&logoColor=white&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACYAAAAwCAYAAAB9sggoAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAACagAwAEAAAAAQAAADAAAAAAmGgvegAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wd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B1zUC3s5LIHF8BPO%2BEBBdIhC2C0NfwNcBnrvYuSigAAAAABJRU5ErkJggg%3D%3D)](https://www.java.com/en/)
[![Selenium](https://img.shields.io/badge/Selenium-43B02A?style=for-the-badge&logo=selenium&logoColor=white)](https://www.selenium.dev/)
[![Maven](https://img.shields.io/badge/Maven-C71A36?style=for-the-badge&logo=apachemaven&logoColor=white)](https://maven.apache.org/index.html)
[![Sauce Labs](https://img.shields.io/badge/Sauce%20Labs-E2231A?style=for-the-badge&logo=saucelabs&logoColor=white)](https://www.saucelabs.com)
[![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=for-the-badge&logo=githubactions&logoColor=white)](https://github.com/features/actions)
## Table Of Contents
- Introduction to workshop
- Setup
- [Gitpod setup](#gitpod-setup)
- [Local setup](#local-environment-setup)
- [Setting data center](#setting-data-center)
- [E2E browser tests](./docs/E2E-TESTS.MD)
- [Atomic tests](./docs/ATOMIC-TESTS.MD)
- [Accessibility tests](./docs/ACCESSIBILITY-TESTS.MD)
- [Parallelization](./docs/PARALLEL.MD)
- [Conclusions](./docs/CONCLUSIONS.MD)## Requirements
- Java programming experience
- Understanding of Selenium WebDriver
- Understanding of OOP
- Java 8 installed
- Java IDE installed
- [Git installed](https://git-scm.com/downloads)
- [Github account](https://github.com/s)
- [Maven installed](https://maven.apache.org/install.html)
- Sauce Labs account. If you need one, [get it free](https://www.saucelabs.com/sign-up)## Your Instructor: Nikolay Advolodkin
- š Iām the founder of [Ultimate QA](https://ultimateqa.com/)
- š¢ Iām a Sr Solutions Architect at Sauce Labs
- š± Iām currently working on [Sauce Bindings](https://github.com/saucelabs/sauce_bindings)
- š¬ Ask me about environmentalism, veganism, test automation, and fitness
- š Pronouns: he/him
- ā” Fun fact: I'm a Ukranian-Jew that was born in Uzbekistan, speaks Russian, and was raised in US
- š« Follow me for testing and dev training
- [Java Testing Tips Weekly](https://ultimateqa.ck.page/selenium-java-tips)
- [Testing Training on Youtube](https://www.youtube.com/ultimateqa?sub_confirmation=1)
- [LinkedIn](https://www.linkedin.com/in/nikolayadvolodkin/)
- [Twitter to know about all my events](https://twitter.com/intent/follow?screen_name=nikolay_a00)## Setup
### Sign up for account
[![Sauce Labs](https://img.shields.io/badge/SauceLabs-E2231A?style=for-the-badge&logo=saucelabs&logoColor=white)](https://saucelabs.com/sign-up)
### Get your username and api key
- Save your Sauce Labs Username and Access Key by going to the [Sauce Labs user settings page](https://app.saucelabs.com/user-settings)
### Gitpod setup
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/nadvolod/selenium-automation-advanced)
> ā¹ļø Gitpod lets you run an entire Dev environment from a browser! You can use this approach if you don't
> know how to set up a local Java environment.1. Once the Gitpod.io URL is loaded, you will need to sign in with the GitHub account you created earlier
2. Once the development environment is loaded, you should see 'Ready to test!' in the Terminal window in the lower
portion of the window, run the following commands in that Terminal to set your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY`:> ā¹ļø You can get your Sauce Labs Username and Access Key by going to the [Sauce Labs user settings page](https://app.saucelabs.com/user-settings)
```bash
eval $(gp env -e SAUCE_USERNAME=)
eval $(gp env -e SAUCE_ACCESS_KEY=)
```> Replace and with your credentials
Once you have run those 2 commands, you can run the following commands to test your environment variables:
```bash
echo $SAUCE_USERNAME
echo $SAUCE_ACCESS_KEY
```Run sanity tests
```bash
mvn test -Dtest="E2ESolutionTests#appRenders" -X
```
Click here to see an example console output.
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------
[INFO] Total time: 12.410 s
[INFO] Finished at: 2022-07-11T10:06:10-04:00
[INFO] ------------------------------------------
### ā š Environment setup is complete if tests passed
---
### Local environment setup
ā¹ļø Only recommended for those that know how to correctly setup a Java + Maven environment
Fork then clone the repo
1. Sign up for a free [GitHub account](https://github.com/)
2. [Fork this repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo)- Make sure you are logged into GitHub
- Click the Fork in the upper right of the GitHub.3. Clone your fork of the repository to your machine. Must have [Git installed](https://git-scm.com/downloads)
```bash
git clone URL_OF_YOUR_FORK
```Setup environment variables on your system
[![Mac/Linux](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=apple&logoColor=white)](https://docs.saucelabs.com/basics/environment-variables/#setting-up-environment-variables-on-macos-and-linux-systems)
[![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)](https://docs.saucelabs.com/basics/environment-variables/#setting-up-environment-variables-on-windows-systems)
Navigate to the directory of where you cloned your repo
```bash
cd YOUR_FORK_DIR/automation-best-practices/workshop
```Run sanity tests
```java
mvn test -Dtest=E2ETests -X
```
Click here to see an example console output.
Results :
Tests run: 4, Failures: 0, Errors: 0, Skipped: 3
[INFO] ------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------
[INFO] Total time: 12.410 s
[INFO] Finished at: 2022-07-11T10:06:10-04:00
[INFO] ------------------------------------------
### ā š Environment setup is complete if tests passed
## Setting data center
By default, the data center selected for our exercises is `US_WEST`. If you would like to switch to another data
center (i.e. `EU_CENTRAL`), please update the [E2ETests](workshop/src/test/java/com/saucedemo/exercises/E2ETests.java) with the appropriate data center.## Stay to the end and win a prize!
Stay to the end and 2 lucky people can win a snazzy Backpack!
## Key
š” this is a tip
šļøā this is an exercise for you to do
ā this is a question for us to think and talk about. Try not to scroll beyond this question before we discuss