This is a demo project for automated testing of the Swag Labs e-commerce website using Selenium. The project includes test cases to validate various parts of the website.
The test cases included in this project are:
- Test Login with Valid Credentials: Validates the login functionality using valid credentials.
- Test Login with Invalid Credentials: Validates the login functionality using invalid credentials.
- Test Add Items to Cart and Checkout: Adds items to the cart and completes the checkout process.
You can watch a sample demo of the tests in action here .
sawglabs.demo.mp4
The project is organized as follows:
Swag_Labs_testing/
│
├── Tests/
│ ├── test_login.py
│ ├── test_addtocart.py
│ └── ...
│
├── Pages/
│ ├── LoginPage.py
│ ├── Addtocart.py
│ └── ...
│
├── Fixtures/
│ ├── Data.json
│
└── README.md
- Tests: Contains test scripts for different parts of the Swag Labs website.
- Pages: Includes Python classes representing various pages of the website to encapsulate page elements and interactions.
- Fixtures: Stores fixtures and test data, such as login credentials, in JSON format.
To run the tests, follow these steps:
- Clone this repository to your local machine.
- Navigate to the project directory.
- Install the necessary dependencies using
pip install selenium
. - Run the tests using the testing framework of your choice. For example, you can run
pytest Tests
to execute all test scripts in theTests
directory.
- Selenium Version: 4.12.0
- System Platform: Linux (Ubuntu 22.04)
- Browser: ChromeDriver 116.0.5845.96