Laravel - Browser Tests - Creating Browsers

To get started, let's write a test that verifies we can log into our application. After generating a test, we can modify it to navigate to the login page, enter some credentials, and click the "Login" button. To create a browser instance, you may call the browse method from within your Dusk test:

                'email' => '[email protected]',
            $this->browse(function ($browser) use ($user) {
                        ->type('email', $user->email)
                        ->type('password', 'password')

As you can see in the example above, the browse method accepts a closure. A browser instance will automatically be passed to this closure by Dusk and is the main object used to interact with and make assertions against your application.