This is a test suite for the login functionality of the Monarc web application. The test suite is implemented using Selenium in Python, and uses the unittest framework to define and run test cases.
- Python 3.x
- Selenium WebDriver
- ChromeDriver
- chromedriver-binary package
- unittest
- Clone this repository to your local machine.
- Install Python 3.x if you don't have it installed already.
- Install the Selenium WebDriver for Chrome. You can download it from the official website or install it using a package manager like
apt-get
orbrew
. - Install the
chromedriver-binary
package usingpip
:pip install chromedriver-binary
. - Install the
unittest
package usingpip
:pip install unittest
.
Before running the test suite, you need to configure the test environment by setting some variables in the config.py
file. In particular, you need to set the path to the ChromeDriver executable and the base URL for the MyMonarc web application. You also need to set the login credentials for valid and invalid logins.
class Config:
"""Config class to store configuration variables"""
# Selenium configuration
BASE_URL = "https://127.0.0.1:5000/"
# Login configuration
VALID_USERNAME = "valid_username"
VALID_PASSWORD = "valid_password"
INVALID_USERNAME = "invalid_username"
INVALID_PASSWORD = "invalid_password"
To run the test suite, simply execute the run_tests.py
script:
python run_tests.py
This will run all the test cases defined in the TestLogin
module and print the results to the console.
The test suite is organized as follows:
config.py
: Configuration variables for the test suite.run_tests.py
: Script to run the test suite.pages/
: Directory containing page object classes for the different pages of the MyMonarc web application.tests/
: Directory containing the test case classes for the MyMonarc web application.tests/test_login.py
: Test case class for the login functionality of the MyMonarc web application.tests/__init__.py
: Empty file that tells Python that thetests
directory should be treated as a package.
This software is licensed under GNU Affero General Public License version 3