mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
56 lines
1.5 KiB
PHP
56 lines
1.5 KiB
PHP
<?php
|
|
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use App\Classes\ValueObjects\Constants\RoleTypes;
|
|
use App\Models\User;
|
|
use Codeception\Util\Debug;
|
|
|
|
class AuthenticationCest
|
|
{
|
|
public function _before(AcceptanceTester $I)
|
|
{
|
|
$I->wantTo('Test the Authentication Flow');
|
|
$I->amOnPage('/');
|
|
}
|
|
|
|
/**
|
|
* test if the home page is loaded
|
|
* @param AcceptanceTester $I
|
|
* @return void
|
|
*/
|
|
public function tryToTestIfWelcomePageIsLoaded(AcceptanceTester $I)
|
|
{
|
|
|
|
$I->wantTo('Check if the home page works.');
|
|
$I->amOnPage('/');
|
|
$I->see('SIGN IN');
|
|
$I->see('To keep using the service please sign in with your personal info');
|
|
$I->see('New Customer? Create Account');
|
|
}
|
|
|
|
/**
|
|
* test if admin can log in
|
|
* @param AcceptanceTester $I
|
|
* @return void
|
|
*/
|
|
public function tryToTestIfAdminCanLogin(AcceptanceTester $I)
|
|
{
|
|
|
|
|
|
// Fill out the login form
|
|
$I->fillField('email', 'omair@cief-malaysia.com');
|
|
$I->fillField('password', '123456abcabc');
|
|
$I->click(['css' => '.btn.btn-block.btn-lg.b-rad-none.no-border']);
|
|
|
|
$I->wait(5); // 2 seconds delay
|
|
|
|
$I->expectTo('be redirected to the dashboard');
|
|
$I->seeCurrentUrlEquals('/dashboard');
|
|
$I->see('Dashboard');
|
|
$I->see('NEW CUSTOMERS');
|
|
$I->see('Unclaimed Packing Lists');
|
|
$I->see('Identification Verification');
|
|
$I->see('ACTIVATED ORDERS');
|
|
}
|
|
}
|