Skip to content

FIX: Implement atexit to stop browser #315

FIX: Implement atexit to stop browser

FIX: Implement atexit to stop browser #315

Workflow file for this run

name: Tests
on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
# Don't abort if a matrix combination fails
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10"]
browser: ["firefox", "chrome", "edge", "undetected_chrome"]
headless: [true]
exclude:
# Can't install firefox using setup-firefox on Windows
# See the issues below
# * https://github.com/browser-actions/setup-firefox/issues/252
# * https://github.com/abhi1693/setup-browser/issues/8
- os: windows-latest
browser: "firefox"
steps:
- uses: actions/checkout@v2
- name: Install libgl1
if: runner.os == 'Linux'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libgl1-mesa-dev libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2 -y
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Test Dependencies
run: |
pip install -r test-requirements.txt
- name: Install Package
run: |
pip install .
- uses: browser-actions/setup-chrome@latest
if: matrix.browser == 'chrome' || matrix.browser == 'undetected_chrome'
with:
chrome-version: stable
- uses: browser-actions/setup-firefox@latest
if: matrix.browser == 'firefox'
- uses: browser-actions/setup-edge@latest
if: matrix.browser == 'edge'
- name: Run Tests in ${{ matrix.browser }}
if: matrix.browser == 'edge' || matrix.browser == 'chrome' || matrix.browser == 'firefox'
run: |
pytest -n 2 -v -vrxs --headless=${{ matrix.headless }} --browser=${{ matrix.browser }}
- name: Run Tests in ${{ matrix.browser }}
if: matrix.browser == 'undetected_chrome'
run: |
pytest -v -vrxs --headless=${{ matrix.headless }} --browser=${{ matrix.browser }}