← All repositories

microsoftplaywright

82,810 stars5,162 forksTypeScriptapache-2.01 view
playwright.dev

Playwright

Features

  • Browser Automation FrameworksA cross-browser testing tool that drives web applications through a unified API to simulate user interactions and verify application behavior.
  • Behavior-Driven TestingPlaywright verifies application behavior by interacting with rendered output rather than internal implementation details to ensure tests remain resilient to code refactoring.
  • Accessibility-Tree-Based LocatorsResolves elements using semantic roles and labels to prioritize user-facing attributes over brittle, implementation-specific DOM structures.
  • Actionability EnginesPerforms continuous, asynchronous checks for visibility, stability, and readiness before executing user interactions to eliminate flakiness.
  • Assertion LibrariesPlaywright verifies web element states and properties using auto-retrying assertions that wait for conditions to be met before timing out.
  • Headless Browser ControllersPlaywright executes browser automation commands via a command-line interface designed for coding agents, featuring live session monitoring and visual dashboard control.
  • CLI Test RunnersPlaywright executes test suites from the command line, running tests across configured browsers in headless mode by default to verify application functionality.
  • Component Testing UtilitiesPlaywright mounts components into a real browser environment to verify layout, interactions, and visual regression while maintaining access to Node.js test utilities.
  • Cross-Browser Testing ToolsPlaywright executes tests across multiple browser configurations simultaneously to verify consistency, with options to toggle between headless and visible modes.
  • End-to-End Testing FrameworksPlaywright runs end-to-end tests across multiple browsers with auto-waiting, web-first assertions, and full browser isolation for reliable, parallelized test execution.
  • End-to-End Testing SuitesA comprehensive test runner that orchestrates parallel execution, manages browser contexts, and provides built-in assertions for reliable web application validation.
  • Test Fixture SystemsManages test lifecycle and environment setup through a dependency-injected system that automatically handles resource allocation and cleanup.
  • Web-First Testing ToolsA testing paradigm that prioritizes user-facing locators and auto-waiting mechanisms to ensure test stability against dynamic DOM changes and asynchronous updates.
  • Cross-Browser Execution EnginesA runtime environment that manages multiple browser binaries and device emulations to verify application consistency across different rendering engines and platforms.
  • Browser Context IsolationPlaywright creates independent browser contexts that maintain separate local storage, session storage, and cookies for each test execution.
  • Worker Process ManagementPlaywright orchestrates test execution across multiple OS worker processes, which run independently and are automatically restarted after failures to ensure a pristine environment.
  • Auto-Waiting AssertionsPlaywright performs assertions that automatically wait for elements to reach the expected state, reducing the need for manual waits or brittle timing logic.
  • Browser Page ManagementPlaywright creates and manages browser pages within a context to navigate URLs, interact with page content, and perform actions on individual tabs or windows.
  • Element LocatorsPlaywright identifies elements using standard CSS selectors, augmented with custom pseudo-classes to target elements based on visibility, content, or layout.
  • Element State AssertionsPlaywright verifies element states using auto-retrying assertions that wait for conditions to be met, effectively eliminating flakiness in test suites.
  • Resilient UI Testing Frameworks| Building stable test suites that remain functional despite frequent DOM changes by utilizing user-facing locators and auto-waiting mechanisms.
  • Accessible LocatorsPlaywright identifies elements by their accessible role and name to ensure robust and accessible test interactions.
  • Page Object ModelsPlaywright encapsulates common page operations and locators into a reusable class to simplify test code and improve maintainability.
  • Actionability VerificationPlaywright performs automatic actionability checks on elements before executing interactions to ensure they are visible, stable, enabled, and ready to receive events.
  • Fixture OverridingPlaywright modifies the behavior of built-in or custom fixtures to inject custom configuration or replace them entirely for specific test suites.
  • Accessibility Snapshot TestingPlaywright verifies page accessibility by comparing the current accessibility tree against a stored YAML-based snapshot template.
  • Event Synchronization MechanismsPlaywright waits for specific browser events to occur before proceeding with script execution, using promise-based patterns for requests, popups, or other asynchronous actions.
  • Test Recording ToolsPlaywright generates test code by interacting with a browser to record user actions, create assertions, and pick locators via a dedicated inspector window.
  • Component Testing FrameworksPlaywright installs and configures component testing to enable rendering and testing components in a real browser environment.
  • Component Mounting UtilitiesPlaywright passes props, event handlers, and children to components during the mounting process to simulate various component states and user interactions.
  • Test Configuration SuitesPlaywright configures test projects with custom options and environment-specific settings to run the same test suite across multiple configurations.
  • Test FixturesPlaywright extends the base test object to provide reusable setup and teardown logic for test environments and page objects.
  • Visual Regression Testing| Detecting unintended UI changes by comparing current page or element snapshots against baseline images to maintain design consistency.
  • Visual Regression Testing ToolsPlaywright generates reference screenshots for visual regression testing, automatically saving them to the file system when no baseline exists.
  • Test Execution StrategiesPlaywright distributes a test suite across multiple machines by sharding the execution, allowing large test sets to run concurrently in parallel environments.
  • Test Suite ShardingPlaywright splits test files across multiple machines by passing command-line arguments to enable parallel execution and faster completion times.
  • Global Test Lifecycle HooksPlaywright executes setup and teardown functions once before and after the entire test suite, passing data between them using environment variables or state files.
  • Test Setup OrchestratorsPlaywright defines and executes setup or teardown tasks independently to manage authenticated states and database seeding before running primary test suites.
  • API Request MockingPlaywright intercepts network requests to specific URL patterns and returns custom responses to run tests without making actual network calls.
  • Asynchronous Polling MechanismsPlaywright polls asynchronous functions until a specific condition is met, using configurable timeouts and intervals for flexible wait logic.
  • Browser API MockingPlaywright injects initialization scripts before page navigation to override browser APIs and simulate specific hardware or environment states during automated testing.
  • Browser EmulationPlaywright overrides the default browser user agent string to test application compatibility and behavior across different browsers or custom client identifiers.
  • DOM Element SelectorsPlaywright performs list operations such as counting items, asserting text content, or selecting specific items by index or filter criteria.
  • Element SelectorsPlaywright queries elements relative to the results of previous selectors, with support for capturing intermediate matches using a prefix.
  • Network Traffic MonitorsPlaywright monitors network requests and responses in real-time, or waits for specific network events using glob patterns, regular expressions, or custom predicate functions.
  • Pointer Interaction ToolsPlaywright executes human-like pointer interactions including clicks, double-clicks, right-clicks, and modifier-key combinations with automatic actionability checks.
  • Test Fixture ManagementPlaywright defines automatic fixtures that execute for every test or worker regardless of whether they are explicitly requested, useful for global logging or monitoring.
  • Test ID SelectorsPlaywright identifies elements using resilient, developer-defined test ID attributes to ensure tests remain stable even when UI text or roles change.
  • Resilient Locator StrategiesPlaywright locates elements using resilient, user-facing attributes like roles and labels to ensure tests remain stable even when the underlying DOM structure changes.
  • Browser Environment EmulatorsPlaywright emulates specific browser environments during test generation, including viewport size, device profiles, color schemes, geolocation, language, timezone, and authenticated state.
  • Device EmulatorsPlaywright applies pre-configured parameters like user agent, screen size, and touch support to browser contexts to simulate specific device behavior.
  • Test Failure Debugging ToolsPlaywright debugs test failures using breakpoints, variable inspection, error messages, AI-powered suggestions, and a step-by-step trace viewer for deep analysis.
  • API Testing FrameworksPlaywright executes HTTP requests using built-in fixtures to perform CRUD operations, validate responses, and assert on API data structures within test files.
  • Parallel Execution ManagersPlaywright configures the maximum number of parallel worker processes to optimize test execution speed based on available system resources.
  • Test Reporting ToolsPlaywright configures built-in test reporters to output results in various formats and customize verbosity or step-level reporting.
  • API and UI Integration ToolsPlaywright integrates API calls into UI-based browser tests to establish preconditions or validate postconditions on the server side during end-to-end testing.
  • Assertion TimeoutsPlaywright sets assertion timeouts globally or for individual auto-retrying assertions to handle varying wait times for UI elements.
  • Action Timeout ConfigurationsPlaywright defines default timeouts for actions and navigation globally or overrides them for specific actions to handle slow-loading pages.
  • Parallel Worker AuthenticationPlaywright authenticates once per parallel worker process using unique accounts to prevent state interference when tests modify shared server-side data.
  • Serial Test Execution ModesPlaywright annotates inter-dependent tests as serial to ensure they execute in a specific order, skipping subsequent tests if a preceding test fails.
  • Test Dependency ManagersPlaywright defines project dependencies to ensure specific setup tasks or prerequisite tests execute before dependent projects run.
  • API Request ConfigurationsPlaywright defines API request defaults like base URLs, headers, and proxy settings globally or per-test to standardize HTTP interactions across the test suite.
  • API Response ModifiersPlaywright intercepts outgoing API requests and modifies their responses dynamically to inject custom data or patch existing payloads for reproducible testing.
  • Authentication State ManagementPlaywright persists and reuses authenticated session state between API and browser contexts to streamline testing of protected endpoints and user flows.
  • Custom Selector EnginesPlaywright defines domain-specific element querying logic by registering custom selector engines for enhanced element identification.
  • Form Interaction UtilitiesPlaywright inputs data into form fields by focusing elements and triggering events for text, date, time, and datetime inputs.
  • Test ParameterizationPlaywright generates unique test cases by iterating over data arrays, with support for scoped hooks and custom test descriptions.
  • Time Manipulation UtilitiesPlaywright advances the clock by specific durations to manually trigger timers and animation frames for fine-grained control over time-based application state changes.
  • Visual and Environment EmulationPlaywright emulates system color schemes and media types to verify responsive design and theme-based styling.
  • WebSocket Mocking ToolsPlaywright intercepts WebSocket connections to mock server communication or modify individual messages sent between the client and the server during runtime.
  • Input State InteractionsPlaywright checks or unchecks checkboxes and radio buttons by interacting with standard input elements or custom roles.
  • Accessibility Auditing ToolsPlaywright audits web pages for accessibility violations by running automated scans against the DOM and asserting that no violations are present.
  • Accessibility Violation SuppressionPlaywright suppresses specific accessibility violations by excluding DOM elements or disabling individual scan rules during the automated audit process.
  • Soft AssertionsPlaywright executes multiple assertions without immediately terminating the test, allowing for the collection and display of all failures at the end of the test run.
  • Accessibility Compliance Auditings| Automating the verification of web pages against accessibility standards to ensure inclusive user experiences and identify potential compliance violations.
  • Accessibility Testing ConfigurationsPlaywright defines reusable accessibility scan configurations to share builder settings and rule exclusions across multiple test files.
  • Test Planning UtilitiesPlaywright generates human-readable test plans from application requirements and seed tests to outline scenarios and user flows for automated testing.
  • Initialization Script InjectionsPlaywright injects scripts into the page before it loads to configure mocks, test data, or global environment overrides for every test.
  • Test Suite FiltersPlaywright filters test suites by applying glob patterns or regular expressions to include or exclude specific test files from the execution process.
  • API Request ContextsPlaywright initializes standalone API request contexts manually to perform out-of-band HTTP operations outside of the standard test fixture lifecycle.
  • Browser Extension Testing ToolsPlaywright loads and tests browser extensions by configuring persistent browser contexts with extension-specific arguments and retrieving extension IDs for automated interaction.
  • Locale and Timezone EmulatorsPlaywright configures the browser locale and timezone to test application behavior under different regional settings and time-based logic.
  • Shadow DOM SelectorsPlaywright identifies elements within Shadow DOM trees automatically, allowing seamless interaction with custom web components without special configuration.
  • Synchronous AssertionsPlaywright performs immediate, non-retrying assertions on values to validate logic, state, or data without waiting for asynchronous UI updates.
  • Test Assertion ExtensionsPlaywright adds custom matchers to the assertion library to encapsulate domain-specific validation logic and improve test readability.
  • Test Filtering MechanismsPlaywright executes only specific tests while ignoring all others in the project during development or debugging sessions.
  • Test Grouping UtilitiesPlaywright organizes tests into logical groups to share setup and teardown hooks or to apply common configurations and metadata to multiple tests.
  • Test Lifecycle HooksPlaywright executes setup and teardown logic before and after test suites using lifecycle hooks to ensure consistent test environments.
  • Test Report AggregatorsPlaywright merges test reports from multiple shards into a single, unified report by collecting blob-formatted results and processing them with a utility.
  • Test Retry StrategiesPlaywright configures test retries to automatically re-run failing tests until they pass or a maximum limit is reached.
  • Test Tagging SystemsPlaywright applies custom labels to tests to enable filtering, selective execution, or exclusion of specific test subsets via command-line arguments or configuration files.
  • Test TimeoutsPlaywright configures test timeouts globally or for individual tests, hooks, or suites to manage execution duration.
  • Test Configuration ManagersPlaywright switches between multiple configuration files to target different test environments or suites directly from the sidebar interface.
  • Test ReportersPlaywright creates a class that adheres to the reporter API to handle test lifecycle events and generate specialized output formats.
  • Screenshot BuffersPlaywright captures a screenshot as a raw buffer to enable post-processing, pixel-diffing, or custom handling without writing to the file system.
  • Automated Test ExecutionPlaywright executes test suites from the command line using filtering, parallel processing, headed browser modes, and interactive debugging sessions.
  • Visual Test RunnersPlaywright executes tests in a visual interface that allows stepping through actions, inspecting locators, and watching for changes during the development process.
  • Editor-Integrated DebuggingPlaywright debugs tests directly within the editor by setting breakpoints, inspecting error messages, and stepping through code with integrated browser-side highlighting.
  • Editor-Integrated Test ExecutionPlaywright runs individual tests, files, or full project suites directly from the editor with visual feedback on pass/fail status and execution time.
  • Test Code GeneratorsPlaywright records browser interactions to produce automated test scripts in multiple languages while customizing output files and test ID attributes.
  • Test Generation ToolsPlaywright generates test code by interacting with a browser to record user actions, create assertions, and pick locators directly within the editor.
  • Test Trace ViewersPlaywright opens recorded trace files in a dedicated viewer to analyze and debug test execution with configurable host and port settings.
  • Trace Inspection ToolsPlaywright explores recorded test traces to visually examine DOM snapshots, network activity, console logs, and action details for every step of a test.
  • Visual DebuggersPlaywright inspects and debugs test execution using a dedicated GUI to step through actions, live-edit locators, and view detailed actionability logs.
  • Execution Tracing SystemsRecords full-fidelity state, network activity, and console logs during execution to enable time-travel debugging and visual failure analysis.
  • Visual Debugging EnvironmentsA suite of integrated tools that provides trace viewers, live inspectors, and time-travel debugging to analyze test failures and browser state.
  • Test Generation UtilitiesPlaywright invokes the test generator within a custom browser context to record interactions in non-standard or complex application environments.
  • Watch ModesPlaywright enables automatic test re-execution by toggling watch mode to trigger runs whenever source code changes are detected.
  • Browser Context ManagersPlaywright creates multiple isolated browser contexts within a single test scenario to simulate multi-user interactions or complex cross-session functionality.
  • Browser Configuration ProfilesPlaywright configures test projects to run across multiple browsers, including branded browsers and emulated mobile or tablet devices, by defining project-specific device parameters and browser channels.
  • Browser Workflow AutomationPlaywright automates browser workflows programmatically for tasks like web scraping, PDF generation, and screenshot capture without requiring a test runner.
  • Cross-Browser Automation| Executing browser-based tasks programmatically to perform web scraping, data extraction, or automated workflows across different rendering engines.
  • Browser Isolation StrategiesCreates independent, ephemeral browser sessions that maintain separate storage, cookies, and cache to ensure hermetic test execution.
  • Browser NavigationPlaywright navigates to a specific URL and waits for the page to fire the load event, including all dependent resources like scripts, stylesheets, and images.
  • JavaScript Execution BridgesPlaywright executes JavaScript code within the browser context by passing serializable data or object handles as arguments to bridge the gap between test and page environments.
  • Locator Filtering UtilitiesPlaywright filters existing locators by text content or the presence of specific child elements to narrow down selection to the exact target.
  • Frame InteractionsPlaywright accesses and interacts with nested frame elements by name or URL to perform actions within isolated document contexts.
  • Headed Browser ExecutionPlaywright executes tests with a visible browser window to observe real-time interactions between the automation script and the website under test.
  • Service Worker ManagementPlaywright maintains persistent service worker handles across automatic suspension and restart cycles during browser automation.
  • Viewport EmulatorsPlaywright overrides the browser viewport size or device scale factor to simulate different screen resolutions and high-DPI displays.
  • Label-Based SelectorsPlaywright identifies form controls by their associated label text to interact with inputs that have explicit label elements.
  • DOM SelectorsPlaywright identifies elements using XPath expressions, supporting union operators and standard document evaluation for complex DOM traversal.
  • Browser Dialog HandlersPlaywright registers listeners to accept or dismiss browser dialogs like alerts, confirms, and prompts before the triggering action occurs.
  • Placeholder LocatorsPlaywright identifies input elements using their placeholder attribute text, useful for form fields that lack explicit labels.
  • Browser Binary ManagersPlaywright manages browser binary locations, cache paths, and garbage collection policies to optimize disk usage and support hermetic installation environments.
  • Browser Permission ManagementPlaywright grants or revoke browser permissions such as notifications or geolocation for specific origins to test application access requests.
  • Full Page ScreenshotsPlaywright captures a screenshot of an entire scrollable page as if the viewport were tall enough to contain the full document content.
  • Keyboard Input SimulationsPlaywright types characters into fields character-by-character to simulate real keyboard events, including support for custom delays between keystrokes.
  • Authentication State PersistencePlaywright authenticates once in a dedicated setup project and shares the resulting browser state across all test projects to bootstrap authenticated sessions.
  • Test Failure HealingPlaywright heals failing tests by replaying steps, inspecting the UI to locate elements, and suggesting patches for broken locators or data fixes.
  • API-Based AuthenticationPlaywright performs authentication via direct API requests instead of UI interactions to accelerate the setup process for test suites.
  • Session Persistence MechanismsPlaywright saves authenticated browser state to the file system to reuse across test runs, ensuring tests start in an already-authenticated session.
  • CI Workflow AutomationsPlaywright configures automated test workflows in CI environments to execute test suites on code changes, install dependencies, and upload test reports as artifacts.
  • CI Trace DebuggingPlaywright analyzes test execution traces by inspecting individual actions and state changes to identify the root cause of failures in a visual interface.
  • Browser Binary InstallersPlaywright installs required browser binaries and system dependencies, with options for force-reinstallation or dry-run verification of system requirements.
  • Remote Execution EnvironmentsPlaywright runs a remote server inside a container to execute browser automation tasks from a separate host machine or unsupported Linux distribution.
  • Test Environment ConfigurationsPlaywright sets project-specific base URLs, timeout limits, and retry policies to run tests against different environments.
  • Test Execution ConfigurationsPlaywright configures core test execution settings including parallelization, retry policies, reporter selection, and project-specific browser environments for consistent test runs.
  • Network Response ModifiersPlaywright intercepts and modifies incoming network responses by overriding the body, headers, or status codes before delivery.
  • Request Interception UtilitiesPlaywright intercepts and modifies outgoing network requests by deleting headers, changing methods, or altering parameters before they reach the server.
  • Remote Server ConnectivitiesPlaywright connects local test suites or applications to a remote browser server using WebSocket endpoints for distributed execution.
  • HAR Network MockingPlaywright records, modifies, and replays network traffic using HTTP Archive files to simulate complex API interactions and ensure consistent test environments.
  • Browser Control ProtocolsCommunicates with browser instances via a low-level, bidirectional protocol to enable deep inspection and control of the browser engine.
  • Process-Based ParallelismOrchestrates test execution across multiple isolated OS processes to maximize CPU utilization while maintaining strict state separation.
  • Forced InteractionsPlaywright bypasses standard actionability checks for specific interactions by using a force option to perform actions regardless of element state.