You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
1.1 KiB

<?php
namespace Tests\Feature\Auth;
use App\Entities\Users\User;
use Tests\TestCase;
class MemberLoginTest extends TestCase
{
/** @test */
public function member_register_and_login_successfully()
{
$user = factory(User::class)->create(['name' => 'Nama Member', 'email' => 'email@mail.com']);
$user->assignRole('customer');
$this->visit(route('auth.login'));
$this->type('email@mail.com','email');
$this->type('member','password');
$this->press(trans('auth.login'));
$this->seePageIs(route('home'));
$this->see('Selamat datang kembali Nama Member.');
$this->click('Keluar');
$this->seePageIs(route('auth.login'));
$this->see('Anda telah logout.');
}
/** @test */
public function member_invalid_login()
{
$this->visit(route('auth.login'));
$this->type('email@mail.com','email');
$this->type('password.112','password');
$this->press(trans('auth.login'));
$this->seePageIs(route('auth.login'));
$this->see('Mohon maaf, anda tidak dapat login');
}
}