From 1abf48e73564b917efff08eae85b9aee83f17ade Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 17 Jul 2024 10:32:27 +0100 Subject: [PATCH 1/4] Remove DRIVER_URL setting --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5318b1db..9cff2ece 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -91,11 +91,7 @@ jobs: - name: Run tests run: | - 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 + ./vendor/bin/phpunit -v --coverage-clover=coverage.xml - name: Upload coverage uses: codecov/codecov-action@v2 From 2432456cdab92f3efe35cf64eb59f1fdb9966822 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 17 Jul 2024 10:34:36 +0100 Subject: [PATCH 2/4] Drop selenium 2 and 3 testing --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9cff2ece..f863f93b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,10 +50,8 @@ jobs: strategy: matrix: 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'] + selenium: ['4.1.2', 'latest'] fail-fast: false steps: From 6ec65017f2f6c661b630de5c9473dd8839787345 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 17 Jul 2024 16:06:49 +0100 Subject: [PATCH 3/4] Close windows on reset --- src/Selenium2Driver.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index 058af02c..3fcfe28d 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -422,6 +422,18 @@ public function stop() public function reset() { + $windows = $this->getWindowNames(); + // Remove the main window from the list of windows. + array_shift($windows); + + foreach ($windows as $name) { + $this->switchToWindow($name); + $this->getWebDriverSession()->window()->close(); + } + + // Ensure the main window is active. + $this->switchToWindow(); + $this->getWebDriverSession()->deleteAllCookies(); } From 64b2b447f8fa8341f0483ffbb77e49cded45f7da Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 17 Jul 2024 16:26:24 +0100 Subject: [PATCH 4/4] Bump minimum webdriver version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 172f97ef..9d2e51b8 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "php": ">=7.2", "ext-json": "*", "behat/mink": "^1.11@dev", - "lullabot/php-webdriver": "^2.0" + "lullabot/php-webdriver": "^2.0.5" }, "require-dev": { "mink/driver-testsuite": "dev-master",