summaryrefslogtreecommitdiffstats
path: root/tests/acceptance
diff options
context:
space:
mode:
authorMichael Weimann <mail@michael-weimann.eu>2018-07-21 13:05:34 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-07-24 17:31:03 +0200
commit801bf813178573b539a8d66bcb1420cd11455994 (patch)
treec6592e7f14e7916b38615ce73b76c9f8e245d661 /tests/acceptance
parentde7606dc6802a026f8ce33115c2f51a304aabc61 (diff)
downloadnextcloud-server-801bf813178573b539a8d66bcb1420cd11455994.tar.gz
nextcloud-server-801bf813178573b539a8d66bcb1420cd11455994.zip
Adds disabled user acceptance tests
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Diffstat (limited to 'tests/acceptance')
-rw-r--r--tests/acceptance/features/bootstrap/LoginPageContext.php16
-rw-r--r--tests/acceptance/features/login.feature6
-rwxr-xr-xtests/acceptance/installAndConfigureServer.sh2
3 files changed, 24 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
diff --git a/tests/acceptance/installAndConfigureServer.sh b/tests/acceptance/installAndConfigureServer.sh
index c61faeda238..98de72bf45e 100755
--- a/tests/acceptance/installAndConfigureServer.sh
+++ b/tests/acceptance/installAndConfigureServer.sh
@@ -35,6 +35,8 @@ fi
php occ maintenance:install --admin-pass=admin
OC_PASS=123456acb php occ user:add --password-from-env user0
+OC_PASS=123456acb php occ user:add --password-from-env disabledUser
+php occ user:disable disabledUser
if [ "$NEXTCLOUD_SERVER_DOMAIN" != "" ]; then
# Default first trusted domain is "localhost"; replace it with given domain.