Skip to content

Commit

Permalink
build: remove axe checks from e2e tests (#26980)
Browse files Browse the repository at this point in the history
Removes the code for running Axe against the e2e tests since it wasn't catching many failures. Automated accessibility checks have been set up in g3 which should be a bit closer to what we're looking for during GAR.

(cherry picked from commit 22e928c)
  • Loading branch information
crisbeto committed Apr 24, 2023
1 parent 6bc8fe0 commit f3d909a
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 114 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"@angular/platform-browser-dynamic": "^16.0.0-rc.2",
"@angular/platform-server": "^16.0.0-rc.2",
"@angular/router": "^16.0.0-rc.2",
"@axe-core/webdriverjs": "^4.3.2",
"@babel/core": "^7.16.12",
"@bazel/bazelisk": "1.12.1",
"@bazel/buildifier": "6.0.1",
Expand Down
26 changes: 0 additions & 26 deletions src/e2e-app/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,6 @@ exports.config = {
defaultTimeoutInterval: 120000,
},

plugins: [
{
// Runs the axe-core accessibility checks each time the e2e page changes and
// Angular is ready.
path: require.resolve('angular_material/tools/axe-protractor'),

rules: [
// Exclude mat-menu elements because those are empty if not active.
{id: 'aria-required-children', selector: '*:not(mat-menu)'},

// Disable color contrast checks since the final colors will vary based on the theme.
{id: 'color-contrast', enabled: false},

// Don't require all content to be inside landmarks since some tests depend on the
// page layout and moving this around can break them.
{id: 'region', enabled: false},

// Don't require at least one `<h1>` since we don't have any content.
{id: 'page-has-heading-one', enabled: false},

// Axe incorrectly picks up that `aria-required` is not allowed on the MDC slide toggle.
{id: 'aria-allowed-attr', selector: '*:not(.mdc-switch)'},
],
},
],

// Since we want to use async/await we don't want to mix up with selenium's promise
// manager. In order to enforce this, we disable the promise manager.
SELENIUM_PROMISE_MANAGER: false,
Expand Down
5 changes: 1 addition & 4 deletions src/e2e-app/test_suite.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ def e2e_test_suite(name, data = [], tags = ["e2e"], deps = []):
protractor_web_test_suite(
name = name,
configuration = "//src/e2e-app:protractor.conf.js",
data = [
"//tools/axe-protractor",
"@npm//@axe-core/webdriverjs",
] + data,
data = data,
on_prepare = "//src/e2e-app:start-devserver.js",
server = "//src/e2e-app:server",
tags = tags,
Expand Down
9 changes: 0 additions & 9 deletions tools/axe-protractor/BUILD.bazel

This file was deleted.

14 changes: 0 additions & 14 deletions tools/axe-protractor/build-message.js

This file was deleted.

48 changes: 0 additions & 48 deletions tools/axe-protractor/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,6 @@
resolved "https://registry.yarnpkg.com/@assemblyscript/loader/-/loader-0.10.1.tgz#70e45678f06c72fa2e350e8553ec4a4d72b92e06"
integrity sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==

"@axe-core/webdriverjs@^4.3.2":
version "4.4.2"
resolved "https://registry.yarnpkg.com/@axe-core/webdriverjs/-/webdriverjs-4.4.2.tgz#01a5a0333f7e5d15d7a67704760a4f642fdd6101"
integrity sha512-+dkfu0lXQbIwW6sv331iQLIQ7/DLDzpuQYY5pR5WKwcGyv6/1bePc5kO7TLak2oYDwK8TFbVzZ06yiH0DvnHCQ==
dependencies:
axe-core "^4.4.1"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
Expand Down Expand Up @@ -5003,11 +4996,6 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==

axe-core@^4.4.1:
version "4.4.1"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.1.tgz#7dbdc25989298f9ad006645cd396782443757413"
integrity sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw==

[email protected]:
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
Expand Down

0 comments on commit f3d909a

Please sign in to comment.