Skip to content

Pokhilenko/playwright-python-ai-powered

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DemoQA Test Automation Project

This project contains automated tests for the DemoQA website (https://demoqa.com) using Python, Playwright, and pytest.

Project Structure

├── lib/
│   ├── pages/         # Page Object Models
│   ├── helpers/       # Helper functions and utilities
│   ├── models/        # Pydantic models for API payloads
│   └── constants/     # Constants and configuration
├── tests/
│   ├── ui/           # UI test cases
│   └── api/          # API test cases
├── conftest.py       # Global pytest fixtures
├── requirements.txt  # Project dependencies
└── .env             # Environment variables

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Setup

  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Install Playwright browsers:
playwright install
  1. Create a .env file in the project root and add necessary environment variables:
BASE_URL=https://demoqa.com
API_BASE_URL=https://demoqa.com/api

Running Tests

Run all tests

pytest

Run UI tests only

pytest tests/ui/

Run API tests only

pytest tests/api/

Run with HTML report

pytest --html=report.html

Test Reports

After test execution, you can find the HTML report in the project root directory as report.html.

Contributing

  1. Create a new branch for your feature
  2. Write tests for new functionality
  3. Ensure all tests pass
  4. Submit a pull request

Best Practices

  • Follow the Page Object Model pattern for UI tests
  • Use Pydantic models for API request/response validation
  • Keep test data separate from test logic
  • Use meaningful test names and descriptions
  • Add appropriate assertions and error handling

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages