Skip to content

Commit

Permalink
ci(travis): try pa11y-ci config with a path to Chrome executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristinita committed Jan 23, 2024
1 parent 2b53528 commit afb1321
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .pa11yci-linux.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
[NOTE] Configuration Pa11y CI file for Linux completely repeats the contents of “.pa11yci.js”
except that it contains the “chromeLaunchConfig” option.
*/

module.exports = {
defaults: {
/* [REQUIRED] Path to Chrome executable file on Linux:
https://github.com/pa11y/pa11y-ci#pa11y-ci-3-and-ubuntu
https://github.com/pa11y/pa11y-ci/issues/198#issuecomment-1418343240 */
chromeLaunchConfig: {
"executablePath": "/usr/bin/google-chrome"
},
hideElements: [
"code",
"#___gcse_0", ".gstl_50",
".skiptranslate", "#goog-gt-votingForm", "#goog-gt-votingInputSrcLang",
"#goog-gt-votingInputTrgLang", "#goog-gt-votingInputSrcText", "#goog-gt-votingInputTrgText",
"#goog-gt-votingInputVote", "#goog-gt-votingHiddenPane"
]
}
};
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ python: 3.12
addons:
chrome: stable

install:
- nvm install node
- npm install --global fkill-cli http-server pa11y-ci
- pip install linkchecker

cache:
directories:
- node_modules
Expand All @@ -22,11 +27,6 @@ cache:
# - .venv/Lib/site-packages
# - .venv/Scripts

install:
- nvm install node
- npm install --global fkill-cli http-server pa11y-ci
- pip install linkchecker

before_script:
- pa11y-ci --version
- linkchecker --version
Expand All @@ -35,7 +35,7 @@ before_script:
# - nohup http-server --port 4147 &

script:
- pa11y-ci http://localhost:4147/KiraTestedHTML.html
- pa11y-ci --config .pa11yci-linux.js http://localhost:4147/KiraTestedHTML.html
- linkchecker http://localhost:4147/KiraTestedHTML.html
- fkill :4147 --force --verbose
# - linkchecker http://localhost:4147/KiraTestedHTML.html

0 comments on commit afb1321

Please sign in to comment.