diff options
Diffstat (limited to 'tests/acceptance/features')
-rw-r--r-- | tests/acceptance/features/bootstrap/LoginPageContext.php | 16 | ||||
-rw-r--r-- | tests/acceptance/features/login.feature | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/LoginPageContext.php b/tests/acceptance/features/bootstrap/LoginPageContext.php index 1496e3030c2..df7944aa912 100644 --- a/tests/acceptance/features/bootstrap/LoginPageContext.php +++ b/tests/acceptance/features/bootstrap/LoginPageContext.php @@ -71,6 +71,14 @@ class LoginPageContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function userDisabledMessage() { + return Locator::forThe()->xpath("//*[@class = 'warning userDisabledMsg' and normalize-space() = 'User disabled']")-> + describedAs('User disabled message on login page'); + } + + /** * @When I log in with user :user and password :password */ public function iLogInWithUserAndPassword($user, $password) { @@ -97,6 +105,14 @@ class LoginPageContext implements Context, ActorAwareInterface { } /** + * @Then I see that the disabled user message is shown + */ + public function iSeeThatTheDisabledUserMessageIsShown() { + PHPUnit_Framework_Assert::assertTrue( + $this->actor->find(self::userDisabledMessage(), 10)->isVisible()); + } + + /** * @BeforeScenario */ public function getOtherRequiredSiblingContexts(BeforeScenarioScope $scope) { diff --git a/tests/acceptance/features/login.feature b/tests/acceptance/features/login.feature index 3a31d3f88bd..44353d37c65 100644 --- a/tests/acceptance/features/login.feature +++ b/tests/acceptance/features/login.feature @@ -28,6 +28,12 @@ Feature: login Then I see that the current page is the Login page And I see that a wrong password message is shown + Scenario: try to log in as disabled user + Given I visit the Home page + When I log in with user disabledUser and password 123456acb + Then I see that the current page is the Login page + And I see that the disabled user message is shown + Scenario: log in with invalid user once fixed by admin Given I act as John And I can not log in with user unknownUser and password 123456acb |