This repository contains automated tests for login functionality using Selenium WebDriver and pytest in Python.
These tests cover:
- Valid login scenario (with correct username and password)
- Invalid login scenario (with incorrect credentials)
The tests use Selenium to automate Chrome browser and verify login behavior on the demo site:
https://the-internet.herokuapp.com/login
- Python 3.6 or above
- Google Chrome browser installed
- ChromeDriver installed and available in your system PATH
(Make sure the ChromeDriver version matches your Chrome browser version)
- Clone this repository:
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
pip install -r requirements.txt
Run all tests:pytest
Run a specific test file, e.g. valid login test: pytest tests/test_login_valid.py
Generate an HTML report: pytest --html=reports/report.html
Project Structure
├── pages/
│ └── login_page.py # Page Object Model for login page
├── tests/
│ ├── test_login_valid.py # Test for valid login
│ └── test_login_invalid.py # Test for invalid login
├── reports/ # HTML test reports (auto-generated)
├── requirements.txt # Python dependencies (if added)
└── README.md # This file