YoVDO

Playwright Page Object Model - Step by Step Demo

Offered By: Automation Step by Step via YouTube

Tags

Playwright Courses Javascript Courses GitHub Courses Node.Js Courses Software Testing Courses Automated testing Courses Test Automation Courses Page Object Model Courses

Course Description

Overview

Learn how to implement the Page Object Model in Playwright through this step-by-step tutorial video. Create a new Node.js project, set up Playwright, and develop a demo login test using the Test Generator. Run tests, analyze results, and organize your project by creating page objects. Implement element locators and action methods for the login page, then refactor your test to use the new Page Object Model structure. Finally, execute the refactored test and upload the project to GitHub. Follow along to master this essential design pattern for more maintainable and scalable automated tests with Playwright.

Syllabus

Introduction
Step 1 - Create a new folder and open in IDE or Editor like VS Code
Step 2 - Initialize a new Node.js project by running npm init -y to create a package.json file
Step 3 - Install & Setup Playwright by running npm init playwright@latest
Step 4 - Create a demo login test, can use Test Generator to record npx playwright codegen
Step 5 - Run tests and check results - npx playwright test & npx playwright show-report
Step 6 - Create new folder "pages" in your project, this will contain all page objects
Step 7 - Create a new file and class for each page e.g. login.js and LoginPage
Step 8 - In the class create element locators & action methods for login page
Step 9 - In test file, import the page class, create instance of it, & use methods from LoginPage class
Step 10 - Run the test npx playwright test and check results
Upload project on GitHub


Taught by

Automation Step by Step

Related Courses

Learn Javascript - 21 Essential Array Methods
Coursera Project Network via Coursera
3D Graphics for Web Developers
Pompeu Fabra University via FutureLearn
A Simple Scatter Plot using D3 js
Coursera Project Network via Coursera
Access WebView in an Android Studio Project
Coursera Project Network via Coursera
Deployment Pipelines using GitHub Actions
A Cloud Guru