-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install a compatable version of chrome/chromedriver
The chromedriver library updates more frequently than the chrome distributed in ubuntu-latest, but these need to be the same version, otherwise axe-core breaks. As a workaround, try to install a version that matches whatever chrome is on the path. See also dequelabs/axe-core-npm#401 (comment)
- Loading branch information
1 parent
2b1fd7d
commit 369f453
Showing
4 changed files
with
45 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import subprocess | ||
|
||
|
||
def check_for_accessibility_issues(url): | ||
command = ["npx", "@axe-core/cli", "-q", url] | ||
def check_for_accessibility_issues(url, chromedriver_path=None): | ||
command = ["npx", "@axe-core/cli"] | ||
|
||
if chromedriver_path: | ||
command.extend(["--chromedriver-path", chromedriver_path]) | ||
|
||
command.extend( | ||
[ | ||
"-q", | ||
url, | ||
] | ||
) | ||
|
||
output = subprocess.run(command, capture_output=True, text=True) | ||
assert output.returncode == 0, output.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters