This project contains automated tests for the login functionality of the OrangeHRM demo application.
Tests verify correct and incorrect login scenarios using pytest and Selenium WebDriver.
Target application: https://opensource-demo.orangehrmlive.com/web/index.php/auth/login
List the software and tools needed to run this project.
Examples:
- Python >= 3.11.0
- pytest >= 8.0.0
- selenium >= 4.0.0
- Google Chrome browser (latest)
- ChromeDriver (matching Chrome version)
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/codebrainers-testy-automatyczne.git cd codebrainers-testy-automatyczne -
Setup venv
python -m venv .venv source .venv/bin/activateOn Windows:
.venv\Scripts\activate
-
Install requirements
pip install pytest selenium
-
Make sure Google Chrome is installed on your system.
-
ChromeDriver is managed automatically by Selenium 4+ — no manual download needed.
-
Verify Python version:
python --version
-
Verify pytest is installed:
pytest --version
-
Run all tests:
pytest test_login.py -v
-
Run a single test by name:
pytest test_login.py::test_login_valid -v
-
Expected output example:
collected 3 items test_login.py::test_login_valid PASSED test_login.py::test_login_invalid PASSED test_login.py::test_login_empty PASSED 3 passed in 12.34s
| ID | Test name | Description | Expected result |
|---|---|---|---|
| TC-LOGIN-001 | test_login_valid |
Login with correct credentials (Admin / admin123) | Redirect to Dashboard |
| TC-LOGIN-002 | test_login_invalid |
Login with wrong password | Error message: "Invalid credentials" |
| TC-LOGIN-003 | test_login_empty |
Login with empty password field | Validation message displayed |
-
Running tests
pytest test_login.py -v
-
Test file structure
codebrainers-testy-automatyczne/ ├── test_login.py # Main test file └── README.md # Project documentation -
Tests status
- Passing: TC-LOGIN-001, TC-LOGIN-002, TC-LOGIN-003