Skip to content

SirPelmesh/authentication_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing Authentication and Feedback forms for Altoro Mutual

Testing Authentication and Feedback with Pytest and Silenium Using BaseObject and Factors Patterns.

Installing

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.

Running the tests

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: image Also, all information about the tests will be saved in a file log_for_test.log: image

Description

In the sign-in section of the Altoro Mutual website we can find an authorization form.
Following tests were created:

  1. a test with input of valid data,
  2. a test with input of invalid data,
  3. a test with input of only one field (with a username, in our case).
The last one should trigger JavaScript alert.

image

In the feedback section of the Altoro Mutual website we can find a feedback form.
Following tests were created:

  1. 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.

About

Testing authentication on the Altoro Mutual website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages