pestphp / pestphp/pest

[Feat]: Add ability to ignore known issues with `assertNoAccessibilityIssues()`

Open
#1,636 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Description

Problem

Right now we have a website that requires the page be refreshed via meta after 2hrs to force a log out. This is a client requirement. The issue is that playwright sees this as a CRITICIAL issue so there's no level we can set to ignore this.

Selector: meta[http-equiv="refresh"]
  HTML: <meta http-equiv="refresh" content="7201">
  any:
    - <meta> tag forces timed refresh of page (less than 20 hours)

https://dequeuniversity.com/rules/axe/4.10/meta-refresh?application=axeAPI

Solution

Allow a user to be able to ignore specific elements as per the docs in Playwright

visit('/')->assertNoAccessibilityIssues(2, [
  'excludes' => ['[data-test-exclude]']
])

// or

visit('/')->assertNoAccessibilityIssues(excludes: '[data-test-exclude]') // Arr::wrap() in the method.
<meta http-equiv="refresh" content="7201" data-test-exclude>

This can then be expanded to inject other configs into the accessibility.

I'm willing to open a PR for this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating assertNoAccessibilityIssues() and read the Playwright accessibility-testing guidance linked in the issue, focusing on its known-issues handling. Trace how the method invokes accessibility checks, then add coverage for the documented excludes examples; done means matching elements can be excluded while other accessibility issues remain reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, playwright
Domain
accessibility, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.