Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3C Compatability Fixes #372

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 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 All @@ -64,14 +66,21 @@ jobs:
run: |
composer update --no-interaction --prefer-dist

- name: Replace instaclick/php-webdriver with lullabot/php-webdriver for new selenium versions
run: |
if [ "${{ matrix.selenium }}" == "latest" ]; then
# @todo replace this with a release
composer require lullabot/php-webdriver:dev-main
fi

- name: Setup Mink test server
run: |
mkdir ./logs
./vendor/bin/mink-test-server &> ./logs/mink-test-server.log &

- 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 --volume $GITHUB_WORKSPACE:$GITHUB_WORKSPACE -e SE_NODE_OVERRIDE_MAX_SESSIONS=true -e SE_NODE_MAX_SESSIONS=5 --shm-size 2g selenium/standalone-firefox:${{ matrix.selenium }} &> ./logs/selenium.log &

- name: Wait for browser & PHP to start
run: |
Expand All @@ -80,7 +89,11 @@ jobs:

- 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
./vendor/bin/phpunit -v --coverage-clover=coverage.xml
fi

- name: Upload coverage
uses: codecov/codecov-action@v2
Expand Down
8 changes: 8 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ parameters:
- '#^Method Behat\\Mink\\Tests\\Driver\\Custom\\[^:]+Test(Case)?\:\:test\w*\(\) has no return type specified\.$#'
# instaclick/php-webdriver misses the @method for this magic method
- '#^Call to an undefined method WebDriver\\Session\:\:file\(\)\.$#'
# W3C compatability changes
- '#^Call to an undefined method WebDriver\\Session\:\:getWindowHandles\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session\:\:getWindowHandle\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session\:\:postActions\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session\:\:deleteActions\(\)\.$#'
- '#^Call to an undefined method WebDriver\\Session|WebDriver\\Window\\:\:postRect\(\)\.$#'
- '#^Access to undefined constant WebDriver\\Element\:\:WEB_ELEMENT_ID\.$#'
- '#^Call to an undefined method WebDriver\\Element\:\:property\(\)\.$#'

includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
Expand Down
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<php>
<var name="driver_config_factory" value="Behat\Mink\Tests\Driver\Selenium2Config::getInstance" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />

<!--server name="WEB_FIXTURES_HOST" value="http://test.mink.dev" /-->
<!-- MacOS -->
Expand All @@ -18,7 +19,7 @@
<!--<server name="WEB_FIXTURES_BROWSER" value="firefox"/>-->

<!-- where driver will connect to -->
<server name="DRIVER_URL" value="http://localhost:4444/wd/hub" />
<!-- <server name="DRIVER_URL" value="http://localhost:4444/wd/hub" /> -->

<!-- where DocumentRoot of 'Test Machine' is mounted to on 'Driver Machine' (only if these are 2 different machines) -->
<!--server name="DRIVER_MACHINE_BASE_PATH" value="" /-->
Expand Down
Loading
Loading