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 compat release #1

Merged
merged 39 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b84f67b
Updates for w3c compatability
justafish Sep 21, 2023
580ff48
Throw an UnknownCommand Exception if isW3C() doesn't exist
justafish Oct 3, 2023
cb196ef
Revert resizeWindow jsonwire fallback code
justafish Oct 3, 2023
66c7fe7
Run the automated tests on the latest version of selenium
justafish Oct 3, 2023
e1a0c86
Apply recommended changes and test fixes
justafish Oct 3, 2023
b54f3c4
PHPStan fixes
justafish Oct 3, 2023
89870ce
PHPStan fixes
justafish Oct 3, 2023
676ba55
Tidy up GitHub Action
justafish Oct 3, 2023
c998944
Wider W3C compatability fixes to match mink/driver-testsuite expectat…
justafish Oct 5, 2023
a1af5e4
Mount volume into selenium image
justafish Oct 5, 2023
872fec0
Mount volume into selenium image
justafish Oct 5, 2023
8ff1e02
Mount volume into selenium image
justafish Oct 5, 2023
288f50c
Mount volume into selenium image
justafish Oct 5, 2023
1659eb6
Mount volume into selenium image
justafish Oct 5, 2023
0576853
Fix TimeoutTest
justafish Oct 5, 2023
35095e4
Revert custom test changes
justafish Oct 5, 2023
84f39b3
Override max sessions for the timeout test
justafish Oct 5, 2023
9fcd973
Set SYMFONY_DEPRECATIONS_HELPER to weak
justafish Oct 5, 2023
8371ae4
Fix phpstan violations
justafish Oct 5, 2023
7c806be
Add support for Symfony 7
stof Dec 9, 2023
8b816df
Update the CI setup
stof Dec 9, 2023
109aa82
Merge pull request #375 from stof/update_ci
stof Dec 9, 2023
22b6d9d
Merge pull request #374 from stof/symfony_7
stof Dec 9, 2023
4ca4083
Update changelog for 1.7.0
stof Dec 9, 2023
cfdf890
Replace instaclick/php-webdriver with lullabot/php-webdriver
justafish Dec 13, 2023
c15694b
Remove tests for old Selenium and PHP versions
justafish Dec 13, 2023
c24b0ee
Merge branch 'master' into w3c-compat-release
justafish Dec 13, 2023
4cb7ec7
fix tests
justafish Dec 13, 2023
4e778d0
Fix tests
justafish Dec 13, 2023
260c690
Use a different selenium release
justafish Dec 13, 2023
c8a1f2a
downgrade selenium
justafish Dec 13, 2023
6c4b35c
fix moveto
justafish Dec 13, 2023
d969ff0
Add more selenium versions to the test matrix
justafish Dec 14, 2023
20876d5
Remove PHPStan exceptions
justafish Dec 14, 2023
a340a00
remove space
justafish Dec 14, 2023
9246b6c
Fix object type
justafish Dec 14, 2023
4de6863
Fix driver url
justafish Dec 14, 2023
d9ba5d5
Fix selenium version
justafish Dec 14, 2023
71326e2
Switch to release of php-webdriver
justafish Dec 14, 2023
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
33 changes: 24 additions & 9 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 All @@ -17,37 +18,47 @@ jobs:
name: Check composer.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.2'

- run: composer validate --strict --no-check-lock

static_analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.2'

- name: Install dependencies
run: composer update --ansi --no-progress --prefer-dist --no-interaction
run: |
composer update --ansi --no-progress --prefer-dist --no-interaction

- run: vendor/bin/phpstan analyze

tests:
name: Tests
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
php: [ '8.1', '8.2', '8.3' ]
# 2.53.1 - version the original package was using for tests
# 3 - last version of 3
# 4.1.2-20220227 - last known working version of 4 where the modifications to this package weren't needed
selenium: ['2.53.1', '3', '4.1.2', 'latest']
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -71,7 +82,7 @@ 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 --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 +91,11 @@ jobs:

- name: Run tests
run: |
vendor/bin/phpunit -v --coverage-clover=coverage.xml
if [ "${{ matrix.selenium }}" == "latest" ] || [ "${{ matrix.selenium }}" == "4.1.2" ]; then
./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
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
1.7.0 / 2023-02-26
1.7.0 / 2023-12-09
==================

BC break:

* `syn` JS library was upgraded from v0.0.3 to v0.15.0

New features:

* Added parameter types for all methods
* Added support for Symfony 7

Bug fixes:

* `Selenium2Driver::{keyPress, keyDown, keyUp}` methods were using numeric string input as char code. Newly an integer type must be passed.
* Fix compatibility of `execute` with Selenium 4
* `Selenium2Driver::{keyPress, keyDown, keyUp}` methods were using numeric string input as char code. Newly an integer type must be passed. Strings are not handled as strings properly, as done in other Mink drivers.
* Add proper error handling for non-started sessions

Testsuite:

* Fixed compatibility with the latest driver testsuite
* Added CI jobs for PHP 8.2 and 8.3
* Added static analysis with phpstan

1.6.0 / 2022-03-28
==================
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"php": ">=7.2",
"ext-json": "*",
"behat/mink": "^1.11@dev",
"instaclick/php-webdriver": "^1.4.14"
"lullabot/php-webdriver": "^2.0"
},
"require-dev": {
"mink/driver-testsuite": "dev-master",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^8.5.22 || ^9.5.11",
"symfony/error-handler": "^4.4 || ^5.0"
"symfony/error-handler": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},

"autoload": {
Expand Down
3 changes: 0 additions & 3 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ parameters:
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#^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\(\)\.$#'

includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
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" /> -->

<!-- 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