This framework provides a Selenium automation bootstrap project using:
- Selenium Grid 4
- Page-Object-Model Pattern
- Pytest
- Allure Reporting
This project is currently built for the use of a RemoteWebdriver so that it is easy to adapt to a production ready environment for cloud testing such as SauceLabs, Browserstack and so on.
You can spin up the grid by running:
docker-compose up -d
This spins up 3 containers:
- Selenium-Hub
- Chrome Node
- Chrome Video (for video recording)
To run the tests just run:
pytest test --alluredir=results
"Results" will be the directory allure will create and post the results to.
Reporting is done via allure.
To check the results of the tests:
allure serve results
A custom exception FrameworkException will attach a screenshot to the allure report in the specific step where it failed. Allure is able to attach the screenshot to the proper step only if you use @allure.step() in the page object. If not, you'll have the screenshot but not attached to the correct step.