Created regular tests
This commit is contained in:
44
tests/acceptance/SigninCest.php
Normal file
44
tests/acceptance/SigninCest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user