It’s a Selenium and Pytest based automation framework.
REDFIN (https://www.redfin.com) website is used to demonstrate its UI E2E test capabilities.
PySelenium tests can be run using 2 Docker containers, one container with Chrome or Firefox web browser and the other containers running the Selenium-Pytest automation scripts.
- Install the required applications
- Docker 19+
- Allure 2.13+
- Pip - install Virtualenv (For Development Only)
- Run Smoke tests with Chrome browser in two Docker containers
$ ./runPySeleniumTests.sh —smoke —docker
- Run Regression tests with Firefox browser
$ ./runPySeleniumTests.sh —docker —browser firefox
- View test results with Allure reports. Test results should be saved under directory /test_results/allure_results
$ allure serve test_results/allure_results
- Don’t forget to bring down the containers after tests are finished
$ docker-compose down
Running tests on a Mac will require more installation than running on them a Docker container
-
Install the required applications
- Python 3.5+
- Pip
- VirtualEnv
- Allure 2.13+
-
Create and activate a Virtual Environment
$ virtuaenv pyselenium_env
$ source pyselenium_env/bin/activate
- Install Dependencies
$ pip install -r requirements.txt
- Run Smoke tests with Chrome browser
$ ./runPySeleniumTests.sh
- Run Regression with Firefox
$ /runPySeleniumTests.sh —browser Firefox
- Run Regression with test cases requiring login credentials from a registered user
$ ./runPySeleniumTests.sh —email some_email@gmail.com —password same_valid_password
- View test results with Allure reports. Test results should be saved under directory /test_results/allure_results
$ allure serve test_results/allure_results
- Don’t forget to bring down the containers after tests are finished.
$ docker-compose down
Automation tests can also be run in parallel. Please complete steps 1-3 from the above Run Test Local section.
- Run Regression tests in parallel with Chrome browser. Example below will run tests in parallel with 3 Chrome browsers max
$ pytest -s -n 3 tests/ --localdrive --alluredir=test_results/allure_results/