Testing Authentication and Feedback with Pytest and Silenium Using BaseObject and Factors Patterns.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
For this project, you will need Python, the Selenium and Pytest libraries.
You can install the latest Python version from the official website, libraries can be installed using these commands:
pip install pytest
pip install Selenium
There is also a requirements.txt.
To start tests enter the following command in the terminal:
pytest
When you will receive the results of the test run, they will look like this:
Also, all information about the tests will be saved in a file log_for_test.log:

In the sign-in section of the Altoro Mutual website we can find an authorization form.
Following tests were created:
- a test with input of valid data,
- a test with input of invalid data,
- a test with input of only one field (with a username, in our case).
In the feedback section of the Altoro Mutual website we can find a feedback form.
Following tests were created:
- a test with input of only one field (with a name, in our case).
The test uses a pattern PageObject, so:
- The class BaseElement is an abstract class which contains methods to interact with elements on the page (searching for elements, clicking on the elements for example).
- The class BasePage is an abstract class which contains methods to interact with the page (checking whether page is open, for example),
- The class Browser contains methods for interaction with the browser (go to site with specifed url, or refresh the page),
- The class Driver is a BrowserFactory which provide different options for different browsers (Firefox or Chrome),
- The conftest.py contains a fixture to launch and quit the browser,
- The Singleton contains Singletone for the Browser.
