Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to create your first Pytest test using Playwright Python in this 30-minute tutorial. Discover what constitutes a test in Pytest, understanding that tests are simply functions with names starting with "test_" that Pytest automatically finds and executes. Follow a comprehensive step-by-step approach to build a complete test from scratch, starting with project structure setup by creating a tests folder and test_google.py file. Master the essential import statements including re and playwright.sync_api expect, then construct a test function that navigates to Google's homepage while handling potential popups. Implement practical web automation techniques including filling search boxes, pressing keyboard keys, and verifying page titles using regular expressions. Explore various Pytest execution options including browser selection (Chromium, Firefox, WebKit), headed versus headless modes, screenshot capture settings, and video recording capabilities. Gain hands-on experience with command-line options for running tests and generating HTML reports using pytest-html, while learning to troubleshoot common issues like popup handling and timeout management.
Syllabus
Playwright Python 3 | How to create First Pytest
Taught by
Automation Step by Step