Playwright using TypeScript
Detailed Course Contents
Module 1: TypeScript Fundamentals
- TypeScript Environment Setup
- Setting up Node.js and npm
- Installing TypeScript globally
- Setting up a TypeScript project
- Using VS Code for TypeScript development
- Writing Basic TypeScript Programs
- Creating a TypeScript file (
.ts
) - Compiling TypeScript to JavaScript using
tsc
- Running TypeScript programs (using tsx)
- Understanding the TypeScript compiler
- TypeScript Variables and Data Types
- Declaring variables with
let
, const
, and var
- Primitive data types:
number
, string
, boolean
, null
, undefined
- TypeScript Operators
- Arithmetic operators
- Relational operators
- Logical operators
- Assignment operators
- Ternary operator
- Type operators (
typeof
)
- Conditional Statements
if
statementif-else
statementswitch-case
statement
- Loops
while
loopdo-while
loopfor
loopfor-in
loop (for objects)for-of
loop (for arrays and iterables)
- Functions
- Defining functions
- Function parameters and return types
- Optional and default parameters
- Rest parameters
- Arrow functions
- Callback functions
- Overloaded functions
- Arrays & Tuples
- Declaring and initializing arrays
- Working with arrays
- Working with Tuples
- Array methods
- Strings
- String methods
- Object-Oriented Programming (OOP) in TypeScript
- Objects
- Classes
- Constructors
- Read Only Properties
- Static properties and methods
- Inheritance
- Method overriding
- Access modifiers
- Interfaces
- TypeScript Modules
- Organizing code with modules
- Exporting and importing modules
- TypeScript and Asynchronous Programming
- Promises
- Async/await syntax
- Setting up Node.js and npm
- Installing TypeScript globally
- Setting up a TypeScript project
- Using VS Code for TypeScript development
- Creating a TypeScript file (
.ts
) - Compiling TypeScript to JavaScript using
tsc
- Running TypeScript programs (using tsx)
- Understanding the TypeScript compiler
- Declaring variables with
let
,const
, andvar
- Primitive data types:
number
,string
,boolean
,null
,undefined
- Arithmetic operators
- Relational operators
- Logical operators
- Assignment operators
- Ternary operator
- Type operators (
typeof
)
if
statementif-else
statementswitch-case
statement
while
loopdo-while
loopfor
loopfor-in
loop (for objects)for-of
loop (for arrays and iterables)
- Defining functions
- Function parameters and return types
- Optional and default parameters
- Rest parameters
- Arrow functions
- Callback functions
- Overloaded functions
- Declaring and initializing arrays
- Working with arrays
- Working with Tuples
- Array methods
- String methods
- Objects
- Classes
- Constructors
- Read Only Properties
- Static properties and methods
- Inheritance
- Method overriding
- Access modifiers
- Interfaces
- Organizing code with modules
- Exporting and importing modules
- Promises
- Async/await syntax
Module 2: Getting Started with Playwright
- Introduction to Playwright
- What is Playwright?
- Key Features of Playwright
- Comparison with other tools (e.g., Selenium, Cypress)
- Supported Browsers and Platforms
- Installation
- Setting up Node.js and npm
- Installing Playwright
- Configuring Playwright for different browsers
- Setting up a basic Playwright project
- Creating & Running Tests in Playwright
- Writing your first Playwright test
- Understanding the test structure
- Running tests in headed and headless modes
- Running tests on different browsers (Chromium, Firefox, WebKit)
Module 3: Locators & Test Generation
- Locators in Playwright
- XPath, CSS, and Property-based locators
- Built-in locators:
getByText
,getByRole
,getByLabel
, etc. - Best practices for writing robust locators
- Test Generation
- Record and Play Scripts - Test Generator
- Modifying and enhancing recorded tests
Module 4: Assertions and Test Validation
- Using
expect
for assertions - Common assertion methods:
toBe
,toEqual
,toContain
, etc. - Hard vs. Soft Assertions
- Implementing soft assertions in Playwright
Module 5: Handling Web Elements
- Handling Input Boxes & Radio Buttons
- Handling Checkboxes
- Handling Dropdowns (Single, Multi-Select, Bootstrap, Auto-Suggest, Hidden)
- Handling Web Tables
- Handling Date Pickers
Module 6: Handling Dialogs, Windows, and Frames
- Handling Dialogs/Alerts (JavaScript alerts, confirms, prompts)
- Handling Multiple Windows
- Handling Frames & Nested Frames
Module 7: Mouse and Keyboard Actions
- Mouse Actions:
- Hover, Right Click, Double Click, Drag and Drop
- Keyboard Actions:
- Typing, Key Combinations, Handling Keyboard Events
Module 8: File Handling & Playwright Hooks
- Uploading Files
- Playwright Hooks (
beforeAll
,afterAll
,beforeEach
,afterEach
) - Grouping Tests (
describe
blocks)
Module 9: Reporting & Debugging
- Capturing Screenshots
- Recording Videos
- Tracing Tests with Trace Viewer
- Using Reporters (Built-in & Custom Reporters)
- Generating Allure Reports
Module 10: Advanced Test Management
- Tagging Tests
- Using Annotations
- Implementing the Page Object Model (POM)
- Handling Flaky Tests & Retries
Module 11: Parallel Testing & Parameterization
- Running Tests in Parallel
- Configuring Parallel Execution
- Parameterizing Tests for Data-Driven Testing
Module 12: Framework Development
- Building a Custom Test Automation Framework with Playwright
- Best Practices for Framework Design
- Integrating Reporting, Logging, and Configuration Management
Module 13: Integrations & CI/CD
- Playwright with Jenkins
- Integrating Playwright tests with Jenkins
- Configuring Jenkins pipelines
- Version Control & CI/CD Concepts
- Git and GitHub
- Git Commands
- Continuous Integration (CI) and Continuous Delivery (CD)
- Jenkins Overview
- Running Playwright Tests through Jenkins
- Creating CI/CD Pipelines (Declarative & Scripted)
- Scheduling Jobs (Cron Patterns)
Module 14: API Testing with Playwright
- Introduction to API Testing with Playwright
- Writing API Tests using Playwright
- Validating API Responses