summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-02-27 18:48:14 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-02-28 11:17:39 +0100
commit907234fde289debed7aa01f589b4811ef187f5a3 (patch)
tree298d0f006a1a33b4c8539da03bd73e2e597a3091 /tests
parent8af3b5d3771417495226228cbee4394cc622d001 (diff)
downloadnextcloud-server-907234fde289debed7aa01f589b4811ef187f5a3.tar.gz
nextcloud-server-907234fde289debed7aa01f589b4811ef187f5a3.zip
Fix acceptance tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/bootstrap/UsersSettingsContext.php33
-rw-r--r--tests/acceptance/features/login.feature2
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