Skip to content

Fix e2e auth logic + add namespace a11y playwright tests #3144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vyncent-t
Copy link
Collaborator

@vyncent-t vyncent-t commented Apr 18, 2025

Description

This PR improves accessibility testing coverage and reliability of Playwright E2E tests in the project.

Note: this also fixes some e2e test failures for my other branches, once this is merged in I will drop the duplicates in the other branches.

Accessibility Enhancements

  • Adds @axe-core/playwright integration to the Namespaces Playwright test to perform automated A11Y checks.
  • Introduces accessibility assertions to verify that no critical violations occur before and after creating a namespace.
  • Fixes an issue detected by these tests: the "Create" button lacked an accessible label. This was resolved by adding an aria-label to ensure compliance with screen reader standards.

Navigation & Auth Logic Improvements

  • Updates the navigation and authentication logic used in our Playwright E2E test setup.
    (Previously, navigation during multi-cluster testing was unreliable and prone to hanging or timing out due to race conditions and cluster token loading delays.)
  • The logic has been refactored to work consistently in both CI and local testing environments, with better handling of cluster contexts and token usage.

Notes

  • No issue was filed for this work — these improvements were identified during test development.
  • More accessibility and stability improvements are planned in follow-up PRs to expand coverage across additional areas of the UI.

@vyncent-t vyncent-t added a11y Accessibility related issues e2e-tests End to end tests labels Apr 18, 2025
@vyncent-t vyncent-t self-assigned this Apr 18, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vyncent-t
Once this PR has been reviewed and has the lgtm label, please assign illume for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 18, 2025
@k8s-ci-robot k8s-ci-robot requested review from skoeva and yolossn April 18, 2025 18:09
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 18, 2025
@vyncent-t vyncent-t force-pushed the namespace-a11y-playwright-test branch from cb5bcc1 to 3972d6b Compare April 18, 2025 18:29
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 18, 2025
@vyncent-t vyncent-t force-pushed the namespace-a11y-playwright-test branch 2 times, most recently from 96d736c to f3a977d Compare April 22, 2025 19:47
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 22, 2025
@vyncent-t vyncent-t force-pushed the namespace-a11y-playwright-test branch from f3a977d to 7303bd1 Compare April 22, 2025 19:49
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 22, 2025
@vyncent-t vyncent-t force-pushed the namespace-a11y-playwright-test branch from 7303bd1 to 89d528a Compare April 22, 2025 19:55
@vyncent-t vyncent-t marked this pull request as ready for review April 22, 2025 20:19
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2025
@k8s-ci-robot k8s-ci-robot requested review from ashu8912 and sniok April 22, 2025 20:19
@@ -36,6 +36,7 @@ export function CreateResourceButton(props: CreateResourceButtonProps) {
errorMessage={errorMessage}
onEditorChanged={() => setErrorMessage('')}
title={t('translation|Create {{ name }}', { name })}
aria-label={t('translation|Create resource button')}
Copy link
Collaborator

@illume illume Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This should be fixed inside EditorDialog to use the title. Because EditorDialog is used in a number of other places, and it has different states to consider where the label should go.
  • Using the same name as the title would be better, because it's more correct and we already have translations for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

I just requested one change to the aria-label to use the existing title translation.

@vyncent-t vyncent-t force-pushed the namespace-a11y-playwright-test branch from 89d528a to 93e7825 Compare April 23, 2025 14:08
since we now use a multi cluster structure to run our tests,
the cluster navigation step must be its own full nav step, different from navigateToPage, if it is tied to an auth step.

Signed-off-by: Vincent T <[email protected]>
@vyncent-t vyncent-t force-pushed the namespace-a11y-playwright-test branch from 93e7825 to 0161e01 Compare April 23, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility related issues cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. e2e-tests End to end tests size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants