Run Playwright tests
Run test files written for Playwright on Retest, and know what runs, what is refused and what differs.
retest run --playwright runs test files written for Playwright, unchanged, as far as Retest's compatibility goes. Anything beyond it fails where it is used, and names what it met.
npx retest run --playwright --browser "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --base-url http://127.0.0.1:3000npx retest run --playwright tests/checkout.spec.ts --browser /usr/bin/chromium --base-url http://127.0.0.1:3000- Files end in
.spec.ts,.spec.js,.spec.mtsor.spec.mjs, or the same with.test.. With no files named, Retest takes every.spec.file under the folder. @playwright/testresolves to Retest's own@rehearsal-labs/retest/playwright. Playwright does not have to be installed.playwright.config.tsis not read. The browser, the base URL, the workers and the budgets come from the command line, or fromretest.config.ts.- The report's first line says
playwright compatibility, so nobody takes the run for Playwright's own.
What runs Link to What runs
| Area | Supported |
|---|---|
| Tests | test, test.describe, test.beforeEach, test.afterEach, test.step and the page fixture |
| Pages | page.goto, reload, goBack, goForward, title and page.keyboard.press |
| Locators | getByRole, getByLabel, getByText, getByTestId, getByPlaceholder and locator, with first, last and nth |
| Actions | fill, click, hover, press, check, uncheck and selectOption |
| Checks | toBeVisible, toBeHidden, toBeChecked, toBeEnabled, toBeDisabled, toHaveText, toContainText, toHaveCount, toHaveValue, toHaveURL and toHaveTitle, each also after .not |
| Values | toBe, toEqual, toContain, toMatch, expect.soft and expect.poll |
{ timeout } on those calls goes to Retest's own, which can shorten a budget and never lengthen it.
What is refused Link to What is refused
Everything else fails as unsupported, by name, such as "page.getByAltText is not supported yet by Retest's Playwright compatibility." Nothing is skipped or dropped.
- Options Retest does not take, such as
click({ force }),goto(url, { waitUntil })orpress(key, { delay }). test.skip,test.only,test.use, test details, a titled hook and any fixture other thanpage.page.url, which Playwright reads at once where Retest has to ask the page.selectOptionwith a bare string, a list or{ index }. Name the option with{ label }or{ value }.getByRole('row', { name }). Take the row by position withnth(), or find a cell by name.- Any locator on a page that holds an open shadow root, since Retest does not look inside one.
Where it differs Link to Where it differs
- The rules are Retest's. A test with no assertion fails, a locator that matches several elements is ambiguous, and an action is sent once.
- Budgets are Retest's: a test has 60 seconds and an action 10. Both runners give a check 5 seconds.
selectOptionchooses with the keyboard, so the page hears the keys as well asinputandchange.- Names come from Chrome's accessibility tree, not from Playwright's own reckoning.
goBackandgoForwardwith no entry that way fail instead of answeringnull.
The comparison Link to The comparison
Retest's repository runs a fixed set of Playwright tests twice: once under Playwright 1.63.0 and once under Retest, in the same Chrome. It compares them case by case.
| Cases | Count |
|---|---|
| Run by both, with the same steps and the same outcome | 38 of 44 |
| Refused by Retest by name, as declared | 6 of 44 |
Left out: sign-in state set up in playwright.config.ts | 4 |
The six refused cases find a table row by name or pass selectOption a bare string. The full table is in the compatibility report.
These counts describe that set of tests only. They say nothing about a Playwright suite of yours, so run it and read what is refused.