0.0.2 • Published 2 years ago

playwright-aria v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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/)')