@playwright/test
Playwright is a modern end-to-end testing and browser automation framework developed by Microsoft that supports Chromium, Firefox, and WebKit browsers with a si…
Installation
npm install -D @playwright/test
yarn add -D @playwright/test
pnpm add -D @playwright/test
Import
import { test, expect } from '@playwright/test';Quick Example
import { test, expect } from '@playwright/test';
test('homepage has title', async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example/);
await expect(page.locator('h1')).toBeVisible();
});About @playwright/test
Playwright is a modern end-to-end testing and browser automation framework developed by Microsoft that supports Chromium, Firefox, and WebKit browsers with a single API. Playwright tests run across all major browser engines and platforms, enabling comprehensive cross-browser testing with reliable, flake-free execution. The framework provides auto-waiting that intelligently waits for elements to be actionable before performing operations, eliminating the need for manual waits and sleep statements that plague other testing tools. Playwright includes built-in support for testing on mobile viewports, emulating geolocation and permissions, intercepting network requests, capturing screenshots and videos, and generating trace files for debugging test failures. The test runner supports parallel execution, test fixtures for dependency injection, built-in assertions with auto-retry, and a rich HTML reporter. Playwright's codegen tool records user interactions in the browser and generates test scripts automatically. The framework handles iframes, shadow DOM, multiple tabs, file uploads and downloads, and web component testing natively. Playwright has rapidly overtaken older tools in adoption due to its reliability and developer experience.
Quick Facts
| Package | @playwright/test |
| Category | Testing |
| Weekly Downloads | 5M+ |
| License | Apache-2.0 |
| Install | npm install -D @playwright/test |
Related Packages
Puppeteer is a Node.js library developed by Google that provides a high-level API to control Chrome …
Cypress is a next-generation front-end testing tool built for the modern web, providing a complete e…
Testing Library is a family of packages that helps you test UI components in a way that resembles ho…
Jest is a delightful JavaScript testing framework with a focus on simplicity, created by Facebook. I…
Vitest is a blazing-fast unit testing framework powered by Vite, designed as a modern alternative to…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.