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 Teststo execute all test scripts in theTestsdirectory.
- Selenium Version: 4.12.0
- System Platform: Linux (Ubuntu 22.04)
- Browser: ChromeDriver 116.0.5845.96