Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
justafish committed Dec 13, 2023
1 parent 4cb7ec7 commit 4e778d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@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
composer require lullabot/php-webdriver:dev-justafish/func-signatures
- run: vendor/bin/phpstan analyze

tests:
Expand All @@ -44,7 +51,7 @@ jobs:
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
selenium: ['latest']
selenium: ['2.53.1', 'latest']
fail-fast: false

steps:
Expand All @@ -65,6 +72,7 @@ jobs:
- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist
composer require lullabot/php-webdriver:dev-justafish/func-signatures
- name: Setup Mink test server
run: |
Expand All @@ -81,7 +89,12 @@ jobs:
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
- name: Run tests
run: ./vendor/bin/phpunit -v --coverage-clover=coverage.xml
run: |
if [ "${{ matrix.selenium }}" != "latest" ]; then
DRIVER_URL="http://localhost:4444/wd/hub" ./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
3 changes: 2 additions & 1 deletion src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use WebDriver\Exception\UnknownCommand;
use WebDriver\Exception\UnknownError;
use WebDriver\Key;
use WebDriver\LegacyWindow;
use WebDriver\Session;
use WebDriver\WebDriver;
use WebDriver\Window;
Expand Down Expand Up @@ -1100,7 +1101,7 @@ public function resizeWindow(int $width, int $height, ?string $name = null)
}
else {
$window = $this->getWebDriverSession()->window($name ?: 'current');
\assert($window instanceof Window);
\assert($window instanceof LegacyWindow);
$window->postSize(
array('width' => $width, 'height' => $height)
);
Expand Down

0 comments on commit 4e778d0

Please sign in to comment.