Playwright with Typescript



Introduction to Playwright
• Overview of end-to-end testing
• Introduction to Playwright
• Architecture of Playwright
• Playwright vs Selenium
• Features and capabilities of Playwright
• Installing Playwright (Node.js and Playwright setup)
• Playwright CLI and IDE overview
Exercises:
• Install Playwright and set up the development environment
• Write a simple script to open a browser and navigate to a webpage

Typescript
• Variables
• Conditional Statements
• Loops
• Arrays
• Functions
• Creating classes
• String functions
• Enums

Core Concepts and Basic Usage
• Browsers and contexts
• Pages and frames
• Locators/Selectors:
• ID
• GetByRole()
• GetByText()
• Xpath
• CssSelector
• Basic actions (click, fill, type, etc.)
• Assertions and Validations
Exercises:
• Create a script to interact with different elements on a webpage
• Use various types of selectors to locate elements
• Implement basic assertions to validate page content

Advanced Interactions
• Handling forms and input fields
• File uploads and downloads
• Handling Alerts, Frames, and Windows
• Mouse and keyboard interactions
Actions:
• Double click
• Right click
• Window scroll
• Focus on element

• Capturing screenshots and videos
Exercises:
• Automate a form submission process
• Handle file uploads and verify the upload
• Manage multiple browser windows and frames
• Capture screenshots and video recordings of tests

• Annotations
• Debugging test cases
• PageObject Model
• Reading Data from Excel

Network Interception and Mocking
• Intercepting network requests and responses
• Mocking API responses
• Handling authentication (Basic, Token-based)
• Network throttling and offline mode
Exercises:
• Intercept and modify network requests
• Mock API responses to test different scenarios
• Automate login processes using various authentication methods
• Simulate network conditions and test application behaviour
Test Automation Framework
• Structuring Test Suites and Test Cases
• Page Object Model (POM)
• Writing reusable functions and components
• Data-Driven Testing with Parameterization
• Running tests in parallel
Exercises:
• Organise tests into suites and cases
• Implement Page Object Model for a sample application
• Write reusable helper functions
• Create data-driven tests using different data sets
• Configure and run tests in parallel

Continuous Integration and Deployment
• Integrating Playwright with CI/CD tools (Jenkins, GitHub Actions, GitLab CI)
• Running tests in Headless Mode
• Generating Test Reports (Allure, HTML)
• Debugging failed tests
Exercises:
• Set up a CI/CD pipeline to run Playwright tests
• Configure tests to run in headless mode
• Generate and customise test reports
• Debug and fix failing tests in the CI environment

Cross-Browser and Mobile Testing
• Running tests on different browsers (Chromium, Firefox, WebKit)
• Emulating mobile devices and network conditions
• Testing responsiveness and mobile-specific features
• Using BrowserStack or Sauce Labs for Cross-Browser testing
Exercises:
• Execute tests across different browsers
• Emulate mobile devices and run tests
• Verify responsiveness of web applications
• Integrate with BrowserStack or Sauce Labs for broader testing coverage

Playwright Plugins and Customization
• Using Playwright test runner
• Integrating third-party plugins
• Custom reporters and test hooks
• Extending Playwright with custom functions
Exercises:
• Set up and use Playwright test runner
• Integrate and use a Playwright plugin
• Create custom test hooks and reporters
• Develop and use custom functions in Playwright scripts

Tags: , , ,

Subscribe now

Receive weekly newsletter with educational materials, new courses, most popular posts, popular books and much more!