Skip to content

dearen24/Playwright-Automation-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playwright E2E Testing for Magento Store

Project Overview

This project is a practice exercise for creating End-to-End (E2E) automation tests using Playwright on the Magento Store. It helps in understanding test automation concepts and improving skills in writing Playwright test scripts.

Prerequisites

Before running the tests, ensure you have the following installed:

Installation

  1. Clone the repository:
    git clone <repository-url>
    cd <repository-folder>
  2. Install dependencies:
    pip install playwright pytest
  3. Install Playwright browsers:
    playwright install

Test Structure

The test suite consists of the following modules:

  • Pages: Handles interactions with different sections of the website:

    • home_page.py: Navigates to login and men’s clothing section.
    • login_page.py: Handles user authentication.
    • men_top_page.py: Selects a product.
    • product_page.py: Chooses size, color, and quantity.
    • shipping_page.py: Fills shipping details.
    • payment_page.py: Validates price and completes checkout.
    • after_checkout_page.py: Confirms purchase and logs out.
  • Configuration:

    • config.py: Stores test data (user credentials, product quantity, shipping info).
  • Test Execution:

    • test_user.py: Runs the full E2E test.

Running Tests

To execute the tests, use the following command:

pytest test_user.py

For headless mode, modify test_user.py:

browser = await p.chromium.launch(headless=True)

Reporting

Playwright provides built-in test reports. You can enable video recording by modifying conftest.py:

context = await browser.new_context(record_video_dir="videos/")

Conclusion

This project is designed to practice automation testing using Magento, providing hands-on experience with Playwright. Contributions and improvements are welcome!

About

This is an e2e testing project using Playwright Python. Tested on Magento Store Website.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages