Live Webinar: QA in 2027: How AI Will Transform Testing and Quality Leadership Register Now.
Turn your manual testers into automation experts!Request a Demo

testRigor Playwright Plugin

Weekly Newsletter
Receive weekly testRigor newsletters packed with insights on test automation, codeless testing, and the latest advancements in AI.
testRigor Playwright Plugin is an open source npm package, it extends the Playwright driver to allow executing native testRigor commands in Playwright tests and utilize testRigor self healing for those tests.
GitHub link
npm package link

Installation

Requires Node.js >= 18. playwright is a peer dependency, so install it alongside the plugin:
npm i @testrigor/playwright-plugin
npx playwright install chromium
In order to use the driver, you must generate a PAT token and provide it when initializing testRigor driver. The token can be generated by following these steps.

Quick start

import { TestRigor } from '@testrigor/playwright-plugin';

const driver = await TestRigor.createBrowserPage(process.env.TESTRIGOR_API_TOKEN!);
driver.setTestContext('my_test');

await driver.get('https://example.com');
const button = await driver.findElement(TestRigor.byUserDescription('Sign in'));
await button.click();

await driver.quit();
Attach to an existing Playwright page:
import { TestRigor } from '@testrigor/playwright-plugin';

const driver = TestRigor.extendPage(page, apiToken);
driver.setTestContext('my_test');

Fluent commands

import { TestRigor } from '@testrigor/playwright-plugin';

const { actions, validations, queries } = TestRigor;

await actions(driver).openUrl('https://example.com').click('Empty Page').execute();
await validations(driver).checkPageContains('expected text').execute();
const value = await queries(driver).grabValue('Some field');
Privacy Overview
This site utilizes cookies to enhance your browsing experience. Among these, essential cookies are stored on your browser as they are necessary for ...
Read more
Strictly Necessary CookiesAlways Enabled
Essential cookies are crucial for the proper functioning and security of the website.
Non-NecessaryEnabled
Cookies that are not essential for the website's functionality but are employed to gather additional data. You can choose to opt out by using this toggle switch. These cookies gather data for analytics and performance tracking purposes.