/** * Run prevent locked admin user log in to backend entity test. * * @param User $adminUser * @param int $countRetries * @return void */ public function test(User $adminUser, $countRetries) { $this->adminAuthLogin->open(); // Steps: $userName = $adminUser->getUsername(); for ($i = 1; $i <= $countRetries; $i++) { $this->login(['username' => $userName, 'password' => '123123qq']); } $this->login(['username' => $userName, 'password' => $adminUser->getPassword()]); }
/** * Login admin user. * * @param FixtureInterface $fixture [optional] * @return mixed|string */ public function persist(FixtureInterface $fixture = null) { $this->adminAuthLogin->open(); $loginBlock = $this->adminAuthLogin->getLoginBlock(); if ($loginBlock->isVisible()) { $loginBlock->fill($fixture); $loginBlock->submit(); $this->dashboard->getAdminPanelHeader()->waitVisible(); } }
/** * Log in on backend for super admin. * * @param array $admin * @return void */ protected function loginSuperAdmin(array $admin) { $this->adminAuthLogin->open(); $loginBlock = $this->adminAuthLogin->getLoginBlock(); if ($loginBlock->isVisible()) { $loginBlock->loginToAdminPanel($admin); } }
/** * Verify incorrect credentials message while login to admin. * * @param AdminAuthLogin $adminAuth * @param User $customAdmin * @return void */ public function processAssert(AdminAuthLogin $adminAuth, User $customAdmin) { $adminAuth->open(); $adminAuth->getLoginBlock()->loginToAdminPanel($customAdmin->getData()); \PHPUnit_Framework_Assert::assertEquals(self::INVALID_CREDENTIALS_MESSAGE, $adminAuth->getMessagesBlock()->getErrorMessages(), 'Message "' . self::INVALID_CREDENTIALS_MESSAGE . '" is not visible.'); }