Repository navigation
fix: reuse the same page for every call forwarded by On - #272
tiagoabsantos wants to merge 1 commit into
Conversation
On::__call() created a new PendingAwaitablePage on each call, so `$page = visit('/')->on()->mobile()` opened a new browser context for each separate `$page->...` call and lost the state of the previous action.
Fixes pestphp/pest#1931
|
I hit this bug (pestphp/pest#1931) and opened a PR with a slightly Two differences worth discussing:
|
|
The mixin point is right. IDEs that don't follow |
|
Up to you on scope. If you'd rather keep this PR focused on the context bug, that's fine — the Side note: while checking this I noticed From has the same |
What:
Description:
On::__call()created a newPendingAwaitablePageon every call, so$page = visit('/')->on()->mobile()opened a new browser context for each separate$page->...call. Aclick()changed one page and the next assertion ran on a fresh one.Onnow creates the pending page once and forwards every call to it, likePendingAwaitablePagedoes with its webpage.tests/Browser/Visit/OnTest.phpcovers separate calls with and without a device.Related:
Fixes pestphp/pest#1931