Adds disabled user acceptance tests
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
parent
de7606dc68
commit
801bf81317
|
@ -70,6 +70,14 @@ class LoginPageContext implements Context, ActorAwareInterface {
|
||||||
describedAs("Wrong password message in Login page");
|
describedAs("Wrong password message in Login page");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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
|
* @When I log in with user :user and password :password
|
||||||
*/
|
*/
|
||||||
|
@ -96,6 +104,14 @@ class LoginPageContext implements Context, ActorAwareInterface {
|
||||||
$this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
|
$this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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
|
* @BeforeScenario
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,6 +28,12 @@ Feature: login
|
||||||
Then I see that the current page is the Login page
|
Then I see that the current page is the Login page
|
||||||
And I see that a wrong password message is shown
|
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
|
Scenario: log in with invalid user once fixed by admin
|
||||||
Given I act as John
|
Given I act as John
|
||||||
And I can not log in with user unknownUser and password 123456acb
|
And I can not log in with user unknownUser and password 123456acb
|
||||||
|
|
|
@ -35,6 +35,8 @@ fi
|
||||||
php occ maintenance:install --admin-pass=admin
|
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 user0
|
||||||
|
OC_PASS=123456acb php occ user:add --password-from-env disabledUser
|
||||||
|
php occ user:disable disabledUser
|
||||||
|
|
||||||
if [ "$NEXTCLOUD_SERVER_DOMAIN" != "" ]; then
|
if [ "$NEXTCLOUD_SERVER_DOMAIN" != "" ]; then
|
||||||
# Default first trusted domain is "localhost"; replace it with given domain.
|
# Default first trusted domain is "localhost"; replace it with given domain.
|
||||||
|
|
Loading…
Reference in New Issue