Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Playwright (software)

From Wikipedia, the free encyclopedia
End-to-end testing framework
Playwright
DeveloperMicrosoft
Initial releaseJanuary 31, 2020; 6 years ago (2020-01-31)[1]
Stable release
1.57.0[2] Edit this on Wikidata / 25 November 2025; 2 months ago (25 November 2025)
Written inTypeScript
Operating systemMicrosoft Windows,macOS,Linux
TypeSoftware testingframework forweb applications
LicenseApache License 2.0
Websiteplaywright.dev
Repositorygithub.com/microsoft/playwright

Playwright is anopen-source automation library for browser testing andweb scraping[3] developed byMicrosoft[4][5] and launched on 31 January 2020, which has since become popular amongprogrammers andweb developers.

Playwright provides the ability to automate browser tasks inChromium,Firefox, andWebKit with a single API.[6] It can also operate against branded browsers such asGoogle Chrome andMicrosoft Edge available on the host machine, although these browsers are not installed by default. The current Playwright version supports Stable, Beta, Dev, and Canary channels of Google Chrome and Microsoft Edge.[7] 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 likeJavaScript,Python,C# andJava, though its main API was originally written inNode.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[8] 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.[9] It has capabilities like browser-specific tests, parallel test execution,[10] rich browser context options, snapshot testing, automatic retries and many more.

History

[edit]

Playwright was announced by Microsoft in January 2020.[11] It was developed to address the need for a unified API for cross-browser testing and to overcome limitations in existing tools likePuppeteer,Cypress andSelenium. A team of engineers, including those who had previously worked on Puppeteer atGoogle, contributed to its development.[12] 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.[13]

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()=>{constbrowser=awaitchromium.launch();constpage=awaitbrowser.newPage();awaitpage.goto('https://example.com');awaitpage.screenshot({path:'example.png'});awaitbrowser.close();})();

In this example, Playwright is used to open a Chromium browser, navigate tohttps://example.com, take a screenshot and save it asexample.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})=>{awaitpage.goto('https://example.com');awaitexpect(page).toHaveTitle('Example Domain');});

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

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[15]

Reporters

[edit]

Reporters in Playwright define how test results are captured, aggregated, and surfaced after execution. They turn raw test events into structured output such as logs, files, dashboards, or external integrations, enabling teams to analyze trends, spot regressions, and debug failures more effectively.

By centralizing errors, timings, traces, screenshots, and metadata, reporters make it easier to understand why tests failed, not just that they failed.

Playwright includes built-in reporters[16] and exposes a reporter API[17] that supports both open-source and commercial implementations, which are listed below.

Usage Trends

[edit]

As of 2025, Playwright is reported to have over 75,000 GitHub stars, more than 20 million NPM[18] all‑time downloads, and over 11,000 Stack Overflow questions. It has been described as experiencing the fastest growth in community adoption, GitHub stars, and modern usage among major web testing frameworks.

Data Insights (Playwright 2025)
ToolGitHubStarsNPM All Time DownloadsStackOverflow QsFirst ReleasedUpdate Pace
Playwright75,000+20M+11,000+2020Rapid, innovative

References

[edit]
  1. ^"v0.10.0 release".GitHub. Retrieved1 June 2022.
  2. ^"Release 1.57.0". 25 November 2025. Retrieved26 November 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. Retrieved2 July 2023.
  5. ^Tung, Liam (1 October 2020)."Microsoft: Playwright for Python language lets you test web apps in all major browsers".ZDNET. Retrieved2 July 2023.
  6. ^Judis, Stefan (22 October 2022)."Playwright, a Time-Saving End-to-End Testing Framework".The New Stack. Retrieved2 July 2023.
  7. ^"Supported browsers".Playwright Documentation. Microsoft. Retrieved20 January 2026.
  8. ^"Assertions".Playwright.Microsoft. Retrieved1 June 2023.
  9. ^"Library".Playwright.Microsoft. Retrieved1 June 2023.
  10. ^"Parallelism and sharding".Playwright.Microsoft. Retrieved1 June 2023.
  11. ^Attam, Arjun (30 September 2020)."Announcing Playwright for Python: Reliable end-to-end testing for the web".Microsoft DevBlogs.Microsoft. Retrieved2 July 2023.
  12. ^Schiemann, Dylan (30 January 2020)."Microsoft Announces Playwright Alternative to Puppeteer".InfoQ. C4Media. Retrieved2 July 2023.
  13. ^Gagan, Luc (1 July 2023)."A Comparative Analysis of Playwright Adoption vs Cypress and Selenium".Rayrun. Retrieved2 July 2023.
  14. ^"toHaveTitle assertion".Playwright.Microsoft. Retrieved1 June 2023.
  15. ^"How to Use Playwright for End-to-End Testing".roundproxies.com. 6 January 2025. Retrieved6 February 2025.
  16. ^"Playwright Reporter API".playwright.dev. 14 January 2026. Retrieved14 January 2026.
  17. ^"Playwright Reporter API".playwright.dev. 14 January 2026. Retrieved14 January 2026.
  18. ^"Playwright vs Selenium vs Cypress: Best 2025 Comparison".ThinkSys. Retrieved2025-08-06.

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]
Microsoft development tools
Development
environments
Visual Studio
Others
Languages
APIs and
frameworks
Native
.NET
Device drivers
Database
SQL Server
SQL services
Other
Source control
Testing and
debugging
Delivery
Overview
Software
Applications
Video games
Programming
languages
Frameworks,
development tools
Operating systems
Other
Licenses
Forges
Related
Portal:
Retrieved from "https://en.wikipedia.org/w/index.php?title=Playwright_(software)&oldid=1337455242"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp