Skip to content

Commit

Permalink
Run the automated tests on the latest version of selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
justafish committed Oct 3, 2023
1 parent cb196ef commit 66c7fe7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ on:
pull_request:
workflow_dispatch:

env:
DRIVER_URL: "http://localhost:4444/wd/hub"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

defaults:
run:
Expand Down Expand Up @@ -43,6 +44,7 @@ jobs:
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
selenium: ['2.53.1', 'latest']
fail-fast: false

steps:
Expand Down Expand Up @@ -71,16 +73,26 @@ jobs:
- name: Start Selenium
run: |
docker run --net host --name selenium --volume /dev/shm:/dev/shm --shm-size 2g selenium/standalone-firefox:2.53.1 &> ./logs/selenium.log &
docker run --net host --name selenium --volume /dev/shm:/dev/shm --shm-size 2g selenium/standalone-firefox:"${{ matrix.selenium }}" &> ./logs/selenium.log &
- name: Wait for browser & PHP to start
run: |
while ! nc -z localhost 4444 </dev/null; do echo Waiting for remote driver to start...; sleep 1; done
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
- name: Replace instaclick/php-webdriver for new selenium versions
run: |
if [ "${{ matrix.selenium }}" == "latest" ]; then
composer require lullabot/php-webdriver:dev-main
fi
- name: Run tests
run: |
vendor/bin/phpunit -v --coverage-clover=coverage.xml
if [ "${{ matrix.selenium }}" == "latest" ]; then
DRIVER_URL="http://localhost:4444" ./vendor/bin/phpunit -v --coverage-clover=coverage.xml
else
DRIVER_URL="http://localhost:4444/wd/hub" ./vendor/bin/phpunit -v --coverage-clover=coverage.xml
fi
- name: Upload coverage
uses: codecov/codecov-action@v2
Expand Down

0 comments on commit 66c7fe7

Please sign in to comment.