Skip to content

Instantly share code, notes, and snippets.

Last active May 31, 2020
What would you like to do?
namespace Tests\Browser;
use App\User;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class LoginTest extends DuskTestCase
use DatabaseMigrations;
protected $user;
public function setUp(): void {
$this->user = factory(User::class)->create([
'email' => ''
public function testIsLoginPage() {
$this->browse(function (Browser $browser) {
->assertSee('Forgot Your Password?')
->clickLink("Forgot Your Password?")
->assertSee('Reset Password');
public function testLogin() {
$this->browse(function(Browser $browser) {
->type('email', $this->user->email)
->type('password', 'password')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment