Welcome to QA Automation Learning
This quickstart guide will help you run your first automated test in minutes. We’ll use Playwright with Python to test a demo e-commerce application.This guide assumes you have Python 3.11+ installed on your system. If not, download it from python.org.
Quick Setup
Install dependencies
Install all required packages using pip:This installs:
pytest- Testing frameworkpytest-html- HTML report generationpytest-playwright- Playwright integrationplaywright- Browser automationpython-dotenv- Environment variable management
Install browser drivers
Playwright needs browser binaries to run tests:
The
--with-deps flag installs system dependencies needed for browsers on Linux.Your First Test
Let’s examine thetest_valid_login test from tests/test_login.py:7:
tests/test_login.py
What’s Happening?
- Page fixture - Playwright automatically provides a fresh browser page for each test
- Navigation -
page.goto()loads the test application - Element interaction - Uses locators to find and fill input fields
- Assertions - Verifies the login was successful by checking the URL and dashboard visibility
Using Page Object Model
The project uses the Page Object Model pattern for better code organization. Here’s the same test using theLoginPage class from pages/login.py:4:
Running Tests with Options
Parametrized Tests
Test multiple scenarios with the same test logic using@pytest.mark.parametrize from tests/test_login.py:58:
Next Steps
Installation Guide
Deep dive into setup and configuration options
Test Data Management
Learn how to use fixtures and external data files
Page Objects
Master the Page Object Model pattern
CI/CD Integration
Run tests in GitHub Actions