Centime Assignment: Selenium and Pytest web automation framework for an e-commerce application.
This repository contains an automated test suite for an e-commerce web application using Selenium and Pytest. The test suite includes functional test cases for user registration, login, cart management, and address management.
- Page Object Model implementation
- Data-driven testing
- Configurations
- HTML report generation
- Utilities for handling common operations
- Ensure you have the following installed on your system before running the tests:
- Python (3.12)
- Chrome WebDriver
- Required Python dependencies (listed in requirements.txt)
- Clone the repository
git clone https://github.com/prashantFarakate/centime-selenium-pytest-assignment
- Create a virtual environment
python -m venv venv
venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Run all tests:
pytest -v
- Run specific test cases: pytest -m register
pytest -m register
pytest -m login
pytest -m cart
pytest -m address
Refer test_cases.xlsx for detailed testcases
- Registers a new user with a unique email.
- Verifies the greeting message.
- Saves credentials for later use.
- Logs out after registration.
- Logs in using registered credentials.
- Verifies greeting message after login.
- Logs out and checks login page appearance.
- Login with Invalid credential and check error message
- Add single item to the cart.
- Adds multiple items to the cart.
- Checks if correct items and quantities are displayed.
- Remove single item from the cart.
- Removes all items from the cart.
- Confirms the cart is empty.
- Registers a user
- navigates to the address section.
- Adds billing address details.
- Save address
- Verify address get saved
- Checks if saved address matches expected details.
- The framework generates HTML reports after test execution, using the --html flag.
pytest -v -s --html=reports/reports.html
- Find report at reports/report.html