QA Automation Labs

Set up End to End Test Automation tool Playwright with Java Script


Set up End to End Test Automation tool Playwright with Java Script

This blog cover about how we can set up Playwright / Java Script

What is Playwright?

Playwright is an open-source Node.js library started by Microsoft for automating browsers based on Chromium, Firefox, and WebKit through a single API. The primary goal of Playwright is to improve automated UI testing. Playwright is made to enable cross-browser web automation.

Playwright test allows to:

  • Run tests across all browsers.
  • Execute tests in parallel.
  • Capture videos, screenshots, and other artifacts on failure.
  • Enjoy context isolation out of the box.
  • Integrate your POMs as extensible fixtures.

Why Playwright?

Playwright have very rich features, a number of the features are explained below

  1. Easy Setup: Playwright is extremely easy to line up in an exceedingly few min we will start writing the script
  2. Browser Support: Playwright support multiple browse Chromium family browsers (Chrome, Edge), Webkit (Safari), and Firefox are all supported.
  3. Parallel Testing: Playwright supports parallel execution. we can run parallel tests with multiple browsers.
  4. Support for Multiple Tab: Playwright supports multi-tab and windows by launching a new window.
  5. Language Support: Playwright supports Java, C#, Python, and Javascript, Typescript which makes him popular.
  6. Testing: Using Playwright we can do End to End, Functional, API Testing, and Accessibility Testing.
  7. Built-in Reporters: Playwright framework support JSON, JUnit, and HTML Reporters. Playwright also supports the reporter Allure Report.
  8. CI/CD Support: Playwright supports CI/CD integration like Jenkins, Circle CI, Bitbucket Pipeline Bamboo, AWS CodePipeline, Travis CI, GitHub Actions, and more.

Other features Playwright support

  • Shadow DOM
  • Automatic Waiting,
  • Page object model
  • Test Retry,
  • Cross-Origin
  • iframe
  • Emulation
  • Screenshot capture
  • Video Capture

Install Playwright


There are two ways of installing the playwright

Using the VS Code extension

  1. Create a folder e.g playwright_first_script
  2. Open the folder in VS Code
  3. Search Playwright extension in vs code and Install it

4. Now Press command +shift +P (in mac)

5. Type “Install Playwright”

Click on the OK button on the above screenshot. As we click on OK button Playwright installation start

Using init command

Alternatively, we can scaffold your project using the init command.

  1. Create a folder e.g playwright_first_script
  2. Open the folder in VS Code
  3. Run from the project’s root directory npm init playwright@latest

We can see within the above screenshot playwright is installed and also the default spec file is displaying (example.spec.js)


Playwright can be easily installed and you can write your first script within a minute. Playwright has very rich features that differentiate him from other tools.


Leave a Comment

Your email address will not be published. Required fields are marked *

Recent Posts

Let’s Play with Cypress Feature “Test Replay”

Problem Statement Before Cypress v13, test failures in CI have historically been captured through screenshots, videos, and stack trace outputs, b
Read More

Handling Shadow DOM Using Cypress

The idea of componentization has completely changed how we design and maintain user interfaces in the field of web development. The advent of Shadow D
Read More

Gear up for upcoming Conferences of 2024! ✨✨

Gear up for our upcoming Conferences of 2024! ✨ ✨ #TheTestTribe #SoftwareTesting #Testers #Community #Worqference #Worqference2024 #QonfX 
Read More