diff --git a/core/css/share.css b/core/css/share.css index 1436b868cb37..d093fdaf3595 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -69,7 +69,6 @@ white-space: nowrap; text-overflow: ellipsis; overflow: hidden; - line-height: 32px; vertical-align: middle; } @@ -77,6 +76,11 @@ margin-right: 5px; } +.share-autocomplete-item .autocomplete-item-typeInfo { + font-size: smaller; + font-style: italic; +} + .share-autocomplete-item .avatardiv { flex-shrink: 0; } diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index bfed8e2acffb..ee4453769013 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -54,8 +54,9 @@ '
' + '{{displayName}}' + '{{#if additionalInfo}}' + - '({{additionalInfo}})' + + '
({{additionalInfo}})' + '{{/if}}' + + '
{{typeInfo}}' + '
' + '' + '' + @@ -310,20 +311,20 @@ autocompleteRenderItem: function(ul, item) { var text = item.label; + var typeInfo = t('core', 'User'); if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { - text = t('core', '{sharee} (group)', { - sharee: text - }, null, {escape: false}); - } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) { + typeInfo = t('core', 'Group'); + } + if (item.value.shareType === OC.Share.SHARE_TYPE_GUEST) { + typeInfo = t('core', 'Guest'); + } + if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) { if (item.value.server) { - text = t('core', '{sharee} (at {server})', { - sharee: text, + typeInfo = t('core', 'At {server}', { server: item.value.server }); } else { - text = t('core', '{sharee} (federated)', { - sharee: text - }); + typeInfo = t('core', 'Federated'); } } @@ -331,6 +332,7 @@ var $el = $(template({ showAvatar: this.configModel.areAvatarsEnabled(), displayName: text, + typeInfo: typeInfo, additionalInfo: item.value.shareWithAdditionalInfo, shareTypeClass: (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) ? 'group' : 'user' })); diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 591e146bd2c0..04c58ae704ff 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/core/js/tests/specs/sharedialogviewSpec.js @@ -612,6 +612,14 @@ describe('OC.Share.ShareDialogView', function() { 'shareType': OC.Share.SHARE_TYPE_REMOTE, 'shareWith': 'foo2@bar.com/baz' } + }, + { + 'label': 'foo@knowncloud.com', + 'value': { + 'shareType': OC.Share.SHARE_TYPE_REMOTE, + 'shareWith': 'foo@knowncloud.com', + 'server': 'knowncloud.com' + } } ] } @@ -625,6 +633,13 @@ describe('OC.Share.ShareDialogView', function() { expect(response.getCall(0).args[0]).toEqual([{ 'label': 'foo2@bar.com/baz', 'value': {'shareType': OC.Share.SHARE_TYPE_REMOTE, 'shareWith': 'foo2@bar.com/baz'} + },{ + 'label': 'foo@knowncloud.com', + 'value': { + 'shareType': OC.Share.SHARE_TYPE_REMOTE, + 'shareWith': 'foo@knowncloud.com', + 'server': 'knowncloud.com' + } }]); expect(autocompleteStub.calledWith("option", "autoFocus", true)).toEqual(true); }); diff --git a/tests/acceptance/features/bootstrap/FederationContext.php b/tests/acceptance/features/bootstrap/FederationContext.php index 7642ea4db317..ab576545ed9e 100644 --- a/tests/acceptance/features/bootstrap/FederationContext.php +++ b/tests/acceptance/features/bootstrap/FederationContext.php @@ -58,6 +58,26 @@ class FederationContext implements Context { */ public function userFromServerSharesWithUserFromServerUsingTheSharingAPI( $sharerUser, $sharerServer, $sharerPath, $shareeUser, $shareeServer + ) { + $this->userFromServerSharesWithUserFromServerUsingTheSharingAPIWithPermissions( + $sharerUser, $sharerServer, $sharerPath, $shareeUser, $shareeServer + ); + } + + /** + * @When /^user "([^"]*)" from server "(LOCAL|REMOTE)" shares "([^"]*)" with user "([^"]*)" from server "(LOCAL|REMOTE)" using the sharing API with permissions (.*)$/ + * + * @param string $sharerUser + * @param string $sharerServer "LOCAL" or "REMOTE" + * @param string $sharerPath + * @param string $shareeUser + * @param string $shareeServer "LOCAL" or "REMOTE" + * @param int $permissions + * + * @return void + */ + public function userFromServerSharesWithUserFromServerUsingTheSharingAPIWithPermissions( + $sharerUser, $sharerServer, $sharerPath, $shareeUser, $shareeServer, $permissions = null ) { if ($shareeServer == "REMOTE") { $shareWith @@ -68,11 +88,11 @@ public function userFromServerSharesWithUserFromServerUsingTheSharingAPI( } $previous = $this->featureContext->usingServer($sharerServer); $this->featureContext->createShare( - $sharerUser, $sharerPath, 6, $shareWith, null, null, null + $sharerUser, $sharerPath, 6, $shareWith, null, null, $permissions ); $this->featureContext->usingServer($previous); } - + /** * @Given /^user "([^"]*)" from server "(LOCAL|REMOTE)" has shared "([^"]*)" with user "([^"]*)" from server "(LOCAL|REMOTE)"$/ * @@ -98,6 +118,32 @@ public function userFromServerHasSharedWithUserFromServer( ); } + /** + * @Given /^user "([^"]*)" from server "(LOCAL|REMOTE)" has shared "([^"]*)" with user "([^"]*)" from server "(LOCAL|REMOTE)" with permissions (.*)$/ + * + * @param string $sharerUser + * @param string $sharerServer "LOCAL" or "REMOTE" + * @param string $sharerPath + * @param string $shareeUser + * @param string $shareeServer "LOCAL" or "REMOTE" + * @param int $permissions + * + * @return void + */ + public function userFromServerHasSharedWithUserFromServerWithPermissions( + $sharerUser, $sharerServer, $sharerPath, $shareeUser, $shareeServer, $permissions = null + ) { + $this->userFromServerSharesWithUserFromServerUsingTheSharingAPIWithPermissions( + $sharerUser, $sharerServer, $sharerPath, $shareeUser, $shareeServer, $permissions + ); + $this->ocsContext->assertOCSResponseIndicatesSuccess( + 'Could not share file/folder! message: "' . + $this->ocsContext->getOCSResponseStatusMessage( + $this->featureContext->getResponse() + ) . '"' + ); + } + /** * @When /^user "([^"]*)" from server "(LOCAL|REMOTE)" accepts the last pending share using the sharing API$/ * diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 423f42a92f7c..3b6b6362ed27 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -127,7 +127,7 @@ public function getUserDisplayName($username) { } /** - * returns an array of the display names, keyed by username + * returns an array of the user display names, keyed by username * if no "Display Name" is set the user-name is returned instead * * @return array @@ -140,6 +140,22 @@ public function getCreatedUserDisplayNames() { return $result; } + /** + * returns an array of the group display names, keyed by group name + * currently group name and display name are always the same, so this + * function is a convenience for getting the group names in a similar + * format to what getCreatedUserDisplayNames() returns + * + * @return array + */ + public function getCreatedGroupDisplayNames() { + $result = []; + foreach ($this->getCreatedGroups() as $groupName => $groupData) { + $result[$groupName] = $groupName; + } + return $result; + } + /** * * @param string $username diff --git a/tests/acceptance/features/bootstrap/WebUISharingContext.php b/tests/acceptance/features/bootstrap/WebUISharingContext.php index 0b2e94ed92b5..286a2e66bc87 100644 --- a/tests/acceptance/features/bootstrap/WebUISharingContext.php +++ b/tests/acceptance/features/bootstrap/WebUISharingContext.php @@ -159,26 +159,9 @@ private function addToListOfCreatedPublicLinks($name, $url) { public function theUserSharesFileFolderWithUserUsingTheWebUI( $folder, $remote, $user, $maxRetries = STANDARD_RETRY_COUNT, $quiet = false ) { - $this->filesPage->waitTillPageIsloaded($this->getSession()); - try { - $this->filesPage->closeDetailsDialog(); - } catch (Exception $e) { - //we don't care - } - $this->sharingDialog = $this->filesPage->openSharingDialog( - $folder, $this->getSession() + $this->theUserSharesFileFolderWithUserOrGroupUsingTheWebUI( + $folder, "user", $remote, $user, $maxRetries, $quiet ); - $user = $this->featureContext->substituteInLineCodes($user); - if ($remote === "remote") { - $this->sharingDialog->shareWithRemoteUser( - $user, $this->getSession(), $maxRetries, $quiet - ); - } else { - $this->sharingDialog->shareWithUser( - $user, $this->getSession(), $maxRetries, $quiet - ); - } - $this->theUserClosesTheShareDialog(); } /** @@ -187,12 +170,33 @@ public function theUserSharesFileFolderWithUserUsingTheWebUI( * * @param string $folder * @param string $group + * @param int $maxRetries + * @param bool $quiet * * @return void * @throws \Exception */ public function theUserSharesFileFolderWithGroupUsingTheWebUI( - $folder, $group + $folder, $group, $maxRetries = STANDARD_RETRY_COUNT, $quiet = false + ) { + $this->theUserSharesFileFolderWithUserOrGroupUsingTheWebUI( + $folder, "group", "", $group, $maxRetries, $quiet + ); + } + + /** + * @param string $folder + * @param string $userOrGroup + * @param string $remote + * @param string $name + * @param int $maxRetries + * @param bool $quiet + * + * @return void + * @throws \Exception + */ + public function theUserSharesFileFolderWithUserOrGroupUsingTheWebUI( + $folder, $userOrGroup, $remote, $name, $maxRetries = STANDARD_RETRY_COUNT, $quiet = false ) { $this->filesPage->waitTillPageIsloaded($this->getSession()); try { @@ -203,7 +207,22 @@ public function theUserSharesFileFolderWithGroupUsingTheWebUI( $this->sharingDialog = $this->filesPage->openSharingDialog( $folder, $this->getSession() ); - $this->sharingDialog->shareWithGroup($group, $this->getSession()); + if ($userOrGroup === "user") { + $user = $this->featureContext->substituteInLineCodes($name); + if ($remote === "remote") { + $this->sharingDialog->shareWithRemoteUser( + $user, $this->getSession(), $maxRetries, $quiet + ); + } else { + $this->sharingDialog->shareWithUser( + $user, $this->getSession(), $maxRetries, $quiet + ); + } + } else { + $this->sharingDialog->shareWithGroup( + $name, $this->getSession(), $maxRetries, $quiet + ); + } $this->theUserClosesTheShareDialog(); } @@ -845,14 +864,42 @@ public function thePublicShouldNotGetAccessToPublicShareFile() { } /** - * @Then only :userOrGroupName should be listed in the autocomplete list on the webUI + * @Then only user :userName should be listed in the autocomplete list on the webUI + * + * @param string $userName + * + * @return void + */ + public function onlyUserNameShouldBeListedInTheAutocompleteList( + $userName + ) { + $this->onlyNameShouldBeListedInTheAutocompleteList( + $this->sharingDialog->userStringsToMatchAutoComplete($userName) + ); + } + + /** + * @Then only group :groupName should be listed in the autocomplete list on the webUI * - * @param string $userOrGroupName + * @param string $groupName * * @return void */ - public function onlyUserOrGroupNameShouldBeListedInTheAutocompleteList( - $userOrGroupName + public function onlyGroupNameShouldBeListedInTheAutocompleteList( + $groupName + ) { + $this->onlyNameShouldBeListedInTheAutocompleteList( + $this->sharingDialog->groupStringsToMatchAutoComplete($groupName) + ); + } + + /** + * @param string $autocompleteString the full text expected in the autocomplete item + * + * @return void + */ + public function onlyNameShouldBeListedInTheAutocompleteList( + $autocompleteString ) { $autocompleteItems = $this->sharingDialog->getAutocompleteItemsList(); PHPUnit\Framework\Assert::assertCount( @@ -861,9 +908,9 @@ public function onlyUserOrGroupNameShouldBeListedInTheAutocompleteList( "expected 1 autocomplete item but there are " . \count($autocompleteItems) ); PHPUnit\Framework\Assert::assertContains( - $userOrGroupName, + $autocompleteString, $autocompleteItems, - "'$userOrGroupName' not in autocomplete list" + "'$autocompleteString' not in autocomplete list" ); } @@ -878,7 +925,7 @@ public function allUsersAndGroupsThatContainTheStringInTheirNameShouldBeListedIn $requiredString ) { $this->allUsersAndGroupsThatContainTheStringInTheirNameShouldBeListedInTheAutocompleteListExcept( - $requiredString, '', '' + $requiredString, 'user', '' ); } @@ -898,27 +945,37 @@ public function allUsersAndGroupsThatContainTheStringInTheirNameShouldBeListedIn $notToBeListed = $this->sharingDialog->groupStringsToMatchAutoComplete($notToBeListed); } + if ($userOrGroup === 'user') { + $notToBeListed + = $this->sharingDialog->userStringsToMatchAutoComplete($notToBeListed); + } $autocompleteItems = $this->sharingDialog->getAutocompleteItemsList(); // Keep separate arrays of users and groups, because the names can overlap - $createdElements = []; - $createdElements['groups'] = $this->sharingDialog->groupStringsToMatchAutoComplete( - $this->featureContext->getCreatedGroups() + $createdElementsWithDisplayNames = []; + $createdElementsWithFullDisplayText = []; + $createdElementsWithDisplayNames['groups'] = $this->featureContext->getCreatedGroupDisplayNames(); + $createdElementsWithFullDisplayText['groups'] = $this->sharingDialog->groupStringsToMatchAutoComplete( + $createdElementsWithDisplayNames['groups'] + ); + $createdElementsWithDisplayNames['users'] = $this->featureContext->getCreatedUserDisplayNames(); + $createdElementsWithFullDisplayText['users'] = $this->sharingDialog->userStringsToMatchAutoComplete( + $createdElementsWithDisplayNames['users'] ); - $createdElements['users'] = $this->featureContext->getCreatedUserDisplayNames(); $numExpectedItems = 0; - foreach ($createdElements as $elementArray) { - foreach ($elementArray as $internalName => $displayName) { + foreach ($createdElementsWithFullDisplayText as $usersOrGroups => $elementArray) { + foreach ($elementArray as $internalName => $fullDisplayText) { + $displayName = $createdElementsWithDisplayNames[$usersOrGroups][$internalName]; // Matching should be case-insensitive on the internal or display name if (((\stripos($internalName, $requiredString) !== false) || (\stripos($displayName, $requiredString) !== false)) - && ($displayName !== $notToBeListed) + && ($fullDisplayText !== $notToBeListed) && ($displayName !== $this->featureContext->getCurrentUser()) && ($displayName !== $this->featureContext->getCurrentUserDisplayName()) ) { PHPUnit\Framework\Assert::assertContains( - $displayName, + $fullDisplayText, $autocompleteItems, - "'$displayName' not in autocomplete list" + "'$fullDisplayText' not in autocomplete list" ); $numExpectedItems = $numExpectedItems + 1; } @@ -944,7 +1001,9 @@ public function allUsersAndGroupsThatContainTheStringInTheirNameShouldBeListedIn */ public function theUsersOwnNameShouldNotBeListedInTheAutocompleteList() { PHPUnit\Framework\Assert::assertNotContains( - $this->filesPage->getMyDisplayname(), + $this->sharingDialog->userStringsToMatchAutoComplete( + $this->filesPage->getMyDisplayname() + ), $this->sharingDialog->getAutocompleteItemsList() ); } @@ -960,7 +1019,7 @@ public function theUsersOwnNameShouldNotBeListedInTheAutocompleteList() { public function userShouldBeListedInTheAutocompleteListOnTheWebui($username) { $names = $this->sharingDialog->getAutocompleteItemsList(); PHPUnit\Framework\Assert::assertContains( - $username, + $this->sharingDialog->userStringsToMatchAutoComplete($username), $names, "$username not found in autocomplete list" ); @@ -976,9 +1035,11 @@ public function userShouldBeListedInTheAutocompleteListOnTheWebui($username) { */ public function userShouldNotBeListedInTheAutocompleteListOnTheWebui($username) { $names = $this->sharingDialog->getAutocompleteItemsList(); - if (\in_array($username, $names)) { - throw new Exception("$username found in autocomplete list but not expected"); - } + $userString = $this->sharingDialog->userStringsToMatchAutoComplete($username); + PHPUnit\Framework\Assert::assertFalse( + \in_array($userString, $names), + "$username ($userString) found in autocomplete list but not expected" + ); } /** @@ -1171,28 +1232,38 @@ public function theNumberOfPublicLinksShouldBe($count) { } /** - * @Then /^it should not be possible to share (?:file|folder) "([^"]*)"(?: with "([^"]*)")? using the webUI$/ + * @Then /^it should not be possible to share (?:file|folder) "([^"]*)"(?: with (user|group) "([^"]*)")? using the webUI$/ * * @param string $fileName + * @param string $userOrGroup * @param string|null $shareWith * * @return void * @throws \Exception */ public function itShouldNotBePossibleToShareFileFolderUsingTheWebUI( - $fileName, $shareWith = null + $fileName, $userOrGroup = null, $shareWith = null ) { $sharingWasPossible = false; try { - $this->theUserSharesFileFolderWithUserUsingTheWebUI( - $fileName, null, $shareWith, 2, true + $this->theUserSharesFileFolderWithUserOrGroupUsingTheWebUI( + $fileName, $userOrGroup, "", $shareWith, 2, true ); $sharingWasPossible = true; } catch (ElementNotFoundException $e) { + if ($this->sharingDialog === null) { + $shareWithText = ""; + } else { + if ($userOrGroup === "user") { + $shareWithText = $this->sharingDialog->userStringsToMatchAutoComplete($shareWith); + } else { + $shareWithText = $this->sharingDialog->groupStringsToMatchAutoComplete($shareWith); + } + } $possibleMessages = [ "could not find share-with-field", "could not find sharing button in fileRow", - "could not share with '$shareWith'" + "could not share with '$shareWithText'" ]; $foundMessage = false; foreach ($possibleMessages as $message) { diff --git a/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php b/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php index 3a655e1818ed..a02d54c423a6 100644 --- a/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php +++ b/tests/acceptance/features/lib/FilesPageElement/SharingDialog.php @@ -46,8 +46,9 @@ class SharingDialog extends OwncloudPage { private $shareWithTooltipXpath = "/..//*[@class='tooltip-inner']"; private $shareWithAutocompleteListXpath = ".//ul[contains(@class,'ui-autocomplete')]"; private $autocompleteItemsTextXpath = "//*[@class='autocomplete-item-text']"; - private $suffixToIdentifyGroups = " (group)"; - private $suffixToIdentifyRemoteUsers = " (federated)"; + private $suffixToIdentifyGroups = " Group"; + private $suffixToIdentifyUsers = " User"; + private $suffixToIdentifyRemoteUsers = " Federated"; private $sharerInformationXpath = ".//*[@class='reshare']"; private $sharedWithAndByRegEx = "^(?:[A-Z]\s)?Shared with you(?: and the group (.*))? by (.*)$"; private $permissionsFieldByUserName = ".//*[@id='shareWithList']//*[@class='has-tooltip username' and .='%s']/.."; @@ -151,6 +152,25 @@ public function getAutocompleteNodeElement() { return $autocompleteNodeElement; } + /** + * returns the user names as they could appear in an autocomplete list + * + * @param string|array $userNames + * + * @return string|array + */ + public function userStringsToMatchAutoComplete($userNames) { + if (\is_array($userNames)) { + $autocompleteStrings = []; + foreach ($userNames as $userName => $userDisplayName) { + $autocompleteStrings[$userName] = $userDisplayName . $this->suffixToIdentifyUsers; + } + } else { + $autocompleteStrings = $userNames . $this->suffixToIdentifyUsers; + } + return $autocompleteStrings; + } + /** * returns the group names as they could appear in an autocomplete list * @@ -252,7 +272,8 @@ public function shareWithUser( $name, Session $session, $maxRetries = 5, $quiet = false ) { $this->shareWithUserOrGroup( - $name, $name, $session, $maxRetries, $quiet + $name, $name . $this->suffixToIdentifyUsers, + $session, $maxRetries, $quiet ); } diff --git a/tests/acceptance/features/webUIRestrictSharing/restrictSharing.feature b/tests/acceptance/features/webUIRestrictSharing/restrictSharing.feature index 44eddb2eed16..87d7b3ad044e 100644 --- a/tests/acceptance/features/webUIRestrictSharing/restrictSharing.feature +++ b/tests/acceptance/features/webUIRestrictSharing/restrictSharing.feature @@ -24,7 +24,7 @@ Feature: restrict Sharing Scenario: Restrict users to only share with users in their groups Given the setting "Restrict users to only share with users in their groups" in the section "Sharing" has been enabled When the user browses to the files page - Then it should not be possible to share folder "simple-folder" with "User Three" using the webUI + Then it should not be possible to share folder "simple-folder" with user "User Three" using the webUI When the user shares folder "simple-folder" with user "User One" using the webUI And the user re-logs in as "user1" using the webUI Then folder "simple-folder (2)" should be listed on the webUI @@ -34,7 +34,7 @@ Feature: restrict Sharing Scenario: Restrict users to only share with groups they are member of Given the setting "Restrict users to only share with groups they are member of" in the section "Sharing" has been enabled When the user browses to the files page - Then it should not be possible to share folder "simple-folder" with "grp2" using the webUI + Then it should not be possible to share folder "simple-folder" with group "grp2" using the webUI When the user shares folder "simple-folder" with group "grp1" using the webUI And the user re-logs in as "user1" using the webUI Then folder "simple-folder (2)" should be listed on the webUI @@ -55,8 +55,8 @@ Feature: restrict Sharing Scenario: Forbid sharing with groups Given the setting "Allow sharing with groups" in the section "Sharing" has been disabled When the user browses to the files page - Then it should not be possible to share folder "simple-folder" with "grp1" using the webUI - And it should not be possible to share folder "simple-folder" with "grp2" using the webUI + Then it should not be possible to share folder "simple-folder" with group "grp1" using the webUI + And it should not be possible to share folder "simple-folder" with group "grp2" using the webUI When the user shares folder "simple-folder" with user "User One" using the webUI And the user re-logs in as "user1" using the webUI Then folder "simple-folder (2)" should be listed on the webUI diff --git a/tests/acceptance/features/webUISharingAutocompletion/shareAutocompletion.feature b/tests/acceptance/features/webUISharingAutocompletion/shareAutocompletion.feature index f07e20960ea0..2ebc1c4b842d 100644 --- a/tests/acceptance/features/webUISharingAutocompletion/shareAutocompletion.feature +++ b/tests/acceptance/features/webUISharingAutocompletion/shareAutocompletion.feature @@ -70,7 +70,7 @@ Feature: Autocompletion of share-with names | use | %alt1% | Use | uz@oc.com.np | And the user has opened the share dialog for folder "simple-folder" When the user types "Use" in the share-with-field - Then only "Use" should be listed in the autocomplete list on the webUI + Then only user "Use" should be listed in the autocomplete list on the webUI And user "User Two" should not be listed in the autocomplete list on the webUI @skipOnLDAP @@ -83,7 +83,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "fi" in the share-with-field - Then only "fi (group)" should be listed in the autocomplete list on the webUI + Then only group "fi" should be listed in the autocomplete list on the webUI And user "finance1" should not be listed in the autocomplete list on the webUI @skipOnLDAP @@ -201,8 +201,8 @@ Feature: Autocompletion of share-with names @skipOnLDAP Scenario: autocompletion of a pattern where the username of the existing user contains the pattern somewhere in the end Given these users have been created with default attributes and skeleton files but not initialized: - | username | displayname | - | regularuser3 | Guest User | + | username | displayname | + | regularuser3 | Guest User | And user "user1" has logged in using the webUI And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" @@ -226,7 +226,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "finn" in the share-with-field - Then only "John Finn Smith" should be listed in the autocomplete list on the webUI + Then only user "John Finn Smith" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the name of existing user contains the pattern somewhere at the end @@ -234,7 +234,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "group" in the share-with-field - Then only "User Group" should be listed in the autocomplete list on the webUI + Then only user "User Group" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the email of the existing user contains the pattern somewhere at the beginning @@ -242,7 +242,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "u2" in the share-with-field - Then only "User Two" should be listed in the autocomplete list on the webUI + Then only user "User Two" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the email of the existing user contains the pattern somewhere at the middle @@ -250,7 +250,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "net" in the share-with-field - Then only "User Group" should be listed in the autocomplete list on the webUI + Then only user "User Group" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the email of the existing user contains the pattern somewhere at the end @@ -258,7 +258,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "de" in the share-with-field - Then only "John Finn Smith" should be listed in the autocomplete list on the webUI + Then only user "John Finn Smith" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the name of existing group contains the pattern somewhere in the middle but group medial search is disabled @@ -293,25 +293,25 @@ Feature: Autocompletion of share-with names Scenario: autocompletion of a pattern where the user name contains the pattern somewhere in the middle but accounts medial search is disabled Given these users have been created with default attributes and skeleton files but not initialized: | username | displayname | - | ivan | Ivan | + | ivan | Ivan | And user "user1" has logged in using the webUI And the administrator has added system config key "accounts.enable_medial_search" with value "false" and type "boolean" And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "iv" in the share-with-field - Then only "Ivan" should be listed in the autocomplete list on the webUI + Then only user "Ivan" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the user name contains the pattern somewhere in the end but accounts medial search is disabled Given these users have been created with default attributes and skeleton files but not initialized: - | username | displayname | - | regularuser3 | Guest User | + | username | displayname | + | regularuser3 | Guest User | And user "user1" has logged in using the webUI And the administrator has added system config key "accounts.enable_medial_search" with value "false" and type "boolean" And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "user3" in the share-with-field - Then only "User Three" should be listed in the autocomplete list on the webUI + Then only user "User Three" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the name of existing user contains the pattern somewhere in the middle but accounts medial search is disabled @@ -323,19 +323,19 @@ Feature: Autocompletion of share-with names And the administrator has added system config key "accounts.enable_medial_search" with value "false" and type "boolean" And the user has opened the share dialog for folder "simple-folder" When the user types "finn" in the share-with-field - Then only "finnance typo" should be listed in the autocomplete list on the webUI + Then only user "finnance typo" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the display name of existing user contains the pattern somewhere in the end but accounts medial search is disabled Given these users have been created with default attributes and skeleton files but not initialized: - | username | displayname | - | user2 | Group User | + | username | displayname | + | user2 | Group User | And user "user1" has logged in using the webUI And the administrator has added system config key "accounts.enable_medial_search" with value "false" and type "boolean" And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "group" in the share-with-field - Then only "Group User" should be listed in the autocomplete list on the webUI + Then only user "Group User" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the email of the existing user contains the pattern somewhere at the beginning but accounts medial search is disabled @@ -347,19 +347,19 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "u2" in the share-with-field - Then only "User Two" should be listed in the autocomplete list on the webUI + Then only user "User Two" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the email of the existing user contains the pattern somewhere at the middle but accounts medial search is disabled Given these users have been created with default attributes and skeleton files but not initialized: - | username | displayname | email | + | username | displayname | email | | user2 | User2 | net@oc.com.np | And user "user1" has logged in using the webUI And the administrator has added system config key "accounts.enable_medial_search" with value "false" and type "boolean" And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "net" in the share-with-field - Then only "User2" should be listed in the autocomplete list on the webUI + Then only user "User2" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: autocompletion of a pattern where the email of the existing user contains the pattern somewhere at the end but accounts medial search is disabled @@ -371,7 +371,7 @@ Feature: Autocompletion of share-with names And the user has browsed to the files page And the user has opened the share dialog for folder "simple-folder" When the user types "de" in the share-with-field - Then only "User2" should be listed in the autocomplete list on the webUI + Then only user "User2" should be listed in the autocomplete list on the webUI @skipOnLDAP Scenario: allow user to disable autocomplete in sharing dialog diff --git a/tests/acceptance/features/webUISharingExternal/federationSharing.feature b/tests/acceptance/features/webUISharingExternal/federationSharing.feature index 0a5db836a249..e48ab6add61b 100644 --- a/tests/acceptance/features/webUISharingExternal/federationSharing.feature +++ b/tests/acceptance/features/webUISharingExternal/federationSharing.feature @@ -125,11 +125,9 @@ Feature: Federation Sharing - sharing with users on other cloud storages @skipOnMICROSOFTEDGE Scenario: share a folder with an remote user and prohibit deleting - remote server shares - local server receives - When user "user1" re-logs in to "%remote_server%" using the webUI - And the user shares folder "simple-folder" with remote user "user1@%local_server_without_scheme%" using the webUI - And the user sets the sharing permissions of "user1@%local_server_without_scheme% (federated)" for "simple-folder" using the webUI to - | delete | no | - And user "user1" re-logs in to "%local_server%" using the webUI + # permissions read+update+create = 7 (no delete, no (re)share permission) + Given user "user1" from server "REMOTE" has shared "simple-folder" with user "user1" from server "LOCAL" with permissions 7 + When the user browses to the files page And the user accepts the offered remote shares using the webUI And the user opens folder "simple-folder (2)" using the webUI Then it should not be possible to delete file "lorem.txt" using the webUI