Skip to content
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

[INFRA] Add Cypress a11y tests to Buildkite PR test job #7354

Merged
merged 8 commits into from
Nov 15, 2023
Merged

[INFRA] Add Cypress a11y tests to Buildkite PR test job #7354

merged 8 commits into from
Nov 15, 2023

Conversation

1Copenut
Copy link
Contributor

@1Copenut 1Copenut commented Nov 9, 2023

Summary

PR adds our Cypress a11y test suite to the Buildkite test job now that tests are running in parallel. This took additional work because something changed in Chrome after release 118. The change caused a number of tests using Cypress Real Events to start failing. This was not because of the library, but most likely how I was using the custom cy.realMount() and creating a single pixel to "click into" the Cypress testing iframe. Tests were refactored to use cy.get('ELEM').focus() then proceeded to use CRE methods. All tests were verified locally in Docker using EUI's current container.

PR closes #7306.

QA

Remove or strikethrough items that do not apply to your PR.

General checklist

  • Browser QA
    • Checked for accessibility including keyboard-only and screenreader modes
  • Code quality checklist
    • Verified all tests pass in Buildkite CI
    • Added or updated jest and cypress tests
  • Release checklist

Local test run

Screenshot 2023-11-09 at 4 49 03 PM

* Fixed keyboard a11y for Card, Header, KeyPadMenu.
* Fixed keyboard a11y for BasicTable and InMemoryTable.
* Fixed keyboard a11y for Expression.
* Fixed keyboard a11y for Image.
* Fixed keyboard a11y for NotificationEvent, ResizableContainer, SearchBar.
* Fixed keyboard a11y for ErrorBoundary, FocusTrap, Range.
@1Copenut 1Copenut marked this pull request as ready for review November 10, 2023 15:22
@1Copenut 1Copenut requested a review from a team as a code owner November 10, 2023 15:22
@cee-chen
Copy link
Contributor

@tkajtoch do you mind reviewing this PR? 🙏 thank you!

@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @1Copenut

&& NODE_OPTIONS="--max-old-space-size=2048" npm run test-cypress-a11y\'',
&& yarn run test-cypress-a11y \
--node-options=--max_old_space_size=2048 \
--skip-css '", // Skipping CSS because compiling has a tendency to hang on Apple Silicon
Copy link
Contributor

Choose a reason for hiding this comment

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

(not a blocking comment, just thinking out loud) Interesting - a11y tests shouldn't need CSS, but the other Cypress tests definitely do. Why would these sets of Cypress tests have issues but the others don't? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a great question and I wish I had a better answer. I had a lot of trouble getting these to run in a local Docker container without ignoring CSS. This started after I moved to an Apple Silicon machine, so my best guess is the compile step is either very slow or running out of memory on Rosetta. Was not an issue on an older Intel box.

I'm happy to remove the --skip-css declaration if that feels warranted. It was a coin-flip call. I came down on the side of better to be able to run the tests consistently in a Docker environment that matches our CI more closely than runs on MacOS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah it totally makes sense to do if nothing else because the a11y tests don't need them. Plus eventually when we're fully on Emotion, the command goes away anyway.

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

LGTM if CI is passing! Nice work on this Trevor.

(below is not a change request, just a note to keep in mind for the future)

22 minutes is on the higher end of our CI runs - this isn't an issue now, but may be in the future as we scale/add more a11y tests. We may want to reconsider/rethink our approach to these and make sure we have specific goals in place for our a11y tests, or potentially run these on a cron instead of per PR 🤷

Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

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

Looks good to me! I like that you added --platform to docker run command, making it one step closer to being platform agnostic. Maybe one day we can officially support ARM without the emulation layer!

@1Copenut
Copy link
Contributor Author

22 minutes is on the higher end of our CI runs - this isn't an issue now, but may be in the future as we scale/add more a11y tests. We may want to reconsider/rethink our approach to these and make sure we have specific goals in place for our a11y tests, or potentially run these on a cron instead of per PR 🤷

Much agreed. There's Buildkite documentation about running jobs on a schedule, so it should be an easy port if/when the tests start taking too much time.

@1Copenut 1Copenut merged commit 209a178 into elastic:main Nov 15, 2023
1 check passed
@1Copenut 1Copenut deleted the feature/cypress-a11y-docker branch November 15, 2023 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cypress a11y tests to buildkite
5 participants