PlaywrightJS Tutorial

PlaywrightJS Tutorial

  • Docs

›The Playwright Library

Setup

  • PlaywrightJS Installation
  • Install Mocha and Chai
  • Installation Test

First Steps

  • Create a PlaywrightJS Test
  • Using Mocha and Chai

The Playwright Library

  • The Browser Object
  • The Context Object
  • The Page Object
  • Selectors
  • Navigation
  • Interactions
  • Auditing

Using PlayWright on web pages

  • A real world case

Code Generation

  • Code Generation

Cookbook

  • Timers
  • Using SQL
  • Database Connection
  • Email Setup

The Browser Object

Browser

A browser is an instance of a Chromium, Firefox or Webkit browser. Normally, the instance is created by launching it, and closing it when it is not longer used.

const { chromium } = require('playwright'); // 'chromium', 'firefox', 'webkit'.

const browser = await chromium.launch();
await browser.close();

Options

Some of the most used arguments are presented:

ArgumentTypeType
headlessbooleanRun browser in headless (no UI) mode
executablePathstringRun specific installed browser in path
slowMonumberSlows down Playwright in x milliseconds to watch the process

The full list of arguments can be found at the official documentation official documentation

← Using Mocha and ChaiThe Context Object →
  • Browser
    • Options