Course Code: playwrbsq
Duration: 21 hours
Overview:

Learning Objectives. 

● Understand the architecture and advantages of Playwright. 

● Write eff ective automated tests using Playwright with JavaScript. 

● Implement advanced testing techniques and best practices. 

● Apply OOP principles and design patterns in Playwright scripts. 

● Perform API testing and handle network interactions with Playwright. 

● Manage and optimize test data, contexts, and reporting in Playwright. 

● Conduct various types of testing with Playwright. 

● Understand Behaviour Driven Development (BDD) 

● Implement BDD using Cucumber and Playwright

Course Outline:

Module 1: Introduction to Playwright 

● What is Playwright and its advantages over other frameworks? 

● Installation and setup of Playwright 

● Setting up a new Playwright project 

Basic Test Scripting 

● Writing a basic test script using Playwright and JavaScript 

● Working with Selectors (CSS and XPath) 

● Interacting with DOM elements 

● Page Navigation and Wait Strategies 

Module 2: Advanced Concepts in Playwright 

● Playwright configuration file 

● Headless/Headed mode configurations 

● Debugging using pause mechanism 

● Dealing with lists of elements 

● Working with iframes and Shadow DOM 

● Handling alerts, keyboard/mouse actions, file uploads/downloads 

Module 3: Managing Test Data and Test Suites 

Data Handling & Context Management 

● Reading data from various sources (.env, JSON, CSV) 

● Managing storage state and persistent contexts
● Multi-page and multi-user context testing 

Advanced Reporting Utilities 

● Test suite organization and structuring 

● Implementing custom reporters and trace viewers 

● Visual testing and device emulation 

Module 4: Managing APIs with Playwright 

● Basics of APIs and different API methods 

● Handling API requests and responses using Playwright 

● Network interception and mocking API responses 

Module 5: Object-Oriented Programming for Playwright 

● Classes, constructors, and access modifiers in TypeScript 

● Practical implementation of OOP concepts in Playwright scripts 

Module 6: Page Object Model (POM) 

● Refactoring scripts using the Page Object Model 

● Creating Base Pages and implementing common actions 

● Best practices for maintaining POM in Playwright scripts 

Module 7: Test Runner and Reporting in Playwright 

● Role of test runners in Playwright 

● Grouping, filtering, and configuring tests 

● Implementing test retry mechanisms and parameterization 

● Setting up global configurations and custom reporting 

Module 8: Behavior Driven Development with Cucumber and Playwright 

● Overview of BDD and Cucumber 

● Setup Cucumber with Playwright 

● Understanding and writing Gherkin Feature fi les 

● Mapping Gherking steps to the code 

● Building frameworks to write code with the best practices 

● Debugging Cucumber tests