Playwright Python and Pytest for Web Automation Testing



Learn Playwright and pytest for Web Automation Testing & API Testing with this Comprehensive Course

What you will learn

Write python scripts to launch browsers and automate tasks performed usually on websites

Locate web elements using various methods like element role, inner text, form label or placeholder, CSS selectors, and XPath

Perform actions on web elements like hover, click, fill form, select option, upload files, and use keyboard shortcuts

Handle events like auto-waiting, custom waiting for an element to load, page navigations, requests, and downloads

Log in to websites and authenticate yourself using your account like Google accounts

Write a script to automate inbox mail checking for new emails and report the same

Use pytest to write and run test cases and define custom pytest fixtures to share test state/data

Utilize playwright tools like taking screenshots, recording videos, trace viewer, and auto code generator

Apply best practices like web-first assertions, Page Object Models (POM), request interceptions and Parallelism

Test API endpoints, define custom API request context, handle API responses, and mock API custom data

Deploy automated tests using Github CI

Practice Behaviour Driven Development (BDD) with playwright and python behave

Description

Playwright is a modern, fast and reliable browser automation tool from Microsoft that enables testing and automation across all modern browsers including chromium, firefox and webkit. Pytest is a popular Python testing framework that offers a simple and flexible way to write and run tests. In this course, you will learn how to blend Playwright capabilities into the Pytest framework with the use of pytest-playwright plugin.

This course is designed for beginners in mind! It’s alright if you don’t anything about web automation! We will cover all the basics of Playwright and Web Automation Essentials, step by step –

  • Different method to locate web elements like role, text, css selectors, xpath, etc.
  • Perform actions on web elements like clicking, filling forms,
  • Events like Auto-waiting, page navigation, downloads, etc.
  • Authentication with your google account

As a bonus, we will develop a script to automatically check for new emails in our inbox and report them back i.e. automated mail checking!


After learning web automation, we will start with testing. Again, it’s alright if you’re new to automation testing or testing at all! You’ll go from writing a basic test to deploying automated tests –

  • Basics of testing with pytest
  • Playwright pytest plugin
  • Playwright Tools like trace viewer, codegen, etc.
  • Web-first assertions using expect( )
  • Solve modern testing problems with UI Testing Playground
  • Playwright fixtures, custom setup/teardown using test hooks, , etc.
  • Implement Page Object Model (POM)
  • Handle network events
  • REST API Testing, authentication and API request context
  • Optimizations techniques like Parallelism
  • Deploy automated tests to CI
  • Parameterize tests with predefined test data
  • Behaviour Driven Development with python behave
  • and more…

By the end of the course, you will be able to write automated tests and perform fast, reliable, and capable testing and automation using Playwright and Pytest.

English
language

Content

Getting Started

Installation
Playwright Website
Launch Browser
Click Link
Overview

Locators

Playwright in Python REPL
Role Locator
Input Field Locator
Inner Text Locator
Alt Text Locator
Title Locator
CSS Selectors
CSS Selectors – Hierarchy
CSS Selectors – Pseudo Classes
XPath Locators
XPath Functions
Other Locators

Actions

Mouse Actions
Fill Input Fields
Radios, Checkboxes and Switches
Select Option From Option Menu
Dropdown Menu
Upload Files
Keyboard Shortcuts

Events

Auto Waiting
Page Navigation Events
Custom Waiting
Event Listeners
Handling Dialogs
Download Files
What Is Sync and Async?
Async Playwright

Authentication

Log In With Google Account
Save Authentication State
Reuse Authentication State

Automated Mail Checker

Automatic Mail Checker
Project Setup
Locate New Emails
Locate Email Data
Combine Locators
Email Check From Terminal

pytest

Testing with pytest
Writing Test
Running Test
Type Hinting
Test State Example
Create pytest Fixture
Using Fixture In Test Cases
Fixture Scope

pytest-playwright Plugin

Install pytest-playwright plugin
Writing Test with Playwright
Running Test
Pytest Config File
Test Hook

Playwright Tools

Take Screenshot
Record Video
Trace Generator and Viewer
Playwright Codegen

Web-First Assertions

Page Assertions
Element State Assertions
Inner Text Assertions
Attribute Assertions
Input Field Assertions
Checkbox Assertions
Option Menu Assertions

UI Testing Playground

Dynamic Id
Class Attribute
Hidden Layer
Load Delay
Ajax Request
Click Action
Input Fields
Scrollbars
Dynamic Table
Verify Text
Progressbar
Element Visibility
App Login
Mouse Hover
Non Breaking Space Character
Overlapped Elements

Playwright Fixtures

Function Scope Fixtures
Session Scope Fixtures
Browser Selection Markers
Browser Launch And Context Arguments

Page Object Model (POM)

What is Page Object Model?
POM Implementation
POM Usage
POM Example
POM Example Usage

Network Events

Network Events
Handle Requests
Modify Response

API Testing

Making an API Call
API Request Context
API Query String
CRUD Operations
Mock API with Custom Data

Optimization

Intercept Resource Requests
Disabling Javascript
Parallelism – Run Tests In Parallel

Tips and Tricks

pytest CLI Arguments
Python Debugger
Device Emulation
Evaluate Javascript

Github API

Introduction
Project Setup
Github Token
Authorized API Context
Writing Test
Running Test

Continuous Integration (CI)

Introduction
Setup Repository
Writing Test
Github Action
Running Automated Tests

Data Driven Testing

What Is Data Driven Testing?
Pytest Paramertrize
Running Test

Behaviour Driven Development

What Is Behaviour Driven Development?
Project Setup
Define Feature
Implement Steps
Running Tests with Behave

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock

Check Today's 30+ Free Courses on Telegram!

X