- Date: Wednesday 14th July
- Instructor: Kevin Cunningham
- Email: kevin@kevincunningham.co.uk
- Website: https://kevincunningham.co.uk
- Repo link: Repo Link
- Feedback link: Feedback
- Miro board: Miro
- 9:30-11:00 Session 1
- 11:00-11:15 Coffee Break
- 11:15-12:45 Session 2
- 12:45-1:45 Lunch Break
- 1:45-3:15 Session 3
- 3:15-3:30 Tea Break
- 3:30-4:30 Session 4
The aim of the workshop is to enable testers with extensive Selenium and Java experience to transition to using Playwright with TypeScript for web application testing. By the end of the day, participants will be able to set up Playwright, write and run tests, manage advanced test scenarios, and know how Playwright fits into CI/CD pipelines.
-
Introduction
- Course objectives and structure
- Overview of Playwright and TypeScript
- Importance of Playwright for testing
-
Getting Started
- Setting up a new project
- Configuring the development environment (VSCode setup)
- Running initial Playwright setup commands
-
Writing Tests
- Introduction to TypeScript syntax for Playwright
- Creating and running a basic Playwright test
- Understanding the structure and components of a Playwright test
- Common Playwright functions and assertions
-
Using Codegen to Create Tests in the UI
- Introduction to Playwright's codegen tool
- Recording user actions to generate test scripts
- Modifying and customizing generated code
- Best practices for using codegen
-
Hooks: beforeEach and afterEach
- Introduction to hooks in Playwright
- Using beforeEach to set up test preconditions
- Using afterEach to clean up after tests
- Practical examples and best practices
-
Parameterization
- Writing flexible and reusable tests with parameterization
- Using external data sources for test parameters
- Implementing parameterized tests in Playwright
-
Screenshots
-
Running and Debugging Tests
- Running tests in different browsers
- Running tests in headed mode
- Debugging Playwright tests using VSCode (--ui or --debug)
- Troubleshooting common issues
- What about those flaky tests! (retry mechanism, increase timeout, waitForSelector)
-
Test Reports
- Configuring Playwright to generate test reports
- Types of reports (HTML, JSON, etc.)
- Interpreting and using test report data
- Integrating test reports with other tools
-
Bits and Bobs
- Page Object Model
- File uploads
- Recap key points from the day
- Additional resources for learning
- Playwright Documentation: Playwright Docs
- TypeScript Documentation: TypeScript Docs