playwright-aria
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Playwright Aria

Exposes the ByRole functions from Testing Library for Playwright.

Currently supports

  • role
  • name by regex

Get started

  • Install the package: npm i -D playwright-aria
  • Follow the files in the test directory for examples on how to integrate. Roughly it's:
    • import the package: import createAriaEngine from 'playwright-aria';
    • register the engine before using the aria selector: await selectors.register('aria', createAriaEngine, { contentScript: false });
    • use it in a test: await expect(page.locator('aria=button(/test button/)')).toBeVisible();

Examples using the aria selector

  • locate all elements with the role "button"
    • page.locator('aria=button')
  • locate the element with the role "button" and the name matches the regex /test button/i (all regex are case insensitive for now)
    • page.locator('aria=button(/test button/)')

Readme

Keywords

none

Package Sidebar

Install

npm i playwright-aria

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

470 kB

Total Files

12

Last publish

Collaborators

  • johnwana