Skip to content

Try headless option and enable trace logging for geckodriver #14

Try headless option and enable trace logging for geckodriver

Try headless option and enable trace logging for geckodriver #14

Workflow file for this run

name: Selenium Testing
on:
push:
branches:
- master
- travis-github-action
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
job: [lint, firefox]
# job: [lint, firefox, edge-beta]
include:
- job: lint
INFO: "lint"
# No BROWSER variable needed for linting
# Don't test Chrome in non-mv3 codebase
- job: firefox
INFO: "Firefox"
BROWSER: "firefox"
# - job: edge-beta
# INFO: "Edge Beta"
# BROWSER: "microsoft-edge-beta"
env:
INFO: ${{ matrix.INFO }}
BROWSER: ${{ matrix.BROWSER }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Node.js for linting
if: matrix.job == 'lint'
uses: actions/setup-node@v4
with:
node-version: '18.18.0' # Minimum version for eslint: https://eslint.org/docs/latest/use/getting-started
- name: Set up Firefox
if: matrix.job == 'firefox'
uses: browser-actions/setup-firefox@v1
with:
firefox-version: 'latest'
- name: Install Gecko Driver
if: matrix.job == 'firefox'
uses: browser-actions/setup-geckodriver@latest
- name: Check that Gecko Driver and Firefox are installed
run: |
geckodriver --version
firefox --version
# - name: Install Browser Dependencies # Firefox documentation
# run: |
# sudo apt update
# # Install Xvfb (replacing xvfb in Travis services)
# sudo apt-get install -y xvfb
# # Install browsers as needed:
# if [[ "${BROWSER}" == "firefox" ]]; then
# sudo install -d -m 0755 /etc/apt/keyrings
# wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
# gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
# echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
# echo '
# Package: *
# Pin: origin packages.mozilla.org
# Pin-Priority: 1000
# ' | sudo tee /etc/apt/preferences.d/mozilla
# sudo apt-get update && sudo apt-get install firefox
# # Print the Firefox binary path
# echo "Firefox binary path:"
# which firefox
# ls -l "$(which firefox)"
# # Print the version to confirm it's installed correctly
# firefox --version
# elif [[ "${BROWSER}" == "microsoft-edge-beta" ]]; then
# curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
# sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/
# sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-beta.list'
# sudo rm microsoft.gpg
# sudo apt update
# sudo apt install microsoft-edge-beta
# fi
- name: Run Setup Script
run: ./scripts/setup_travis.sh
- name: Run Tests
run: ./scripts/run_travis.sh