Gathering detailed insights and metrics for rebrowser-playwright
Gathering detailed insights and metrics for rebrowser-playwright
Gathering detailed insights and metrics for rebrowser-playwright
Gathering detailed insights and metrics for rebrowser-playwright
A drop-in replacement for playwright patched with rebrowser-patches. It allows to pass modern automation detection tests.
npm install rebrowser-playwright
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
10 Stars
5 Commits
1 Forks
1 Watching
3 Branches
1 Contributors
Updated on 23 Nov 2024
Cumulative downloads
Total Downloads
Last day
56.6%
83
Compared to previous day
Last week
32.9%
392
Compared to previous week
Last month
45%
1,447
Compared to previous month
Last year
0%
2,508
Compared to previous year
1
1
⚠️ This is the original
playwright
patched withrebrowser-patches
.🕵️ The ultimate goal is to pass all automation detection tests presented in
rebrowser-bot-detector
.🪄 It's designed to be a drop-in replacement for the original
playwright
without changing your codebase. Each major and minor version of this repo matches the original repo, patch version could differ due to changes related to the patch itself.☝️ Make sure to read: How to Access Main Context Objects from Isolated Context
🐛 Please report any issues in the
rebrowser-patches
repo.
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.
Linux | macOS | Windows | |
---|---|---|---|
Chromium 129.0.6668.29 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
WebKit 18.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Firefox 130.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Headless execution is supported for all browsers on all platforms. Check out system requirements for details.
Looking for Playwright for Python, .NET, or Java?
Playwright has its own test runner for end-to-end tests, we call it Playwright Test.
The easiest way to get started with Playwright Test is to run the init command.
1# Run from your project's root directory 2npm init playwright@latest 3# Or create a new project 4npm init playwright@latest new-project
This will create a configuration file, optionally add examples, a GitHub Action workflow and a first test example.spec.ts. You can now jump directly to writing assertions section.
Add dependency and install browsers.
1npm i -D @playwright/test 2# install supported browsers 3npx playwright install
You can optionally install only selected browsers, see install browsers for more details. Or you can install no browsers at all and use existing browser channels.
Auto-wait. Playwright waits for elements to be actionable prior to performing actions. It also has a rich set of introspection events. The combination of the two eliminates the need for artificial timeouts - a primary cause of flaky tests.
Web-first assertions. Playwright assertions are created specifically for the dynamic web. Checks are automatically retried until the necessary conditions are met.
Tracing. Configure test retry strategy, capture execution trace, videos and screenshots to eliminate flakes.
Browsers run web content belonging to different origins in different processes. Playwright is aligned with the architecture of the modern browsers and runs tests out-of-process. This makes Playwright free of the typical in-process test runner limitations.
Multiple everything. Test scenarios that span multiple tabs, multiple origins and multiple users. Create scenarios with different contexts for different users and run them against your server, all in one test.
Trusted events. Hover elements, interact with dynamic controls and produce trusted events. Playwright uses real browser input pipeline indistinguishable from the real user.
Test frames, pierce Shadow DOM. Playwright selectors pierce shadow DOM and allow entering frames seamlessly.
Browser contexts. Playwright creates a browser context for each test. Browser context is equivalent to a brand new browser profile. This delivers full test isolation with zero overhead. Creating a new browser context only takes a handful of milliseconds.
Log in once. Save the authentication state of the context and reuse it in all the tests. This bypasses repetitive log-in operations in each test, yet delivers full isolation of independent tests.
Codegen. Generate tests by recording your actions. Save them into any language.
Playwright inspector. Inspect page, generate selectors, step through the test execution, see click points and explore execution logs.
Trace Viewer. Capture all the information to investigate the test failure. Playwright trace contains test execution screencast, live DOM snapshots, action explorer, test source and many more.
Looking for Playwright for TypeScript, JavaScript, Python, .NET, or Java?
To learn how to run these Playwright Test examples, check out our getting started docs.
This code snippet navigates to Playwright homepage and saves a screenshot.
1import { test } from '@playwright/test'; 2 3test('Page Screenshot', async ({ page }) => { 4 await page.goto('https://playwright.dev/'); 5 await page.screenshot({ path: `example.png` }); 6});
This snippet emulates Mobile Safari on a device at given geolocation, navigates to maps.google.com, performs the action and takes a screenshot.
1import { test, devices } from '@playwright/test'; 2 3test.use({ 4 ...devices['iPhone 13 Pro'], 5 locale: 'en-US', 6 geolocation: { longitude: 12.492507, latitude: 41.889938 }, 7 permissions: ['geolocation'], 8}) 9 10test('Mobile and geolocation', async ({ page }) => { 11 await page.goto('https://maps.google.com'); 12 await page.getByText('Your location').click(); 13 await page.waitForRequest(/.*preview\/pwa/); 14 await page.screenshot({ path: 'colosseum-iphone.png' }); 15});
This code snippet navigates to example.com, and executes a script in the page context.
1import { test } from '@playwright/test'; 2 3test('Evaluate in browser context', async ({ page }) => { 4 await page.goto('https://www.example.com/'); 5 const dimensions = await page.evaluate(() => { 6 return { 7 width: document.documentElement.clientWidth, 8 height: document.documentElement.clientHeight, 9 deviceScaleFactor: window.devicePixelRatio 10 } 11 }); 12 console.log(dimensions); 13});
This code snippet sets up request routing for a page to log all network requests.
1import { test } from '@playwright/test'; 2 3test('Intercept network requests', async ({ page }) => { 4 // Log and continue all network requests 5 await page.route('**', route => { 6 console.log(route.request().url()); 7 route.continue(); 8 }); 9 await page.goto('http://todomvc.com'); 10});
No vulnerabilities found.
No security vulnerabilities found.