PlaywrightJS Tutorial

PlaywrightJS Tutorial

  • Docs

›Setup

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

PlaywrightJS Installation

Check the official documentation for a detailed explanation on any topic.

NodeJS installation

Download NodeJS from NodeJS (latest LTS version recommended)

Install NodeJS and check if NodeJS installation is ok by running this from the command line:

> node –version 

PlayWright Project Setup

Create a directory and then move into it

> md playwright_test
> cd playwright_test

Initialize a NodeJS project with default parameters

playwright_test > npm i -y 

Install PlaywrightJS local library

playwright_test > npm i -D playwright

This will install PlaywrightJS, and all browser binaries

Install PlaywrightJS command line interface globally

> npm i -g playwright-cli

This will install the Playwright CLI, used to automate UI interaction scripts.

← PreviousInstall Mocha and Chai →
  • NodeJS installation
  • PlayWright Project Setup