diff --git a/apps/settings/css/settings.scss b/apps/settings/css/settings.scss index 3c3b25af38d7d..47a035016add0 100644 --- a/apps/settings/css/settings.scss +++ b/apps/settings/css/settings.scss @@ -1435,7 +1435,7 @@ doesnotexist:-o-prefocus, .strengthify-wrapper { &#grid-header { color: var(--color-text-maxcontrast); z-index: 60; /* above new-user */ - border-bottom-width: medium; + border-bottom-width: thin; #headerDisplayName, #headerPassword, @@ -1511,7 +1511,7 @@ doesnotexist:-o-prefocus, .strengthify-wrapper { align-items: center; justify-content: center; progress { - width: 100%; + width: 100%; margin: 0 10px; height: 3px; } diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue index 48564f000a2ce..583d6d6958102 100644 --- a/apps/settings/src/components/UserList.vue +++ b/apps/settings/src/components/UserList.vue @@ -21,209 +21,211 @@ --> diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue index f0baae70f8134..71941cd5369f3 100644 --- a/apps/settings/src/components/UserList/UserRow.vue +++ b/apps/settings/src/components/UserList/UserRow.vue @@ -24,193 +24,208 @@ diff --git a/tests/acceptance/features/bootstrap/UsersSettingsContext.php b/tests/acceptance/features/bootstrap/UsersSettingsContext.php index 157a57eb3ae6b..93ff2ce1614c3 100644 --- a/tests/acceptance/features/bootstrap/UsersSettingsContext.php +++ b/tests/acceptance/features/bootstrap/UsersSettingsContext.php @@ -1,9 +1,10 @@ + * @copyright Copyright (c) 2019, Greta Doci * * @license GNU AGPL version 3 or any later version * @@ -33,7 +34,7 @@ class UsersSettingsContext implements Context, ActorAwareInterface { */ public static function newUserForm() { return Locator::forThe()->id("new-user")-> - describedAs("New user form in Users Settings"); + describedAs("New user form in Users Settings"); } /** @@ -41,7 +42,7 @@ public static function newUserForm() { */ public static function userNameFieldForNewUser() { return Locator::forThe()->field("newusername")-> - describedAs("User name field for new user in Users Settings"); + describedAs("User name field for new user in Users Settings"); } /** @@ -49,7 +50,7 @@ public static function userNameFieldForNewUser() { */ public static function displayNameFieldForNewUser() { return Locator::forThe()->field("newdisplayname")-> - describedAs("Display name field for new user in Users Settings"); + describedAs("Display name field for new user in Users Settings"); } /** @@ -57,7 +58,7 @@ public static function displayNameFieldForNewUser() { */ public static function passwordFieldForNewUser() { return Locator::forThe()->field("newuserpassword")-> - describedAs("Password field for new user in Users Settings"); + describedAs("Password field for new user in Users Settings"); } /** @@ -65,7 +66,7 @@ public static function passwordFieldForNewUser() { */ public static function newUserButton() { return Locator::forThe()->id("new-user-button")-> - describedAs("New user button in Users Settings"); + describedAs("New user button in Users Settings"); } /** @@ -73,7 +74,7 @@ public static function newUserButton() { */ public static function createNewUserButton() { return Locator::forThe()->xpath("//form[@id = 'new-user']//input[@type = 'submit']")-> - describedAs("Create user button in Users Settings"); + describedAs("Create user button in Users Settings"); } /** @@ -81,18 +82,18 @@ public static function createNewUserButton() { */ public static function rowForUser($user) { return Locator::forThe()->xpath("//div[@id='app-content']/div/div[normalize-space() = '$user']/..")-> - describedAs("Row for user $user in Users Settings"); + describedAs("Row for user $user in Users Settings"); } /** * Warning: you need to watch out for the proper classes order - * + * * @return Locator */ public static function classCellForUser($class, $user) { return Locator::forThe()->xpath("//*[contains(concat(' ', normalize-space(@class), ' '), ' $class ')]")-> - descendantOf(self::rowForUser($user))-> - describedAs("$class cell for user $user in Users Settings"); + descendantOf(self::rowForUser($user))-> + describedAs("$class cell for user $user in Users Settings"); } /** @@ -100,8 +101,8 @@ public static function classCellForUser($class, $user) { */ public static function inputForUserInCell($cell, $user) { return Locator::forThe()->css("input")-> - descendantOf(self::classCellForUser($cell, $user))-> - describedAs("$cell input for user $user in Users Settings"); + descendantOf(self::classCellForUser($cell, $user))-> + describedAs("$cell input for user $user in Users Settings"); } /** @@ -116,8 +117,8 @@ public static function displayNameCellForUser($user) { */ public static function optionInInputForUser($cell, $user) { return Locator::forThe()->css(".multiselect__option--highlight")-> - descendantOf(self::classCellForUser($cell, $user))-> - describedAs("Selected $cell option in $cell input for user $user in Users Settings"); + descendantOf(self::classCellForUser($cell, $user))-> + describedAs("Selected $cell option in $cell input for user $user in Users Settings"); } /** @@ -125,8 +126,8 @@ public static function optionInInputForUser($cell, $user) { */ public static function actionsMenuOf($user) { return Locator::forThe()->css(".icon-more")-> - descendantOf(self::rowForUser($user))-> - describedAs("Actions menu for user $user in Users Settings"); + descendantOf(self::rowForUser($user))-> + describedAs("Actions menu for user $user in Users Settings"); } /** @@ -134,8 +135,8 @@ public static function actionsMenuOf($user) { */ public static function theAction($action, $user) { return Locator::forThe()->xpath("//button[normalize-space() = '$action']")-> - descendantOf(self::rowForUser($user))-> - describedAs("$action action for the user $user row in Users Settings"); + descendantOf(self::rowForUser($user))-> + describedAs("$action action for the user $user row in Users Settings"); } /** @@ -143,7 +144,7 @@ public static function theAction($action, $user) { */ public static function theColumn($column) { return Locator::forThe()->xpath("//div[@class='user-list-grid']//div[normalize-space() = '$column']")-> - describedAs("The $column column in Users Settings"); + describedAs("The $column column in Users Settings"); } /** @@ -151,8 +152,8 @@ public static function theColumn($column) { */ public static function selectedSelectOption($cell, $user) { return Locator::forThe()->css(".multiselect__single")-> - descendantOf(self::classCellForUser($cell, $user))-> - describedAs("The selected option of the $cell select for the user $user in Users Settings"); + descendantOf(self::classCellForUser($cell, $user))-> + describedAs("The selected option of the $cell select for the user $user in Users Settings"); } /** @@ -160,8 +161,16 @@ public static function selectedSelectOption($cell, $user) { */ public static function editModeToggle($user) { return Locator::forThe()->css(".toggleUserActions button.icon-rename")-> - descendantOf(self::rowForUser($user))-> - describedAs("The edit toggle button for the user $user in Users Settings"); + descendantOf(self::rowForUser($user))-> + describedAs("The edit toggle button for the user $user in Users Settings"); + } + + /** + * @return Locator + */ + public static function editModeOn($user) { + return Locator::forThe()->css("div.user-list-grid div.row.row--editable[data-id=$user]")-> + describedAs("I see the edit mode is on for the user $user in Users Settings"); } /** @@ -220,6 +229,13 @@ public function iToggleTheEditModeForUser($user) { $this->actor->find(self::editModeToggle($user), 10)->click(); } + /** + * @When I see the edit mode is on + */ + public function ISeeTheEditModeIsOn($user) { + $this->actor->find(self::editModeOn($user), 10)->click(); + } + /** * @When I create user :user with password :password */ @@ -274,7 +290,7 @@ public function iSeeThatTheListOfUsersDoesNotContainsTheUser($user) { */ public function iSeeThatTheNewUserFormIsShown() { PHPUnit_Framework_Assert::assertTrue( - $this->actor->find(self::newUserForm(), 10)->isVisible()); + $this->actor->find(self::newUserForm(), 10)->isVisible()); } /** @@ -282,7 +298,7 @@ public function iSeeThatTheNewUserFormIsShown() { */ public function iSeeTheAction($action, $user) { PHPUnit_Framework_Assert::assertTrue( - $this->actor->find(self::theAction($action, $user), 10)->isVisible()); + $this->actor->find(self::theAction($action, $user), 10)->isVisible()); } /** @@ -290,7 +306,7 @@ public function iSeeTheAction($action, $user) { */ public function iSeeThatTheColumnIsShown($column) { PHPUnit_Framework_Assert::assertTrue( - $this->actor->find(self::theColumn($column), 10)->isVisible()); + $this->actor->find(self::theColumn($column), 10)->isVisible()); } /** @@ -312,8 +328,8 @@ public function iSeeThatTheDisplayNameForTheUserIs($user, $displayName) { * @Then I see that the :cell cell for user :user is done loading */ public function iSeeThatTheCellForUserIsDoneLoading($cell, $user) { - WaitFor::elementToBeEventuallyShown($this->actor, self::classCellForUser($cell.' icon-loading-small', $user)); - WaitFor::elementToBeEventuallyNotShown($this->actor, self::classCellForUser($cell.' icon-loading-small', $user)); + WaitFor::elementToBeEventuallyShown($this->actor, self::classCellForUser($cell . ' icon-loading-small', $user)); + WaitFor::elementToBeEventuallyNotShown($this->actor, self::classCellForUser($cell . ' icon-loading-small', $user)); } /** @@ -323,6 +339,6 @@ public function iSeeThatTheuserQuotaIs($user, $quota) { PHPUnit_Framework_Assert::assertEquals( $this->actor->find(self::selectedSelectOption('quota', $user), 2)->getText(), $quota); } - + } diff --git a/tests/acceptance/features/users.feature b/tests/acceptance/features/users.feature index 4cb9fc861739a..2bc58957dfa6a 100644 --- a/tests/acceptance/features/users.feature +++ b/tests/acceptance/features/users.feature @@ -1,56 +1,56 @@ @apache Feature: users - Scenario: create a new user - Given 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 - When I create user unknownUser with password 123456acb - Then I see that the list of users contains the user unknownUser + Scenario: create a new user + Given 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 + When I create user unknownUser with password 123456acb + Then I see that the list of users contains the user unknownUser - Scenario: create a new user with a custom display name - Given I am logged in as the admin - And I open the User settings - When I click the New user button - And I see that the new user form is shown - And I set the user name for the new user to "test" - And I set the display name for the new user to "Test display name" - And I set the password for the new user to "123456acb" - And I create the new user - Then I see that the list of users contains the user "test" + Scenario: create a new user with a custom display name + Given I am logged in as the admin + And I open the User settings + When I click the New user button + And I see that the new user form is shown + And I set the user name for the new user to "test" + And I set the display name for the new user to "Test display name" + And I set the password for the new user to "123456acb" + And I create the new user + Then I see that the list of users contains the user "test" # And I see that the display name for the user "test" is "Test display name" - Scenario: delete a user - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I see that the list of users contains the user user0 - And I open the actions menu for the user user0 + Scenario: delete a user + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I see that the list of users contains the user user0 + And I open the actions menu for the user user0 # And I see that the "Delete user" action in the user0 actions menu is shown # When I click the "Delete user" action in the user0 actions menu # Then I see that the list of users does not contains the user user0 - Scenario: disable a user - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I see that the list of users contains the user user0 - And I open the actions menu for the user user0 + Scenario: disable a user + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I see that the list of users contains the user user0 + And I open the actions menu for the user user0 # And I see that the "Disable user" action in the user0 actions menu is shown # When I click the "Disable user" action in the user0 actions menu # Then I see that the list of users does not contains the user user0 # When I open the "Disabled users" section # Then I see that the list of users contains the user user0 - Scenario: users navigation without disabled users - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I open the "Disabled users" section - And I see that the list of users contains the user disabledUser - And I open the actions menu for the user disabledUser + Scenario: users navigation without disabled users + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I open the "Disabled users" section + And I see that the list of users contains the user disabledUser + And I open the actions menu for the user disabledUser # And I see that the "Enable user" action in the disabledUser actions menu is shown # When I click the "Enable user" action in the disabledUser actions menu # Then I see that the section "Disabled users" is not shown @@ -58,23 +58,25 @@ Feature: users # When I open the User settings # Then I see that the section "Disabled users" is not shown - Scenario: assign user to a group - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I see that the list of users contains the user user0 - # disabled because we need the TAB patch: + Scenario: assign user to a group + Given I act as Jane + And I am logged in as the admin + And I open the User settings + When I toggle the edit mode for the user0 + Then I see that the edit mode is on + And I see that the list of users contains the user user0 + # disabled because we need the TAB patch: # https://github.com/minkphp/MinkSelenium2Driver/pull/244 # When I assign the user user0 to the group admin # Then I see that the section Admins is shown # And I see that the section Admins has a count of 2 - - Scenario: create and delete a group - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I see that the list of users contains the user user0 - # disabled because we need the TAB patch: + + Scenario: create and delete a group + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I see that the list of users contains the user user0 + # disabled because we need the TAB patch: # https://github.com/minkphp/MinkSelenium2Driver/pull/244 # And I assign the user user0 to the group Group1 # And I see that the section Group1 is shown @@ -83,10 +85,10 @@ Feature: users # When I click the "Yes" button of the confirmation dialog # Then I see that the section Group1 is not shown - Scenario: delete an empty group - Given I act as Jane - And I am logged in as the admin - And I open the User settings + Scenario: delete an empty group + Given I act as Jane + And I am logged in as the admin + And I open the User settings # disabled because we need the TAB patch: # https://github.com/minkphp/MinkSelenium2Driver/pull/244 # And I assign the user user0 to the group Group1 @@ -98,21 +100,21 @@ Feature: users # When I click the "Yes" button of the confirmation dialog # Then I see that the section Group1 is not shown - Scenario: change columns visibility - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I open the settings - And I see that the settings are opened - When I toggle the showLanguages checkbox in the settings - Then I see that the "Language" column is shown - When I toggle the showLastLogin checkbox in the settings - Then I see that the "Last login" column is shown - When I toggle the showStoragePath checkbox in the settings - Then I see that the "Storage location" column is shown - When I toggle the showUserBackend checkbox in the settings - Then I see that the "User backend" column is shown - + Scenario: change columns visibility + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I open the settings + And I see that the settings are opened + When I toggle the showLanguages checkbox in the settings + Then I see that the "Language" column is shown + When I toggle the showLastLogin checkbox in the settings + Then I see that the "Last login" column is shown + When I toggle the showStoragePath checkbox in the settings + Then I see that the "Storage location" column is shown + When I toggle the showUserBackend checkbox in the settings + Then I see that the "User backend" column is shown + # Scenario: change display name # Given I act as Jane # And I am logged in as the admin @@ -123,16 +125,18 @@ Feature: users # And I see that the displayName cell for user user0 is done loading # Then I see that the displayName of user0 is user1 - Scenario: change password - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I see that the list of users contains the user user0 - And I see that the password of user0 is "" - When I set the password for user0 to 123456 - And I see that the password cell for user user0 is done loading + Scenario: change password + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I see that the list of users contains the user user0 + When I toggle the edit mode for the user0 + Then I see that the edit mode is on + And I see that the password of user0 is "" + When I set the password for user0 to 123456 + And I see that the password cell for user user0 is done loading # password input is emptied on change - Then I see that the password of user0 is "" + Then I see that the password of user0 is "" # Scenario: change email # Given I act as Jane @@ -144,15 +148,15 @@ Feature: users # And I see that the mailAddress cell for user user0 is done loading # Then I see that the mailAddress of user0 is "test@nextcloud.com" - Scenario: change user quota - Given I act as Jane - And I am logged in as the admin - And I open the User settings - And I see that the list of users contains the user user0 - When I toggle the edit mode for the user user0 - Then I see that the edit mode is on - And I see that the user quota of user0 is Unlimited - # disabled because we need the TAB patch: + Scenario: change user quota + Given I act as Jane + And I am logged in as the admin + And I open the User settings + And I see that the list of users contains the user user0 + When I toggle the edit mode for the user user0 + Then I see that the edit mode is on + And I see that the user quota of user0 is Unlimited + # disabled because we need the TAB patch: # https://github.com/minkphp/MinkSelenium2Driver/pull/244 # When I set the user user0 quota to 1GB # And I see that the quota cell for user user0 is done loading @@ -165,4 +169,4 @@ Feature: users # Then I see that the user quota of user0 is "0 B" # When I set the user user0 quota to Default # And I see that the quota cell for user user0 is done loading - # Then I see that the user quota of user0 is "Default quota" \ No newline at end of file + # Then I see that the user quota of user0 is "Default quota"