Skip to content

Fix $page->waitForLoadState() handling#65

Merged
smnandre merged 1 commit intoplaywright-php:mainfrom
stloyd:patch-1
Feb 15, 2026
Merged

Fix $page->waitForLoadState() handling#65
smnandre merged 1 commit intoplaywright-php:mainfrom
stloyd:patch-1

Conversation

@stloyd
Copy link
Contributor

@stloyd stloyd commented Feb 13, 2026

Kinda reproducer:

$page = Playwright::firefox(['headless' => true])->newPage();
$page->goto('https://example.com');
$page->locator('input[name="password"]')->fill('password');
$page->locator('button[type="submit"]')->click();

$page->goForward();
$page->waitForLoadState();

This fixes errors like:

Fatal error: Uncaught Playwright\Exception\PlaywrightException: Unknown action: waitForLoadState in /project/vendor/playwright-php/playwright/src/Page/Page.php:626
Stack trace:
#0 /project/vendor/playwright-php/playwright/src/Page/Page.php(846): Playwright\Page\Page->sendCommand('waitForLoadStat...', Array)
#1 /project/scripts/playwright.php(23): Playwright\Page\Page->waitForLoadState()
#2 {main}
  thrown in /project/vendor/playwright-php/playwright/src/Page/Page.php on line 626

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@smnandre
Copy link
Member

Hi @stloyd, thank you very much for this PR!

Could you maybe add a small test to prevent future regression?

@stloyd
Copy link
Contributor Author

stloyd commented Feb 14, 2026

Added, on the main branch, it fails like:

There was 1 error:

1) Playwright\Tests\Integration\Page\PageTest::itWaitsForLoadState
Playwright\Exception\PlaywrightException: Unknown action: waitForLoadState

/Users/stloyd/Documents/playwright/src/Page/Page.php:626
/Users/stloyd/Documents/playwright/src/Page/Page.php:846
/Users/stloyd/Documents/playwright/tests/Integration/Page/PageTest.php:165

@smnandre smnandre added the bug Something isn't working label Feb 15, 2026
@smnandre
Copy link
Member

Thank you very much @stloyd!

@smnandre smnandre merged commit f2b78b8 into playwright-php:main Feb 15, 2026
10 checks passed
@stloyd stloyd deleted the patch-1 branch February 15, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants