Skip to content

Conversation

@DipperTheDan
Copy link
Contributor

@DipperTheDan DipperTheDan commented Apr 11, 2025

Proposed behaviour

  • Enable skipped accessibility tests in PW
  • Turn off the rule for no-await-in-loop in the eslint config
  • Refactor continuePressingTab and continuePressingShiftTab helpers to reduce flakiness.

Current behaviour

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

N/A

Testing instructions

While nothing needs to be tested due to the CI pipeline running the Playwright tests, because I have made amendments to the Playwright files, I will need QA approval on the work.

@DipperTheDan DipperTheDan force-pushed the FE-7119_review-skipped-pw-accessibility-tests branch from a857a20 to 8a7dbee Compare April 11, 2025 11:10
@DipperTheDan DipperTheDan force-pushed the FE-7119_review-skipped-pw-accessibility-tests branch from 8a7dbee to 3dcac7f Compare April 11, 2025 12:27
Copy link
Contributor

@nuria1110 nuria1110 left a comment

Choose a reason for hiding this comment

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

Just a couple comments but changes look good to me! Glad we can have more accessibility tests enabled.

Comment on lines +493 to +496
// We have two options here. We can either omit the colour contrast check as the mock component
// used in the test has a disabled tile select, which is causing this failure.
// Or we can remove the disabled tile select from the mock component.
test("should pass accessibility tests for MultiSelect example", async ({
Copy link
Contributor

Choose a reason for hiding this comment

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

comment: Since the disabled tile is not relevant to what is being tested here I think we could remove it from the mock component, it also helps to make sure the rest of the elements pass colour contrast too. Same with the WithCustomSpacing test.

Comment on lines +298 to 306
await page.keyboard.press(`Tab`);
}

await Promise.all(promises);
};

export const continuePressingSHIFTTAB = async (page: Page, count: number) => {
const promises = [];

for (let i = 0; i < count; i++) {
promises.push(page.keyboard.press(`Shift+Tab`));
await page.keyboard.press(`Shift+Tab`);
}

await Promise.all(promises);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: nice job bringing this in-line with the preferred (modern) approach 👍


// TODO: Skipped due to flaky focus behaviour. To review in FE-6428
test.skip("should check accessibility with header children", async ({
// This test now seems to pass.
Copy link
Contributor

Choose a reason for hiding this comment

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

question: do we need this comment?

["3s", "15s"].forEach((animationDuration) => {
// TODO: Skipped due to flaky focus behaviour. To review in FE-6428
test.skip(`should pass accessibility tests when animation time is set to ${animationDuration}`, async ({
// It looks like these are now working as expected.
Copy link
Contributor

Choose a reason for hiding this comment

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

question: same here


// Test skipped because of issue FE-5731
test.skip(`should pass accessibility tests for Menu with icon`, async ({
// Looks like this now passes.
Copy link
Contributor

Choose a reason for hiding this comment

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

question: same here


(["left", "right"] as MenuFullscreenProps["startPosition"][]).forEach(
(side) => {
// TODO: Skipped due to flaky focus behaviour. To review in FE-6428
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: remove the TODO if it's working

});

["top", "bottom", "left", "right"].forEach((tooltipPosition) => {
// TODO: Skipped due to flaky focus behaviour. To review in FE-6428
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: same here

@tomdavies73 tomdavies73 self-requested a review April 25, 2025 09:05
@nuria1110 nuria1110 marked this pull request as ready for review April 28, 2025 13:17
@nuria1110 nuria1110 requested review from a team as code owners April 28, 2025 13:17
@Parsium Parsium merged commit ac87198 into master May 1, 2025
28 checks passed
@Parsium Parsium deleted the FE-7119_review-skipped-pw-accessibility-tests branch May 1, 2025 09:31
@carbonci
Copy link
Collaborator

carbonci commented May 2, 2025

🎉 This PR is included in version 153.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants