Skip to content

Commit

Permalink
Merge pull request #8 from alexpott/FIX-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
justafish authored Jul 17, 2024
2 parents 5f9ecc2 + 64b2b44 commit 4de3353
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -91,11 +89,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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 12 additions & 0 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 4de3353

Please sign in to comment.