Playwright (software)

End-to-end testing framework

Playwright

Developer(s)| Microsoft
Initial release| January 31, 2020; 5 years ago (2020-01-31)[1]
Stable release|

1.54.1[2]  / 11 July 2025; 11 days ago (11 July 2025)

Repository| github.com/microsoft/playwright
Written in| TypeScript
Operating system| Microsoft Windows, macOS, Linux
Type| Software testing framework for web applications
License| Apache License 2.0
Website| playwright.dev

Playwright is an open-source automation library for browser testing and web scraping[3] developed by Microsoft[4][5] and launched on 31 January 2020, which has since become popular among programmers and web developers.

Playwright provides the ability to automate browser tasks in Chromium, Firefox and WebKit[6] with a single API. This allows developers to create reliable end-to-end tests that are capable of running in non-headless mode, as well as in headless mode for automation.

Playwright supports programming languages like JavaScript, Python, C# and Java, though its main API was originally written in Node.js. It supports all modern web features including network interception and multiple browser contexts and provides automatic waiting, which reduces the flakiness of tests.

## @playwright/test

[edit]

@playwright/test is a test runner with Jest-like assertions[7] developed and maintained by the Playwright team that is built on top of the Playwright API. This test runner is tightly integrated with Playwright and is specifically designed for end-to-end testing.[8] It has capabilities like browser-specific tests, parallel test execution,[9] rich browser context options, snapshot testing, automatic retries and many more.

## History

[edit]

Playwright was announced by Microsoft in January 2020.[10] It was developed to address the need for a unified API for cross-browser testing and to overcome limitations in existing tools like Puppeteer and Selenium. A team of engineers, including those who had previously worked on Puppeteer at Google, contributed to its development.[11] Playwright introduced features like automatic waits, multi-browser support, and network interception, making it a powerful tool for modern web testing. Since its inception, it has been actively maintained and has seen rapid growth and adoption in the web testing community.[12]

The @playwright/test runner was released later as part of an effort to provide a more comprehensive solution for browser-based testing. Its development was largely based on the need to have a specialized runner that can leverage the full potential of the Playwright API and make end-to-end testing more robust and straightforward.

## Usage and examples

[edit]

Playwright is primarily used for automating browser tasks, which can range from simple page navigation and content scraping to more complex operations like automated form submissions, user interactions and more. For instance, a simple JavaScript code snippet using Playwright might look like:

const { chromium } = require('playwright');

(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'example.png' });
await browser.close();
})();

In this example, Playwright is used to open a Chromium browser, navigate to `https://example.com`, take a screenshot and save it as `example.png`.

@playwright/test further extends these capabilities by providing a test runner that allows developers to write and organize their tests in a more structured and scalable manner. An example test using @playwright/test might look like:

const { test } = require('@playwright/test');

test('basic test', async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveTitle('Example Domain');
});

In this example, a test is written to navigate to `https://example.com` and check that the title of the page is "Example Domain".[13]

### Configuration

[edit]

Playwright tests can be customized using a configuration file (playwright.config.js) that supports various options including:

* Test timeout settings
* Retry attempts for failed tests
* Screenshot and video capture settings
* Headless mode configuration
* Test parallelization options

An example configuration might look like:

module.exports = {
testDir: './tests',
timeout: 30000,
retries: 2,
use: {
headless: true,
screenshot: 'only-on-failure',
video: 'retain-on-failure',

### Debugging features

[edit]

Playwright includes built-in debugging capabilities such as:

* Screenshots captured on test failures
* Video recording of test runs
* Trace viewer for detailed step-by-step analysis
* Debug mode with browser inspector
* Console logs and network request monitoring[14]

## References

[edit]

1. ^ "v0.10.0 release". GitHub. Retrieved 1 June 2022.
2. ^ "Release 1.54.1". 11 July 2025. Retrieved 13 July 2025.
3. ^ Bansal, Mudit; Dar, Muhammad Ameen; Bhat, Moshin Manzoor; Sharma, Tushar; Uniyar, Rishita (2023). "Data Ingestion and Processing using Playwright". TechRxiv.
4. ^ Yegulalp, Serdar (30 September 2020). "Microsoft's Playwright simplifies tests for Python web apps". InfoWorld. IDG Communications. Retrieved 2 July 2023.
5. ^ Tung, Liam (1 October 2020). "Microsoft: Playwright for Python language lets you test web apps in all major browsers". ZDNET. Retrieved 2 July 2023.
6. ^ Judis, Stefan (22 October 2022). "Playwright, a Time-Saving End-to-End Testing Framework". The New Stack. Retrieved 2 July 2023.
7. ^ "Assertions". Playwright. Microsoft. Retrieved 1 June 2023.
8. ^ "Library". Playwright. Microsoft. Retrieved 1 June 2023.
9. ^ "Parallelism and sharding". Playwright. Microsoft. Retrieved 1 June 2023.
10. ^ Attam, Arjun (30 September 2020). "Announcing Playwright for Python: Reliable end-to-end testing for the web". Microsoft DevBlogs. Microsoft. Retrieved 2 July 2023.
11. ^ Schiemann, Dylan (30 January 2020). "Microsoft Announces Playwright Alternative to Puppeteer". InfoQ. C4Media. Retrieved 2 July 2023.
12. ^ Gagan, Luc (1 July 2023). "A Comparative Analysis of Playwright Adoption vs Cypress and Selenium". Rayrun. Retrieved 2 July 2023.
13. ^ "toHaveTitle assertion". Playwright. Microsoft. Retrieved 1 June 2023.
14. ^ "How to Use Playwright for End-to-End Testing". roundproxies.com. 6 January 2025. Retrieved 6 February 2025.

## Further reading

[edit]

* Kinsbruner, Eran (2022). A Frontend Web Developer's Guide to Testing: Explore leading web test automation frameworks and their future driven by low-code and AI. Packt Publishing. ISBN 978-1803238319.
* Irvine, Daniel (2023). Svelte with Test-Driven Development: Advance your skills and write effective automated tests with Vitest, Playwright, and Cucumber.js. Packt Publishing. ISBN 978-1837638338.

## External links

[edit]

* Official website
* playwright on GitHub

* v
* t
* e

Microsoft development tools

Development
environments|

| Visual Studio|

* Code
* Express
* Team System Profiler
* Tools for Applications
* Tools for Office

|

Others|

* Blend
* Expression Web
* FxCop
* GW-BASIC
* MACRO-80
* Macro Assembler
* MSBuild
* Pascal
* QuickBASIC
* QBasic
* QuickC
* Robotics Developer Studio
* Roslyn
* SharePoint Designer
* FrontPage
* Small Basic
* WebMatrix
* Windows App SDK
* Windows App Studio
* Windows SDK
* CLR Profiler
* ILAsm
* Native Image Generator
* WinDiff
* XAMLPad

Languages|

* Dynamics AX
* BASIC
* Visual Basic
* legacy
* VB.NET
* VBA
* VBScript
* Bosque
* Visual C++
* C++/CX
* C++/CLI
* Managed C++
* C++/WinRT
* C#
* C/AL
* Dafny
* Dexterity
* F#
* F*
* Visual FoxPro
* Java
* J++
* J#
* JavaScript
* TypeScript
* JScript
* IronPython
* IronRuby
* Lean
* P
* Power Fx
* PowerShell
* Project Verona
* Q#
* Small Basic
* VPL
* XAML

APIs and
frameworks|

| Native|

* Windows API
* Silverlight
* XNA
* DirectX
* Managed DirectX
* UWP
* Xbox Development Kit
* Windows Installer
* WinUI

|

.NET|

* ASP.NET
* Core
* AJAX
* Dynamic Data
* MVC
* Razor
* Web Forms
* ADO.NET
* Entity Framework
* MAUI
* CardSpace
* Communication Foundation
* Identity Foundation
* LINQ
* Presentation Foundation
* Workflow Foundation

Device drivers|

* WDK
* WDF
* KMDF
* UMDF
* Windows HLK
* WDM

Database|

| SQL Server|

* Express
* Compact
* Management Studio
* MSDE

|

SQL services|

* Analysis
* Reporting
* Integration
* Notification

Other|

* Visual FoxPro
* Microsoft Access
* Access Database Engine
* Extensible Storage Engine

Source control|

* Visual SourceSafe
* Team Foundation Version Control

Testing and
debugging|

* CodeView
* OneFuzz
* Playwright
* Script Debugger
* WinDbg
* xUnit.net

Delivery|

* Active Setup
* ClickOnce
* npm
* NuGet
* vcpkg
* Web Platform Installer
* Windows Installer
* WiX
* Windows Package Manager
* Microsoft Store

Category

* v
* t
* e

Microsoft free and open-source software (FOSS)

Overview|

* Microsoft and open source
* Shared Source Initiative

Software|

| Applications|

* 3D Movie Maker
* Atom
* Conference XP
* Family.Show
* File Manager
* Open Live Writer
* Microsoft Edit
* Microsoft PowerToys
* Terminal
* Windows Calculator
* Windows Console
* Windows Package Manager
* WorldWide Telescope
* XML Notepad

|

Video games|

* Allegiance

Programming
languages|

* Bosque
* C#
* Dafny
* F#
* F*
* GW-BASIC
* IronPython
* IronRuby
* Lean
* P
* Power Fx
* PowerShell
* Project Verona
* Q#
* Small Basic Online
* TypeScript
* Visual Basic

Frameworks,
development tools|

* .NET
* .NET Framework
* .NET Gadgeteer
* .NET MAUI
* .NET Micro Framework
* AirSim
* ASP.NET
* ASP.NET AJAX
* ASP.NET Core
* ASP.NET MVC
* ASP.NET Razor
* ASP.NET Web Forms
* Avalonia
* Babylon.js
* BitFunnel
* Blazor
* C++/WinRT
* CCF
* ChakraCore
* CLR Profiler
* Dapr
* DeepSpeed
* DiskSpd
* Dryad
* Dynamic Language Runtime
* eBPF on Windows
* Electron
* Entity Framework
* Fluent Design System
* Fluid Framework
* Infer.NET
* LightGBM
* Managed Extensibility Framework
* Microsoft Automatic Graph Layout
* Microsoft C++ Standard Library
* Microsoft Cognitive Toolkit
* Microsoft Design Language
* Microsoft Detours
* Microsoft Enterprise Library
* Microsoft SEAL
* mimalloc
* Mixed Reality Toolkit
* ML.NET
* mod_mono
* Mono
* MonoDevelop
* MSBuild
* MsQuic
* Neural Network Intelligence
* npm
* NuGet
* OneFuzz
* Open Management Infrastructure
* Open Neural Network Exchange
* Open Service Mesh
* Open XML SDK
* Orleans
* Playwright
* ProcDump
* ProcMon
* Python Tools for Visual Studio
* R Tools for Visual Studio
* RecursiveExtractor
* Roslyn
* Sandcastle
* SignalR
* StyleCop
* SVNBridge
* T2 Temporal Prover
* Text Template Transformation Toolkit
* TLA+ Toolbox
* U-Prove
* vcpkg
* Virtual File System for Git
* Voldemort
* VoTT
* Vowpal Wabbit
* Windows App SDK
* Windows Communication Foundation
* Windows Driver Frameworks
* KMDF
* UMDF
* Windows Forms
* Windows Presentation Foundation
* Windows Template Library
* Windows UI Library
* WinJS
* WinObjC
* WiX
* XDP for Windows
* XSP
* xUnit.net
* Z3 Theorem Prover

Operating systems|

* MS-DOS (v1.25, v2.0 & v4.0)
* Barrelfish
* SONiC
* Azure Linux

Other|

* ChronoZoom
* Extensible Storage Engine
* FlexWiki
* FourQ
* Gollum
* Project Mu
* ReactiveX
* SILK
* TLAPS
* TPM 2.0 Reference Implementation
* WikiBhasha
* Windows Subsystem for Linux

Licenses|

* Microsoft Public License
* Microsoft Reciprocal License

Forges|

* CodePlex
* GitHub

Related|

* .NET Foundation
* F# Software Foundation
* Microsoft Open Specification Promise
* Open Letter to Hobbyists
* Open Source Security Foundation
* Outercurve Foundation

Category

Portal:

* Free and open-source software

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template