Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dusk page assertions don't seem to be working with scopes #618

Closed
gauracreative opened this issue Feb 28, 2019 · 1 comment · Fixed by #625
Closed

Dusk page assertions don't seem to be working with scopes #618

gauracreative opened this issue Feb 28, 2019 · 1 comment · Fixed by #625
Labels

Comments

@gauracreative
Copy link

Not sure if this an issue exactly, and there may be a work around this, but here is an example of what I mean.
Say I have a dusk page Page that does some simple assertion like

public function assert(Browser $browser) {
    $browser->assertSee('Page title');
}

and then I have a test that does something like the following

public function testSomeTest() {
        $this->browse(function (Browser $browser) {
            $browser->visit(new Page)
           ->doSomethingOnThePage()
            ->with('#someElementWithinThePage', function ($element) {
                  $element->doSomethingThere();
            })->doSomethingElseOnThePage();
}

In the case above the page assertions seem be applied inside the scope as well, in which case they might not work. I would sort of expect the page to be "smart enough" to not apply assertions in limited scope, only inside the page as a whole.

Is this an intended way, an issue, or am I missing something? Again, I am not sure. This is a sort of new territory for me here.

Thanks.

@staudenmeir
Copy link
Contributor

I agree that this is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants