Skip to content

Conversation

@mateusjunges
Copy link
Contributor

This PR is another stab at #155, and it adds a new within() method to the Webpage class that allows scoping browser interactions to specific CSS selectors.

$page->within('#contact', function ($browser) {
    $browser->click('Submit');
});

More details

I see that the first PR got reverted because it made the Webpage non-readonly. I copied the tests from my previous PR and reworked the implementation.

I changed the return type on the InteractWithElements, MakesElementAssertions and MakesConsoleAssertions from Webpage to self, as this those traits are now also used on the ScopedWepage class.

The new ScopedWebpage now keeps context of the scope, so no changes to the Webpage are required.

@mateusjunges
Copy link
Contributor Author

Sad to see this sitting idle for 2 months without any review 🙁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant