45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
|
|
class SigninCest
|
|
{
|
|
public function _before(AcceptanceTester $I)
|
|
{
|
|
// Artisan::call('migrate');
|
|
|
|
// factory(App\User::class)->create(['email' => 'admin@laraland.test']);
|
|
}
|
|
|
|
public function _after(AcceptanceTester $I)
|
|
{
|
|
// Artisan::call('migrate:rollback');
|
|
}
|
|
|
|
// tests
|
|
public function signinSuccessful(AcceptanceTester $I)
|
|
{
|
|
$I->wantTo('signin with correct credential and should go to dashboard page');
|
|
|
|
$I->amOnPage('/login');
|
|
$I->fillField('email', 'admin@laraland.test');
|
|
$I->fillField('password', 'secret');
|
|
$I->click('button[type=submit]');
|
|
|
|
$I->see('Dashboard');
|
|
$I->seeCurrentUrlEquals('/home');
|
|
}
|
|
|
|
public function signinUnsuccessful(AcceptanceTester $I)
|
|
{
|
|
$I->wantTo('signin with incorrect credential and should go back to login page');
|
|
|
|
$I->amOnPage('/login');
|
|
$I->fillField('email', 'admin@laraland.test');
|
|
$I->fillField('password', 'notsecret');
|
|
$I->click('button[type=submit]');
|
|
|
|
$I->see('Login');
|
|
$I->seeCurrentUrlEquals('/login');
|
|
}
|
|
}
|