Skip to content

Commit

Permalink
Run tests on Chromium 122
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Nov 6, 2024
1 parent dc463f0 commit 1a29794
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 122

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -81,4 +85,4 @@ jobs:
- name: Execute PHPUnit
run: vendor/bin/phpunit
env:
CHROME_PATH: google-chrome-stable
CHROME_PATH: /opt/hostedtoolcache/setup-chrome/chromium/122.0.6261.128/x64/chrome
7 changes: 4 additions & 3 deletions tests/BrowserFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,15 @@ public function testConnectToBrowser(): void

// TODO test existing pages propagation

// create a new connectionn to the existing browser
// create a new connection to the existing browser
$browser2 = BrowserFactory::connectToBrowser($browser->getSocketUri());

// create a page on the first browser after 2d connection
// create a page on the first browser after 2nd connection
$page2 = $browser->createPage();
\sleep(1);
$page2TargetId = $page2->getSession()->getTargetId();

// update 2d browser
// update 2nd browser
$browser2->getConnection()->readData();

// make sure 2nd browser received the new page
Expand Down
2 changes: 2 additions & 0 deletions tests/BrowsingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ public function testGetPagesClose(): void

$page->close();

\sleep(1);

$finalCount = \count(self::$browser->getPages());

self::assertLessThan($initialCount, $finalCount);
Expand Down

0 comments on commit 1a29794

Please sign in to comment.