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

chore: Add Access Continuum to e2e tests #19140

Merged
merged 32 commits into from
Sep 18, 2024
Merged

chore: Add Access Continuum to e2e tests #19140

merged 32 commits into from
Sep 18, 2024

Conversation

Zeyber
Copy link
Contributor

@Zeyber Zeyber commented Aug 16, 2024

Closes: CXSPA-6523

Using Accessibility Continuum with E2E Testing

Overview

Accessibility Continuum is a tool that can identify accessibility issues on a given page. We are using this tool in conjunction with Cypress for identifying issues during e2e tests.

Setup (local environment)

Prerequisites

Required (download Access Continuum package)

  • Acquire an access token to download the Access Continuum package from the registry.
  • In the terminal, navigate to the cypress e2e project directory (cd projects/storefrontapp-e2e-cypress).
  • Run export CONTINUUM_REGISTRY_TOKEN="my-token" in the terminal to set the token where "my-token" should be replaced by the token you acquired.
  • Run npm install to install the Access Continuum package.

Optional (setup AMP Reports)

Note: If you do not set the key, this will not impact the test results.

  • To setup AMP reports, you will need to acquire an AMP API key.
    • If you want to setup for your personal environment, you can follow the steps here to request one.
  • After you have acquired this key, you can set it by adding AMP_API_TOKEN as an environment variable to the cypress default config (projects/storefrontapp-e2e-cypress/cypress.config.ts).
  • You should also set AMP_ASSET_ID and AMP_ORG_ID as environment variables in the same config. Steps on how to acquire these can also be found here.

Adding Access Continuum to tests

Note: You can also check projects/storefrontapp-e2e-cypress/cypress/e2e/accessibility/continuum.example-e2e.cy.ts to see how to do this.

  1. We need to enable Access Continuum at the start of our e2e test.
...

before(() => {
    cy.setUpContinuum('cypress/continuum.conf.ts');
});

...
  1. We can run a check with Access Continuum at any moment we want to test a page. This can include moments where we have opened modals, popovers, dropdowns, etc.
// Any code that has navigated our app to a given page or state.
...

// Runs the a11y test
cy.runAllAccessibilityTests()
      // Shows the results of the test in the console
      .printAccessibilityTestResults()
      // Send the results to AMP (if setup)
      .submitAccessibilityConcernsToAMP()
      // Fail the test run if a11y testing finds concerns
      .failIfAnyAccessibilityConcerns();

...

@github-actions github-actions bot marked this pull request as draft August 16, 2024 09:09
@Zeyber Zeyber marked this pull request as ready for review August 20, 2024 06:27
@Zeyber Zeyber requested a review from a team as a code owner August 20, 2024 06:27
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft August 20, 2024 06:37
@Zeyber Zeyber marked this pull request as ready for review August 20, 2024 06:42
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft August 20, 2024 07:29
@Zeyber Zeyber marked this pull request as ready for review August 20, 2024 07:29
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft August 20, 2024 08:07
@Zeyber Zeyber marked this pull request as ready for review August 20, 2024 08:08
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft August 20, 2024 12:40
@Zeyber Zeyber marked this pull request as ready for review August 20, 2024 12:41
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft August 21, 2024 09:38
@Zeyber Zeyber marked this pull request as ready for review August 21, 2024 09:43
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@Zeyber Zeyber marked this pull request as ready for review September 16, 2024 13:08
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft September 17, 2024 05:52
@Zeyber Zeyber marked this pull request as ready for review September 17, 2024 05:57
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft September 17, 2024 06:09
@Zeyber Zeyber marked this pull request as ready for review September 17, 2024 06:12
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft September 17, 2024 07:19
@Zeyber Zeyber marked this pull request as ready for review September 17, 2024 07:19
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

rmch91
rmch91 previously approved these changes Sep 18, 2024
@github-actions github-actions bot marked this pull request as draft September 18, 2024 07:11
@Zeyber Zeyber marked this pull request as ready for review September 18, 2024 07:35
Copy link
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build. 
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft September 18, 2024 08:30
@Zeyber Zeyber marked this pull request as ready for review September 18, 2024 08:30
@Zeyber Zeyber merged commit 845ccc2 into develop Sep 18, 2024
28 checks passed
@Zeyber Zeyber deleted the feature/CXSPA-6523 branch September 18, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants