-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add running voiceover on chrome and firefox (#26)
* install requested browser for voiceover * add steps to start webdriver * Update run-tester.sh * update url * add check server loop * Update run-tester.sh * Update voiceover-test.yml * try arm64 fix * Create install-geckodriver.sh * handle x86_64 * make executable * use different path strategy * clean up run tester script * no need to path or ln * snake case variables * remove token * remove curl verbose flag
- Loading branch information
1 parent
4b3983f
commit e476836
Showing
3 changed files
with
145 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,12 +40,18 @@ on: | |
- "13" | ||
- "14" | ||
default: "14" | ||
browser: | ||
description: | | ||
The browser to use for testing, "chrome" or "firefox" or "safari", default "safari" | ||
required: false | ||
type: string | ||
|
||
env: | ||
ARIA_AT_WORK_DIR: ${{ inputs.work_dir || 'tests/alert' }} | ||
ARIA_AT_CALLBACK_URL: ${{ inputs.callback_url }} | ||
ARIA_AT_STATUS_URL: ${{ inputs.status_url }} | ||
ARIA_AT_CALLBACK_HEADER: ${{ inputs.callback_header || 'x-header-param:empty' }} | ||
BROWSER: ${{ inputs.browser || 'safari' }} | ||
|
||
jobs: | ||
voiceover-test: | ||
|
@@ -72,6 +78,20 @@ jobs: | |
cache: "npm" | ||
cache-dependency-path: "**/package-lock.json" | ||
|
||
- uses: browser-actions/setup-chrome@v1 | ||
if: inputs.browser == 'chrome' | ||
with: | ||
chrome-version: stable | ||
|
||
- uses: browser-actions/setup-firefox@v1 | ||
if: inputs.browser == 'firefox' | ||
|
||
- name: Install geckodriver | ||
if: inputs.browser == 'firefox' | ||
env: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./install-geckodriver.sh | ||
|
||
- name: Setup Environment | ||
uses: guidepup/[email protected] | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
os="$(uname)" | ||
arch="$(uname -m)" | ||
api_token="$token" | ||
api_url="https://api.github.com/repos/mozilla/geckodriver/releases/latest" | ||
|
||
if [[ "$os" == "Darwin" ]]; then | ||
|
||
# Add Authorization header if a token is provided | ||
if [ -n "$api_token" ]; then | ||
auth_header="Authorization: token $api_token" | ||
else | ||
auth_header="" | ||
fi | ||
# Make the API request and extract the tag_name | ||
latest_version=$(curl -s -H "$auth_header" "$api_url" | awk -F'"' '/tag_name/{print $4}') | ||
|
||
if [ -z "$latest_version" ]; then | ||
echo "Failed to get latest version" | ||
exit 1 | ||
fi | ||
|
||
echo "Found latest version of geckodriver ${latest_version}" | ||
|
||
mkdir -p geckodriver | ||
( | ||
cd geckodriver | ||
|
||
case "$arch" in | ||
"arm64") | ||
echo "Downloading geckodriver" | ||
wget https://github.com/mozilla/geckodriver/releases/download/${latest_version}/geckodriver-${latest_version}-macos-aarch64.tar.gz | ||
|
||
tar xzf geckodriver-${latest_version}-macos-aarch64.tar.gz | ||
;; | ||
"x86_64") | ||
echo "Downloading geckodriver" | ||
wget https://github.com/mozilla/geckodriver/releases/download/${latest_version}/geckodriver-${latest_version}-macos.tar.gz | ||
tar xzf geckodriver-${latest_version}-macos.tar.gz | ||
;; | ||
*) | ||
echo "Unsupported architecture - $arch" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
chmod +x geckodriver | ||
echo "geckodriver available at ${PWD}" | ||
) | ||
echo "Running geckodriver --version" | ||
geckodriver/geckodriver --version | ||
exit 0 | ||
else | ||
echo "Unsupported OS - ${os}" | ||
exit 1 | ||
fi |
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