Skip to content

Conversation

@kbond
Copy link
Member

@kbond kbond commented Dec 23, 2020

Now any TestCase that uses HasBrowser, has access to all 3 provided browsers (assuming the current test case supports your chosen browser):

class MyTest extends PantherTestCase // this test case supports all 3
{
    use HasBrowser;

    public function test_that_uses_kernel_browser(): void
    {
        $this->kernelBrowser()
            ->visit('/my/page')
            // ...
        ;
    }

    public function test_that_uses_panther_browser(): void
    {
        $this->pantherBrowser()
            ->visit('/my/page')
            // ...
        ;
    }

    public function test_that_uses_http_browser(): void
    {
        $this->httpBrowser()
            ->visit('/my/page')
            // ...
        ;
    }
}

This also removes ambiguous methods (ie ->createBrowser()) from the HasBrowser trait that could be confusing.

TODO

  • Update tests
  • Update docs

@kbond kbond force-pushed the refactor-test-traits branch 4 times, most recently from 8dad31e to bd5d920 Compare December 23, 2020 16:53
@kbond kbond added this to the 1.0 milestone Dec 23, 2020
@kbond kbond force-pushed the refactor-test-traits branch from bd5d920 to 29842f5 Compare December 23, 2020 17:23
@kbond kbond merged commit e60ed53 into zenstruck:1.x Dec 23, 2020
@kbond kbond deleted the refactor-test-traits branch December 23, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant