diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-02-28 12:33:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-28 12:33:30 +0100 |
commit | 926419e15c5ba4e9163016fa4a66a864b0ea2ca2 (patch) | |
tree | 6d8ef08039dd6a52ad87f487cdf06572f6d33c8f /tests | |
parent | 533e8351adfd5cc443c853fbb884246e8ae36b04 (diff) | |
parent | 35144a72adf79152c7a3420cc9c671728e8ec31c (diff) | |
download | nextcloud-server-926419e15c5ba4e9163016fa4a66a864b0ea2ca2.tar.gz nextcloud-server-926419e15c5ba4e9163016fa4a66a864b0ea2ca2.zip |
Merge pull request #7600 from nextcloud/new-user-button-to-sidebar
New user button to sidebar
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/bootstrap/UsersSettingsContext.php | 33 | ||||
-rw-r--r-- | tests/acceptance/features/login.feature | 2 |
2 files changed, 34 insertions, 1 deletions
diff --git a/tests/acceptance/features/bootstrap/UsersSettingsContext.php b/tests/acceptance/features/bootstrap/UsersSettingsContext.php index 93ab7246eb6..9ddea57f413 100644 --- a/tests/acceptance/features/bootstrap/UsersSettingsContext.php +++ b/tests/acceptance/features/bootstrap/UsersSettingsContext.php @@ -30,6 +30,14 @@ class UsersSettingsContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function newUserForm() { + return Locator::forThe()->id("newuserHeader")-> + describedAs("New user form in Users Settings"); + } + + /** + * @return Locator + */ public static function userNameFieldForNewUser() { return Locator::forThe()->field("newusername")-> describedAs("User name field for new user in Users Settings"); @@ -46,6 +54,14 @@ class UsersSettingsContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function newUserButton() { + return Locator::forThe()->id("new-user-button")-> + describedAs("New user button in Users Settings"); + } + + /** + * @return Locator + */ public static function createNewUserButton() { return Locator::forThe()->xpath("//form[@id = 'newuser']//input[@type = 'submit']")-> describedAs("Create user button in Users Settings"); @@ -55,7 +71,7 @@ class UsersSettingsContext implements Context, ActorAwareInterface { * @return Locator */ public static function rowForUser($user) { - return Locator::forThe()->xpath("//table[@id = 'userlist']//th[normalize-space() = '$user']/..")-> + return Locator::forThe()->xpath("//table[@id = 'userlist']//td[normalize-space() = '$user']/..")-> describedAs("Row for user $user in Users Settings"); } @@ -76,6 +92,13 @@ class UsersSettingsContext implements Context, ActorAwareInterface { } /** + * @When I click the New user button + */ + public function iClickTheNewUserButton() { + $this->actor->find(self::newUserButton())->click(); + } + + /** * @When I create user :user with password :password */ public function iCreateUserWithPassword($user, $password) { @@ -99,4 +122,12 @@ class UsersSettingsContext implements Context, ActorAwareInterface { PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::rowForUser($user), 10)); } + /** + * @Then I see that the new user form is shown + */ + public function iSeeThatTheNewUserFormIsShown() { + PHPUnit_Framework_Assert::assertTrue( + $this->actor->find(self::newUserForm(), 10)->isVisible()); + } + } diff --git a/tests/acceptance/features/login.feature b/tests/acceptance/features/login.feature index e414209206e..3db8c4945ec 100644 --- a/tests/acceptance/features/login.feature +++ b/tests/acceptance/features/login.feature @@ -35,6 +35,8 @@ Feature: login When I act as Jane And I am logged in as the admin And I open the User settings + And I click the New user button + And I see that the new user form is shown And I create user unknownUser with password 123456acb And I see that the list of users contains the user unknownUser And I act as John |