From 18a07d951b6c3eaa398d7149851b6f7115ad004a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 11 Dec 2025 18:24:03 +0100 Subject: [PATCH 01/16] ci: Update markdown link check to ignore blocked urls --- .gitattributes | 1 + .github/workflows/tests.yaml | 2 +- mlc_config.json | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 mlc_config.json diff --git a/.gitattributes b/.gitattributes index 7800fad58..2fdc4ff88 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,3 +12,4 @@ /phpstan.neon export-ignore /.coveralls.yml export-ignore /logs export-ignore +/mlc_config.json export-ignore diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 870d1d0f2..06927b284 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 + - uses: tcort/github-action-markdown-link-check@v1 with: use-verbose-mode: 'yes' diff --git a/mlc_config.json b/mlc_config.json new file mode 100644 index 000000000..5d70a03e0 --- /dev/null +++ b/mlc_config.json @@ -0,0 +1,7 @@ +{ + "ignorePatterns": [ + { + "pattern": "^https://stackoverflow\\.com/questions/tagged/php\\+selenium-webdriver" + } + ] +} From a7827e372abf59d9ebbf7c480a8a6c6e41e8060e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 11 Dec 2025 18:32:38 +0100 Subject: [PATCH 02/16] style: Normalize php extensions in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bd2184262..5aab53c63 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "facebook/webdriver": "*" }, "suggest": { - "ext-SimpleXML": "For Firefox profile creation" + "ext-simplexml": "For Firefox profile creation" }, "minimum-stability": "dev", "autoload": { From 1766e85cb6e22a12635badb22088f64efcb68f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 11 Dec 2025 18:35:15 +0100 Subject: [PATCH 03/16] chore: Update to Selenium 4.38 in tests --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 06927b284..3784db7d6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -82,7 +82,7 @@ jobs: functional-tests: runs-on: ${{ matrix.os }} env: - SELENIUM_SERVER_DOWNLOAD_URL: https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.26.0/selenium-server-4.26.0.jar + SELENIUM_SERVER_DOWNLOAD_URL: https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.38.0/selenium-server-4.38.0.jar strategy: fail-fast: false From f37e67d3c743af97da3eeba5afadcdd2bc209818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 11 Dec 2025 18:51:25 +0100 Subject: [PATCH 04/16] chore: Update args to properly set window size for new headless chrome See https://github.com/SeleniumHQ/selenium/issues/15827 https://chromium.googlesource.com/chromium/src/+/main/components/headless/screen_info/README.md --- tests/functional/WebDriverTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/WebDriverTestCase.php b/tests/functional/WebDriverTestCase.php index 4d7088d01..d7e729825 100644 --- a/tests/functional/WebDriverTestCase.php +++ b/tests/functional/WebDriverTestCase.php @@ -49,7 +49,7 @@ protected function setUp(): void $chromeOptions = new ChromeOptions(); $chromeOptions->addArguments([ - '--window-size=1024,768', + '--screen-info={1280x720}', '--no-sandbox', // workaround for https://github.com/SeleniumHQ/selenium/issues/4961 '--force-color-profile=srgb', '--disable-search-engine-choice-screen', From 487886747568132c625ae2f270a3e4606bb659f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 11 Dec 2025 18:59:18 +0100 Subject: [PATCH 05/16] chore: Remove new flag from headless chrome, as it is already default since Chromedriver 132 --- tests/functional/Chrome/ChromeDriverTest.php | 2 +- tests/functional/WebDriverTestCase.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Chrome/ChromeDriverTest.php b/tests/functional/Chrome/ChromeDriverTest.php index bdabb7f9e..407b65bd8 100644 --- a/tests/functional/Chrome/ChromeDriverTest.php +++ b/tests/functional/Chrome/ChromeDriverTest.php @@ -87,7 +87,7 @@ private function startChromeDriver($w3cDialect = true): void // Add --no-sandbox as a workaround for Chrome crashing: https://github.com/SeleniumHQ/selenium/issues/4961 $chromeOptions = new ChromeOptions(); - $chromeOptions->addArguments(['--no-sandbox', '--headless=new', '--disable-search-engine-choice-screen']); + $chromeOptions->addArguments(['--no-sandbox', '--headless', '--disable-search-engine-choice-screen']); $chromeOptions->setExperimentalOption('w3c', $w3cDialect); $desiredCapabilities = DesiredCapabilities::chrome(); $desiredCapabilities->setCapability(ChromeOptions::CAPABILITY, $chromeOptions); diff --git a/tests/functional/WebDriverTestCase.php b/tests/functional/WebDriverTestCase.php index d7e729825..e6b97e1a9 100644 --- a/tests/functional/WebDriverTestCase.php +++ b/tests/functional/WebDriverTestCase.php @@ -56,7 +56,7 @@ protected function setUp(): void ]); if (!$disableHeadless) { - $chromeOptions->addArguments(['--headless=new']); + $chromeOptions->addArguments(['--headless']); } if (!static::isW3cProtocolBuild()) { From 61a9e9dc75b3ec3988e0b759dc96cf703716d7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 11 Dec 2025 19:23:14 +0100 Subject: [PATCH 06/16] test: Skip fullscren command test broken in Safari --- tests/functional/WebDriverWindowTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/WebDriverWindowTest.php b/tests/functional/WebDriverWindowTest.php index 93c441748..219126a7e 100644 --- a/tests/functional/WebDriverWindowTest.php +++ b/tests/functional/WebDriverWindowTest.php @@ -50,6 +50,7 @@ public function testShouldMaximizeWindow(): void /** * @group exclude-edge + * @group exclude-safari * @group exclude-saucelabs */ public function testShouldFullscreenWindow(): void From b51cbcb1f9531f60e7cc972decb56f1fdb265623 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 20:00:56 +0000 Subject: [PATCH 07/16] Bump actions/checkout from 4 to 6 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/docs-lint.yml | 2 +- .github/workflows/docs-publish.yml | 2 +- .github/workflows/sauce-labs.yaml | 2 +- .github/workflows/tests.yaml | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs-lint.yml b/.github/workflows/docs-lint.yml index fd1c41b4f..42baa0000 100644 --- a/.github/workflows/docs-lint.yml +++ b/.github/workflows/docs-lint.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 287c1a75f..d0da12f8b 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 ssh-key: ${{ secrets.SSH_KEY_DEPLOY }} diff --git a/.github/workflows/sauce-labs.yaml b/.github/workflows/sauce-labs.yaml index 802f4ed8d..a90e17c90 100644 --- a/.github/workflows/sauce-labs.yaml +++ b/.github/workflows/sauce-labs.yaml @@ -29,7 +29,7 @@ jobs: name: ${{ matrix.name }} (${{ matrix.tunnel-id }}) steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3784db7d6..3b0056b33 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: name: "Code style and static analysis" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -35,7 +35,7 @@ jobs: name: "Markdown link check" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: tcort/github-action-markdown-link-check@v1 with: use-verbose-mode: 'yes' @@ -52,7 +52,7 @@ jobs: - { php-version: '7.3', dependencies: '--prefer-lowest' } steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -99,7 +99,7 @@ jobs: name: "Functional tests (${{ matrix.browser }}, Selenium server: ${{ matrix.selenium-server }}, W3C: ${{ matrix.w3c }})" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 From c5427c19fef20f49b041c52649d27dbff0549cc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 20:34:15 +0000 Subject: [PATCH 08/16] Bump actions/github-script from 7 to 8 Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/coveralls-workaround.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coveralls-workaround.yaml b/.github/workflows/coveralls-workaround.yaml index 5ca45b1fe..d6044861d 100644 --- a/.github/workflows/coveralls-workaround.yaml +++ b/.github/workflows/coveralls-workaround.yaml @@ -21,7 +21,7 @@ jobs: steps: # see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ - name: 'Download artifact' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ From d784f95f00a8abc1f4caad4257bac54b7d508664 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 04:10:59 +0000 Subject: [PATCH 09/16] chore(deps): bump actions/upload-artifact from 4 to 6 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3b0056b33..598264585 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -208,7 +208,7 @@ jobs: run: | mkdir -p ./data echo ${{ github.run_id }} > ./data/run_id - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: name: data path: data/ From 6a011bb4813db85173122fd5f43b26dd39a61eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Mon, 15 Dec 2025 16:22:50 +0100 Subject: [PATCH 10/16] chore(deps): bump saucelabs/sauce-connect-action from 2 to 3, upgrade saucelabs platform versions --- .github/workflows/sauce-labs.yaml | 16 +++++++++------- tests/functional/WebDriverTestCase.php | 16 ++++++++-------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/sauce-labs.yaml b/.github/workflows/sauce-labs.yaml index a90e17c90..9ef25fbc7 100644 --- a/.github/workflows/sauce-labs.yaml +++ b/.github/workflows/sauce-labs.yaml @@ -23,11 +23,11 @@ jobs: w3c: [true] include: # Chrome 74 is the last version which doesn't use W3C WebDriver by default and rather use OSS protocol - - { name: "Chrome 74, OSS protocol", BROWSER_NAME: "chrome", VERSION: "74.0", PLATFORM: "Windows 10", w3c: false, tunnel-id: "gh-1" } - - { name: "Chrome latest, W3C protocol", BROWSER_NAME: "chrome", VERSION: "latest", PLATFORM: "Windows 10", tunnel-id: "gh-2" } - - { name: "Edge latest, W3C protocol", BROWSER_NAME: "MicrosoftEdge", VERSION: "latest", PLATFORM: "Windows 10", tunnel-id: "gh-3" } + - { name: "Chrome 74, OSS protocol", BROWSER_NAME: "chrome", VERSION: "74.0", PLATFORM: "Windows 11", w3c: false, tunnel-name: "gh-1-chrome-oss-legacy" } + - { name: "Chrome latest, W3C protocol", BROWSER_NAME: "chrome", VERSION: "latest", PLATFORM: "Windows 11", tunnel-name: "gh-2-chrome-w3c" } + - { name: "Edge latest, W3C protocol", BROWSER_NAME: "MicrosoftEdge", VERSION: "latest", PLATFORM: "Windows 11", tunnel-name: "gh-3-MicrosoftEdge" } - name: ${{ matrix.name }} (${{ matrix.tunnel-id }}) + name: ${{ matrix.name }} (${{ matrix.tunnel-name }}) steps: - uses: actions/checkout@v6 @@ -46,11 +46,13 @@ jobs: php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./logs/php-server.log & - name: Start Sauce Connect - uses: saucelabs/sauce-connect-action@v2 + uses: saucelabs/sauce-connect-action@v3 with: username: ${{ secrets.SAUCE_USERNAME }} accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} - tunnelIdentifier: ${{ matrix.tunnel-id }} + tunnelName: ${{ matrix.tunnel-name }} + proxyLocalhost: allow + region: 'us-west-1' - name: Run tests env: @@ -58,7 +60,7 @@ jobs: VERSION: ${{ matrix.VERSION }} PLATFORM: ${{ matrix.PLATFORM }} DISABLE_W3C_PROTOCOL: "${{ matrix.w3c && '0' || '1' }}" - SAUCE_TUNNEL_IDENTIFIER: ${{ matrix.tunnel-id }} + SAUCE_TUNNEL_NAME: ${{ matrix.tunnel-name }} run: | if [ -n "$SAUCELABS" ]; then EXCLUDE_GROUP+="exclude-saucelabs,"; fi if [ "$BROWSER_NAME" = "MicrosoftEdge" ]; then EXCLUDE_GROUP+="exclude-edge,"; fi diff --git a/tests/functional/WebDriverTestCase.php b/tests/functional/WebDriverTestCase.php index e6b97e1a9..db0fd8b0f 100644 --- a/tests/functional/WebDriverTestCase.php +++ b/tests/functional/WebDriverTestCase.php @@ -198,14 +198,14 @@ protected function setUpSauceLabs(): void if ($ciDetector->isCiDetected()) { $ci = $ciDetector->detect(); if (!empty($ci->getBuildNumber())) { - // SAUCE_TUNNEL_IDENTIFIER appended as a workaround for GH actions not having environment value + // SAUCE_TUNNEL_NAME appended as a workaround for GH actions not having environment value // to distinguish runs of the matrix - $build = $ci->getBuildNumber() . '.' . getenv('SAUCE_TUNNEL_IDENTIFIER'); + $build = $ci->getBuildNumber() . '.' . getenv('SAUCE_TUNNEL_NAME'); } } - if (getenv('SAUCE_TUNNEL_IDENTIFIER')) { - $tunnelIdentifier = getenv('SAUCE_TUNNEL_IDENTIFIER'); + if (getenv('SAUCE_TUNNEL_NAME')) { + $tunnelName = getenv('SAUCE_TUNNEL_NAME'); } if (static::isW3cProtocolBuild()) { @@ -216,16 +216,16 @@ protected function setUpSauceLabs(): void if (isset($build)) { $sauceOptions['build'] = $build; } - if (isset($tunnelIdentifier)) { - $sauceOptions['tunnelIdentifier'] = $tunnelIdentifier; + if (isset($tunnelName)) { + $sauceOptions['tunnelName'] = $tunnelName; } $this->desiredCapabilities->setCapability('sauce:options', (object) $sauceOptions); } else { $this->desiredCapabilities->setCapability('name', $name); $this->desiredCapabilities->setCapability('tags', $tags); - if (isset($tunnelIdentifier)) { - $this->desiredCapabilities->setCapability('tunnel-identifier', $tunnelIdentifier); + if (isset($tunnelName)) { + $this->desiredCapabilities->setCapability('tunnel-identifier', $tunnelName); } if (isset($build)) { $this->desiredCapabilities->setCapability('build', $build); From f68a1c9c2b823deb44c027cc4e5b3ad23a94e58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Tue, 16 Dec 2025 13:13:23 +0100 Subject: [PATCH 11/16] ci: Reenable unintentionally skipped saucelabs test --- .github/workflows/sauce-labs.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sauce-labs.yaml b/.github/workflows/sauce-labs.yaml index 9ef25fbc7..812fbfe25 100644 --- a/.github/workflows/sauce-labs.yaml +++ b/.github/workflows/sauce-labs.yaml @@ -20,12 +20,11 @@ jobs: strategy: fail-fast: false matrix: - w3c: [true] include: # Chrome 74 is the last version which doesn't use W3C WebDriver by default and rather use OSS protocol - { name: "Chrome 74, OSS protocol", BROWSER_NAME: "chrome", VERSION: "74.0", PLATFORM: "Windows 11", w3c: false, tunnel-name: "gh-1-chrome-oss-legacy" } - - { name: "Chrome latest, W3C protocol", BROWSER_NAME: "chrome", VERSION: "latest", PLATFORM: "Windows 11", tunnel-name: "gh-2-chrome-w3c" } - - { name: "Edge latest, W3C protocol", BROWSER_NAME: "MicrosoftEdge", VERSION: "latest", PLATFORM: "Windows 11", tunnel-name: "gh-3-MicrosoftEdge" } + - { name: "Chrome latest, W3C protocol", BROWSER_NAME: "chrome", VERSION: "latest", PLATFORM: "Windows 11", w3c: true, tunnel-name: "gh-2-chrome-w3c" } + - { name: "Edge latest, W3C protocol", BROWSER_NAME: "MicrosoftEdge", VERSION: "latest", PLATFORM: "Windows 11", w3c: true, tunnel-name: "gh-3-MicrosoftEdge" } name: ${{ matrix.name }} (${{ matrix.tunnel-name }}) steps: From d32a252c07586021a54c486d297241a92a406137 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Mon, 8 Dec 2025 09:14:20 +0100 Subject: [PATCH 12/16] ci: add tests for PHP 8.5 --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 598264585..d215e92ce 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -46,7 +46,7 @@ jobs: strategy: matrix: - php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] dependencies: [''] include: - { php-version: '7.3', dependencies: '--prefer-lowest' } From 0e5cbf07609d3ad441b90e6358ef6f7daa5f94e8 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 15 Dec 2025 16:01:18 +0100 Subject: [PATCH 13/16] chore(deps): Allow Symfony 8 --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5aab53c63..f44663100 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "ext-json": "*", "ext-zip": "*", "symfony/polyfill-mbstring": "^1.12", - "symfony/process": "^5.0 || ^6.0 || ^7.0" + "symfony/process": "^5.0 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.20.0", @@ -27,7 +27,7 @@ "php-parallel-lint/php-parallel-lint": "^1.2", "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.5", - "symfony/var-dumper": "^5.0 || ^6.0 || ^7.0" + "symfony/var-dumper": "^5.0 || ^6.0 || ^7.0 || ^8.0" }, "replace": { "facebook/webdriver": "*" @@ -36,6 +36,7 @@ "ext-simplexml": "For Firefox profile creation" }, "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "Facebook\\WebDriver\\": "lib/" From c65b9fc07713641e79c61e81838b3119dc22b7dd Mon Sep 17 00:00:00 2001 From: Ezra Date: Tue, 15 Jul 2025 17:03:54 +1200 Subject: [PATCH 14/16] Fix incorrect link to driver capabilities docs --- lib/Chrome/ChromeOptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Chrome/ChromeOptions.php b/lib/Chrome/ChromeOptions.php index 2e2f6d2c2..daea44c67 100644 --- a/lib/Chrome/ChromeOptions.php +++ b/lib/Chrome/ChromeOptions.php @@ -9,7 +9,7 @@ /** * The class manages the capabilities in ChromeDriver. * - * @see https://sites.google.com/a/chromium.org/chromedriver/capabilities + * @see https://sites.google.com/chromium.org/driver/capabilities */ class ChromeOptions implements JsonSerializable { From e5bf60f7a42c65a86fbfa3e2830fe99055540337 Mon Sep 17 00:00:00 2001 From: Jose' Pedro Saraiva Date: Mon, 2 Jun 2025 11:29:22 +0200 Subject: [PATCH 15/16] Fix file upload endpoint for selenium 4.x --- lib/Remote/HttpCommandExecutor.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Remote/HttpCommandExecutor.php b/lib/Remote/HttpCommandExecutor.php index 96b0ccc70..3e3ef1719 100644 --- a/lib/Remote/HttpCommandExecutor.php +++ b/lib/Remote/HttpCommandExecutor.php @@ -175,6 +175,8 @@ class HttpCommandExecutor implements WebDriverCommandExecutor DriverCommand::SET_TIMEOUT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts'], DriverCommand::SET_WINDOW_SIZE => ['method' => 'POST', 'url' => '/session/:sessionId/window/rect'], DriverCommand::SET_WINDOW_POSITION => ['method' => 'POST', 'url' => '/session/:sessionId/window/rect'], + // Selenium extension of W3C protocol + DriverCommand::UPLOAD_FILE => ['method' => 'POST', 'url' => '/session/:sessionId/se/file'], ]; /** * @var string From a7f16c101fd9c85106ddfb0b73c161979e75140b Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Wed, 17 Dec 2025 14:10:05 +0100 Subject: [PATCH 16/16] Clarify and fix timeout value type (#1120) * Clarify and fix timeout value type --- lib/WebDriverTimeouts.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/WebDriverTimeouts.php b/lib/WebDriverTimeouts.php index add6a0900..73a5cddf8 100644 --- a/lib/WebDriverTimeouts.php +++ b/lib/WebDriverTimeouts.php @@ -28,7 +28,7 @@ public function __construct(ExecuteMethod $executor, $isW3cCompliant = false) /** * Specify the amount of time the driver should wait when searching for an element if it is not immediately present. * - * @param int $seconds Wait time in second. + * @param null|int|float $seconds Wait time in seconds. * @return WebDriverTimeouts The current instance. */ public function implicitlyWait($seconds) @@ -36,15 +36,18 @@ public function implicitlyWait($seconds) if ($this->isW3cCompliant) { $this->executor->execute( DriverCommand::IMPLICITLY_WAIT, - ['implicit' => $seconds * 1000] + ['implicit' => $seconds === null ? null : floor($seconds * 1000)] ); return $this; } + if ($seconds === null) { + throw new \InvalidArgumentException('JsonWire Protocol implicit-wait-timeout value cannot be null'); + } $this->executor->execute( DriverCommand::IMPLICITLY_WAIT, - ['ms' => $seconds * 1000] + ['ms' => floor($seconds * 1000)] ); return $this; @@ -53,7 +56,7 @@ public function implicitlyWait($seconds) /** * Set the amount of time to wait for an asynchronous script to finish execution before throwing an error. * - * @param int $seconds Wait time in second. + * @param null|int|float $seconds Wait time in seconds. * @return WebDriverTimeouts The current instance. */ public function setScriptTimeout($seconds) @@ -61,15 +64,18 @@ public function setScriptTimeout($seconds) if ($this->isW3cCompliant) { $this->executor->execute( DriverCommand::SET_SCRIPT_TIMEOUT, - ['script' => $seconds * 1000] + ['script' => $seconds === null ? null : floor($seconds * 1000)] ); return $this; } + if ($seconds === null) { + throw new \InvalidArgumentException('JsonWire Protocol script-timeout value cannot be null'); + } $this->executor->execute( DriverCommand::SET_SCRIPT_TIMEOUT, - ['ms' => $seconds * 1000] + ['ms' => floor($seconds * 1000)] ); return $this; @@ -78,7 +84,7 @@ public function setScriptTimeout($seconds) /** * Set the amount of time to wait for a page load to complete before throwing an error. * - * @param int $seconds Wait time in second. + * @param null|int|float $seconds Wait time in seconds. * @return WebDriverTimeouts The current instance. */ public function pageLoadTimeout($seconds) @@ -86,15 +92,18 @@ public function pageLoadTimeout($seconds) if ($this->isW3cCompliant) { $this->executor->execute( DriverCommand::SET_SCRIPT_TIMEOUT, - ['pageLoad' => $seconds * 1000] + ['pageLoad' => $seconds === null ? null : floor($seconds * 1000)] ); return $this; } + if ($seconds === null) { + throw new \InvalidArgumentException('JsonWire Protocol page-load-timeout value cannot be null'); + } $this->executor->execute(DriverCommand::SET_TIMEOUT, [ 'type' => 'page load', - 'ms' => $seconds * 1000, + 'ms' => floor($seconds * 1000), ]); return $this;