accessibility.spec.ts 790 B

1234567891011121314151617181920212223
  1. import { test } from './fixtures'
  2. import { createRandomPage } from './utils'
  3. import { expect } from '@playwright/test'
  4. import AxeBuilder from '@axe-core/playwright'
  5. // TODO: more configuration is required for this test
  6. test.skip('should not have any automatically detectable accessibility issues', async ({ page }) => {
  7. try {
  8. await page.waitForSelector('.notification-clear', { timeout: 10 })
  9. page.click('.notification-clear')
  10. } catch (error) {
  11. }
  12. await createRandomPage(page)
  13. await page.waitForTimeout(2000)
  14. const accessibilityScanResults = await new AxeBuilder({ page })
  15. .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
  16. .disableRules(['meta-viewport'])
  17. .setLegacyMode()
  18. .analyze()
  19. expect(accessibilityScanResults.violations).toEqual([]);
  20. })