Monday, May 22, 2017

Testing React frontend with laravel dusk

I am trying to run tests for submitting a form in my react front end using laravel dusk. the form doesn't gets submitted.

public function testBasicExample()
    {
        $user = factory(User::class)->create([
            'email'     => 'testuser@email.com',
            'password'  => bcrypt('password')
        ]);

        $this->browse(function (Browser $browser) use ($user) {
            $browser->visit('/')
                    ->type('username', $user->email)
                    ->type('password', 'password')
                    ->press('Login')
                    ->assertSee('Dashboard');
        });
}

can anyone help me ??



via besrabasant

Advertisement