diff --git a/.drone.star b/.drone.star index b4236f8d017..321104af761 100644 --- a/.drone.star +++ b/.drone.star @@ -83,7 +83,6 @@ config = { "skip": False, "tikaNeeded": True, "suites": [ - "search", "shares", ], "extraServerEnvironment": { diff --git a/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts b/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts index fd74dfaa7c6..6b81743f659 100644 --- a/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts +++ b/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts @@ -98,11 +98,15 @@ test.describe('deny share access', () => { // allow access - deleting "Cannot access" share - await ui.userRemovesSharee({ + await ui.userRemovesSharees({ world, stepUser: 'Alice', - resource: 'folder_to_deny', - recipient: 'Brian' + sharees: [ + { + resource: 'folder_to_deny', + recipient: 'Brian' + } + ] }) await ui.userOpensApplication({ world, stepUser: 'Brian', name: 'files' }) await ui.userNavigatesToSharedWithMePage({ world, stepUser: 'Brian' }) diff --git a/tests/e2e-playwright/specs/shares/share.spec.ts b/tests/e2e-playwright/specs/shares/share.spec.ts index 08941a20496..ec458619aef 100644 --- a/tests/e2e-playwright/specs/shares/share.spec.ts +++ b/tests/e2e-playwright/specs/shares/share.spec.ts @@ -183,11 +183,15 @@ test.describe('share', () => { // And "Alice" removes following sharee // | resource | recipient | // | folder_to_shared_2 | Brian | - await ui.userRemovesSharee({ + await ui.userRemovesSharees({ world, stepUser: 'Alice', - resource: 'folder_to_shared_2', - recipient: 'Brian' + sharees: [ + { + resource: 'folder_to_shared_2', + recipient: 'Brian' + } + ] }) // When "Alice" deletes the following resources using the sidebar panel @@ -223,4 +227,420 @@ test.describe('share', () => { // And "Brian" logs out await ui.userLogsOut({ world, stepUser: 'Brian' }) }) + + test('share with expiration date', async ({ world }) => { + // Given "Admin" creates following group using API + // | id | + // | sales | + await api.groupsHaveBeenCreated({ + world, + groupIds: ['sales'], + stepUser: 'Admin' + }) + // And "Admin" adds user to the group using API + // | user | group | + // | Brian | sales | + await api.usersHaveBeenAddedToGroup({ + world, + stepUser: 'Admin', + usersToAdd: [{ user: 'Brian', group: 'sales' }] + }) + + // And "Alice" creates the following folder in personal space using API + // | name | + // | myfolder | + // | mainFolder | + await api.userHasCreatedFolders({ + world, + stepUser: 'Alice', + folderNames: ['myfolder', 'mainFolder'] + }) + // And "Alice" creates the following files into personal space using API + // | pathToFile | content | + // | new.txt | some content | + // | mainFolder/lorem.txt | lorem epsum | + await api.userHasCreatedFiles({ + world, + stepUser: 'Alice', + files: [ + { pathToFile: 'new.txt', content: 'some content' }, + { pathToFile: 'mainFolder/lorem.txt', content: 'lorem epsum' } + ] + }) + // And "Alice" logs In + await ui.userLogsIn({ world, stepUser: 'Alice' }) + // When "Alice" shares the following resource using the sidebar panel + // | resource | recipient | type | role | resourceType | expirationDate | + // | new.txt | Brian | user | Can edit with trashbin | file | +5 days | + // | myfolder | sales | group | Can view | folder | +10 days | + // | mainFolder | Brian | user | Can edit with trashbin | folder | | + await ui.userSharesResources({ + world, + stepUser: 'Alice', + actionType: 'SIDEBAR_PANEL', + shares: [ + { + resource: 'new.txt', + recipient: 'Brian', + type: 'user', + role: 'Can edit with trashbin', + resourceType: 'file', + expirationDate: '+5 days' + }, + { + resource: 'myfolder', + recipient: 'sales', + type: 'group', + role: 'Can view', + resourceType: 'folder', + expirationDate: '+10 days' + }, + { + resource: 'mainFolder', + recipient: 'Brian', + type: 'user', + role: 'Can edit with trashbin', + resourceType: 'folder' + } + ] + }) + + // set expirationDate to existing share + // And "Alice" sets the expiration date of share "mainFolder" of user "Brian" to "+5 days" + await ui.userSetsExpirationDateOfShare({ + world, + stepUser: 'Alice', + resource: 'mainFolder', + collaboratorName: 'Brian', + collaboratorType: 'user', + expirationDate: '+5 days' + }) + + // And "Alice" checks the following access details of share "mainFolder" for user "Brian" + // | Name | Brian Murphy | + // | Type | User | + await ui.userChecksAccessDetailsOfShare({ + world, + stepUser: 'Alice', + resource: 'mainFolder', + sharee: { name: 'Brian', type: 'user' }, + accessDetails: { + Name: 'Brian Murphy', + Type: 'User' + } + }) + + // And "Alice" checks the following access details of share "mainFolder/lorem.txt" for user "Brian" + // | Name | Brian Murphy | + // | Type | User | + await ui.userChecksAccessDetailsOfShare({ + world, + stepUser: 'Alice', + resource: 'mainFolder/lorem.txt', + sharee: { name: 'Brian', type: 'user' }, + accessDetails: { + Name: 'Brian Murphy', + Type: 'User' + } + }) + // And "Alice" sets the expiration date of share "myfolder" of group "sales" to "+3 days" + await ui.userSetsExpirationDateOfShare({ + world, + stepUser: 'Alice', + resource: 'myfolder', + collaboratorName: 'sales', + collaboratorType: 'group', + expirationDate: '+3 days' + }) + // And "Alice" checks the following access details of share "myfolder" for group "sales" + // | Name | sales department | + // | Type | Group | + await ui.userChecksAccessDetailsOfShare({ + world, + stepUser: 'Alice', + resource: 'myfolder', + sharee: { name: 'sales', type: 'group' }, + accessDetails: { + Name: 'sales department', + Type: 'Group' + } + }) + // remove share with group + // When "Alice" removes following sharee + // | resource | recipient | type | + // | myfolder | sales | group | + await ui.userRemovesSharees({ + world, + stepUser: 'Alice', + sharees: [ + { + resource: 'myfolder', + recipient: 'sales', + type: 'group' + } + ] + }) + // And "Alice" logs out + await ui.userLogsOut({ world, stepUser: 'Alice' }) + }) + + test('receive two shares with same name', async ({ world }) => { + // Given "Admin" creates following users using API + // | id | + // | Carol | + await api.usersHaveBeenCreated({ + world, + stepUser: 'Admin', + users: ['Carol'] + }) + // And "Alice" creates the following folder in personal space using API + // | name | + // | test-folder | + await api.userHasCreatedFolders({ + world, + stepUser: 'Alice', + folderNames: ['test-folder'] + }) + // And "Alice" creates the following files into personal space using API + // | pathToFile | content | + // | testfile.txt | example text | + await api.userHasCreatedFiles({ + world, + stepUser: 'Alice', + files: [ + { + pathToFile: 'testfile.txt', + content: 'example text' + } + ] + }) + // And "Alice" logs in + await ui.userLogsIn({ world, stepUser: 'Alice' }) + // And "Alice" shares the following resource using the sidebar panel + // | resource | recipient | type | role | + // | testfile.txt | Brian | user | Can view | + // | test-folder | Brian | user | Can view | + await ui.userSharesResources({ + world, + stepUser: 'Alice', + actionType: 'SIDEBAR_PANEL', + shares: [ + { + resource: 'testfile.txt', + recipient: 'Brian', + type: 'user', + role: 'Can view', + resourceType: 'file' + }, + { + resource: 'test-folder', + recipient: 'Brian', + type: 'user', + role: 'Can view', + resourceType: 'folder' + } + ] + }) + // And "Alice" logs out + await ui.userLogsOut({ world, stepUser: 'Alice' }) + // And "Carol" creates the following folder in personal space using API + // | name | + // | test-folder | + await api.userHasCreatedFolders({ + world, + stepUser: 'Carol', + folderNames: ['test-folder'] + }) + // And "Carol" creates the following files into personal space using API + // | pathToFile | content | + // | testfile.txt | example text | + await api.userHasCreatedFiles({ + world, + stepUser: 'Carol', + files: [ + { + pathToFile: 'testfile.txt', + content: 'example text' + } + ] + }) + // And "Carol" logs in + await ui.userLogsIn({ world, stepUser: 'Carol' }) + // And "Carol" shares the following resource using the sidebar panel + // | resource | recipient | type | role | + // | testfile.txt | Brian | user | Can view | + // | test-folder | Brian | user | Can view | + await ui.userSharesResources({ + world, + stepUser: 'Carol', + actionType: 'SIDEBAR_PANEL', + shares: [ + { + resource: 'testfile.txt', + recipient: 'Brian', + type: 'user', + role: 'Can view', + resourceType: 'file' + }, + { + resource: 'test-folder', + recipient: 'Brian', + type: 'user', + role: 'Can view', + resourceType: 'folder' + } + ] + }) + // And "Carol" logs out + await ui.userLogsOut({ world, stepUser: 'Carol' }) + // When "Brian" logs in + await ui.userLogsIn({ world, stepUser: 'Brian' }) + // And "Brian" navigates to the shared with me page + await ui.userNavigatesToSharedWithMePage({ world, stepUser: 'Brian' }) + // Then following resources should be displayed in the Shares for user "Brian" + // | resource | + // | testfile.txt | + // | test-folder | + // # https://github.com/owncloud/ocis/issues/8471 + // | testfile (1).txt | + // | test-folder (1) | + await ui.userShouldSeeResources({ + world, + listType: 'Shares', + stepUser: 'Brian', + resources: ['testfile.txt', 'test-folder', 'testfile (1).txt', 'test-folder (1)'] + }) + // And "Brian" logs out + await ui.userLogsOut({ world, stepUser: 'Brian' }) + }) + + test('check file with same name but different paths are displayed correctly in shared with others page', async ({ + world + }) => { + // Given "Admin" creates following users using API + // | id | + // | Carol | + await api.usersHaveBeenCreated({ + world, + stepUser: 'Admin', + users: ['Carol'] + }) + // And "Alice" creates the following folder in personal space using API + // | name | + // | test-folder | + await api.userHasCreatedFolders({ + world, + stepUser: 'Alice', + folderNames: ['test-folder'] + }) + // And "Alice" creates the following files into personal space using API + // | pathToFile | content | + // | testfile.txt | example text | + // | test-folder/testfile.txt | some text | + await api.userHasCreatedFiles({ + world, + stepUser: 'Alice', + files: [ + { + pathToFile: 'testfile.txt', + content: 'example text' + }, + { + pathToFile: 'test-folder/testfile.txt', + content: 'some text' + } + ] + }) + // And "Alice" shares the following resource using API + // | resource | recipient | type | role | + // | testfile.txt | Brian | user | Can edit with trashbin | + // | test-folder/testfile.txt | Brian | user | Can edit with trashbin | + await api.userHasSharedResources({ + world, + stepUser: 'Alice', + shares: [ + { + resource: 'testfile.txt', + recipient: 'Brian', + type: 'user', + role: 'Can edit with trashbin', + resourceType: 'file' + }, + { + resource: 'test-folder/testfile.txt', + recipient: 'Brian', + type: 'user', + role: 'Can edit with trashbin', + resourceType: 'file' + } + ] + }) + // And "Alice" logs in + await ui.userLogsIn({ world, stepUser: 'Alice' }) + // And "Alice" navigates to the shared with others page + await ui.userNavigatesToSharedWithOthersPage({ world, stepUser: 'Alice' }) + // Then following resources should be displayed in the files list for user "Alice" + // | resource | + // | testfile.txt | + // | test-folder/testfile.txt | + await ui.userShouldSeeResources({ + world, + listType: 'files list', + stepUser: 'Alice', + resources: ['testfile.txt', 'test-folder/testfile.txt'] + }) + // And "Alice" logs out + await ui.userLogsOut({ world, stepUser: 'Alice' }) + }) + + test('share indication', async ({ world }) => { + // When "Alice" creates the following folders in personal space using API + // | name | + // | shareFolder/subFolder | + await api.userHasCreatedFolders({ + world, + stepUser: 'Alice', + folderNames: ['shareFolder/subFolder'] + }) + // And "Alice" shares the following resource using API + // | resource | recipient | type | role | resourceType | + // | shareFolder | Brian | user | Can edit with trashbin | folder | + await api.userHasSharedResources({ + world, + stepUser: 'Alice', + shares: [ + { + resource: 'shareFolder', + recipient: 'Brian', + type: 'user', + role: 'Can edit with trashbin', + resourceType: 'folder' + } + ] + }) + // And "Alice" logs in + await ui.userLogsIn({ world, stepUser: 'Alice' }) + // Then "Alice" should see user-direct indicator on the folder "shareFolder" + await ui.userShouldSeeShareIndicatorOnResource({ + world, + stepUser: 'Alice', + buttonLabel: 'user-direct', + resource: 'shareFolder' + }) + // When "Alice" opens folder "shareFolder" + await ui.userOpensResource({ + world, + stepUser: 'Alice', + resource: 'shareFolder' + }) + // Then "Alice" should see user-indirect indicator on the folder "subFolder" + await ui.userShouldSeeShareIndicatorOnResource({ + world, + stepUser: 'Alice', + buttonLabel: 'user-indirect', + resource: 'subFolder' + }) + // And "Alice" logs out + await ui.userLogsOut({ world, stepUser: 'Alice' }) + }) }) diff --git a/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts b/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts index c6c41c7b195..86ee53b113f 100644 --- a/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts +++ b/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts @@ -106,11 +106,15 @@ test.describe('deny space access', () => { // When "Alice" removes following sharee // | resource | recipient | // | f1 | Brian | - await ui.userRemovesSharee({ + await ui.userRemovesSharees({ world, stepUser: 'Alice', - resource: 'f1', - recipient: 'Brian' + sharees: [ + { + resource: 'f1', + recipient: 'Brian' + } + ] }) // And "Brian" navigates to the project space "sales" diff --git a/tests/e2e-playwright/specs/user-settings/notifications.spec.ts b/tests/e2e-playwright/specs/user-settings/notifications.spec.ts index 8a756164b2f..6377f9d7224 100644 --- a/tests/e2e-playwright/specs/user-settings/notifications.spec.ts +++ b/tests/e2e-playwright/specs/user-settings/notifications.spec.ts @@ -127,11 +127,15 @@ test.describe('Notifications', () => { // When "Alice" removes following sharee // | resource | recipient | // | folder_to_shared | Brian | - await ui.userRemovesSharee({ + await ui.userRemovesSharees({ world, stepUser: 'Alice', - resource: 'folder_to_shared', - recipient: 'Brian' + sharees: [ + { + resource: 'folder_to_shared', + recipient: 'Brian' + } + ] }) // And "Alice" navigates to the project space "team.1" @@ -323,11 +327,15 @@ test.describe('Notifications', () => { // When "Alice" removes following sharee // | resource | recipient | // | folder_to_shared | Brian | - await ui.userRemovesSharee({ + await ui.userRemovesSharees({ world, stepUser: 'Alice', - resource: 'folder_to_shared', - recipient: 'Brian' + sharees: [ + { + resource: 'folder_to_shared', + recipient: 'Brian' + } + ] }) // And "Alice" navigates to the project space "team.1" diff --git a/tests/e2e-playwright/steps/api/api.ts b/tests/e2e-playwright/steps/api/api.ts index 4f8ec51e0ca..e6345be412d 100644 --- a/tests/e2e-playwright/steps/api/api.ts +++ b/tests/e2e-playwright/steps/api/api.ts @@ -87,7 +87,7 @@ export async function userHasSharedResources({ recipient: string type: string role: string - resourceType: string + resourceType?: string }[] }): Promise { const user = world.usersEnvironment.getUser({ key: stepUser }) diff --git a/tests/e2e-playwright/steps/ui/resources.ts b/tests/e2e-playwright/steps/ui/resources.ts index 7e9b532b828..a00f9314186 100644 --- a/tests/e2e-playwright/steps/ui/resources.ts +++ b/tests/e2e-playwright/steps/ui/resources.ts @@ -1315,3 +1315,24 @@ export const userCopiesResourcesAtOnce = (args) => export const userMovesResourcesAtOnce = (args) => performCopyOrMoveMultipleResources({ ...args, actionType: 'move' }) + +export async function userShouldSeeShareIndicatorOnResource({ + world, + stepUser, + buttonLabel, + resource +}: { + world: World + stepUser: string + buttonLabel: 'link-direct' | 'link-indirect' | 'user-direct' | 'user-indirect' + resource: string +}): Promise { + const { page } = world.actorsEnvironment.getActor({ key: stepUser }) + const resourceObject = new objects.applicationFiles.Resource({ page }) + const showShareIndicator = resourceObject.showShareIndicatorSelector({ + buttonLabel, + resource + }) + + await expect(showShareIndicator).toBeVisible() +} diff --git a/tests/e2e-playwright/steps/ui/shares.ts b/tests/e2e-playwright/steps/ui/shares.ts index 9d61b69960d..d5adcdd0108 100644 --- a/tests/e2e-playwright/steps/ui/shares.ts +++ b/tests/e2e-playwright/steps/ui/shares.ts @@ -175,23 +175,32 @@ export async function userSharesResources({ } } -export async function userRemovesSharee({ +export async function userRemovesSharees({ world, stepUser, - resource, - recipient + sharees }: { world: World stepUser: string - resource: string - recipient: string + sharees: { resource: string; recipient: string; type?: 'group' | 'user' }[] }): Promise { const { page } = world.actorsEnvironment.getActor({ key: stepUser }) const shareObject = new objects.applicationFiles.Share({ page }) - await shareObject.removeSharee({ - resource, - recipients: [{ collaborator: world.usersEnvironment.getUser({ key: recipient }) }] - }) + + for (const sharee of sharees) { + await shareObject.removeSharee({ + resource: sharee.resource, + recipients: [ + { + collaborator: + sharee.type === 'group' + ? world.usersEnvironment.getGroup({ key: sharee.recipient }) + : world.usersEnvironment.getUser({ key: sharee.recipient }), + type: sharee.type as CollaboratorType + } + ] + }) + } } export async function userAddsUsersToProjectSpace({ @@ -393,7 +402,7 @@ export async function userChecksAccessDetailsOfShare({ const { page } = world.actorsEnvironment.getActor({ key: stepUser }) const shareObject = new objects.applicationFiles.Share({ page }) - let selectorType = sharee.name + let selectorType = sharee.type // NOTE: external users have group type element selector if (accessDetails.hasOwnProperty('Type') && accessDetails.Type === 'External') { selectorType = 'group' @@ -440,3 +449,31 @@ export async function userShouldSeeAccessDetailsOfShareForFederatedUser({ expect(actualDetails).toHaveProperty(detail) } + +export async function userSetsExpirationDateOfShare({ + world, + stepUser, + resource, + collaboratorType, + collaboratorName, + expirationDate +}: { + world: World + stepUser: string + resource: string + collaboratorType: 'user' | 'group' + collaboratorName: string + expirationDate: string +}): Promise { + const { page } = world.actorsEnvironment.getActor({ key: stepUser }) + const shareObject = new objects.applicationFiles.Share({ page }) + const collaborator = + collaboratorType === 'group' + ? world.usersEnvironment.getGroup({ key: collaboratorName }) + : world.usersEnvironment.getUser({ key: collaboratorName }) + await shareObject.addExpirationDate({ + resource, + collaborator: { collaborator, type: collaboratorType } as ICollaborator, + expirationDate + }) +} diff --git a/tests/e2e/cucumber/features/search/search.feature b/tests/e2e/cucumber/features/search/search.feature deleted file mode 100644 index ed0957ff905..00000000000 --- a/tests/e2e/cucumber/features/search/search.feature +++ /dev/null @@ -1,247 +0,0 @@ -@predefined-users -Feature: Search - As a user - I want to search for resources - So that I can find them quickly - - Scenario: Search in personal spaces - Given "Admin" creates following users using API - | id | - | Alice | - | Brian | - And "Brian" logs in - And "Alice" logs in - And "Brian" creates the following folder in personal space using API - | name | - | new_share_from_brian | - And "Brian" uploads the following local file into personal space using API - | localFile | to | - | filesForUpload/new-lorem-big.txt | new-lorem-big.txt | - And "Brian" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | new_share_from_brian | Alice | user | Can view | folder | - | new-lorem-big.txt | Alice | user | Can view | file | - And "Brian" logs out - - And "Alice" creates the following resources - | resource | type | - | folder | folder | - | FolDer/child-one/child-two | folder | - | strängéनेपालीName | folder | - And "Alice" enables the option to display the hidden file - And "Alice" uploads the following resources - | resource | - | .hidden-file.txt | - - # search for objects of personal space - When "Alice" searches "foldeR" using the global search and the "all files" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | folder | - | FolDer | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | new_share_from_brian | - | new-lorem-big.txt | - | .hidden-file.txt | - - # search for hidden file - When "Alice" searches "hidden" using the global search and the "all files" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | .hidden-file.txt | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | folder | - | FolDer | - | PARENT | - | new-lorem-big.txt | - - # subfolder search - And "Alice" searches "child" using the global search and the "all files" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | child-one | - | child-two | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | folder | - | FolDer | - | folder_from_brian | - | .hidden-file.txt | - | new-lorem-big.txt | - - # received shares search - And "Alice" searches "NEW" using the global search and the "all files" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | new_share_from_brian | - | new-lorem-big.txt | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | folder | - | FolDer | - | .hidden-file.txt | - And "Alice" opens the "files" app - - # search renamed resources - When "Alice" renames the following resource - | resource | as | - | folder | renamedFolder | - | FolDer | renamedFolDer | - And "Alice" searches "rena" using the global search and the "all files" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | renamedFolder | - | renamedFolDer | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | folder | - | FolDer | - - - # search difficult names - When "Alice" searches "strängéनेपालीName" using the global search and the "all files" filter and presses enter - And "Alice" enables the option to search title only - Then following resources should be displayed in the files list for user "Alice" - | strängéनेपालीName | - - # deleting folder from search result and search deleted resource - When "Alice" deletes the following resource using the sidebar panel - | resource | from | - | strängéनेपालीName | | - And "Alice" searches "forDeleting" using the global search and the "all files" filter - Then following resources should not be displayed in the search list for user "Alice" - | resource | - | strängéनेपालीName | - - And "Alice" logs out - - - Scenario: Search using "current folder" filter - Given "Admin" creates following users using API - | id | - | Alice | - And "Alice" logs in - And "Alice" creates the following folders in personal space using API - | name | - | mainFolder/subFolder | - And "Alice" creates the following files into personal space using API - | pathToFile | content | - | exampleInsideThePersonalSpace.txt | I'm in the personal Space | - | mainFolder/exampleInsideTheMainFolder.txt | I'm in the main folder | - | mainFolder/subFolder/exampleInsideTheSubFolder.txt | I'm in the sub folder | - When "Alice" opens folder "mainFolder" - And "Alice" searches "example" using the global search and the "all files" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | exampleInsideThePersonalSpace.txt | - | exampleInsideTheMainFolder.txt | - | exampleInsideTheSubFolder.txt | - - When "Alice" searches "example" using the global search and the "current folder" filter - Then following resources should be displayed in the search list for user "Alice" - | resource | - | exampleInsideTheMainFolder.txt | - | exampleInsideTheSubFolder.txt | - But following resources should not be displayed in the search list for user "Alice" - | resource | - | exampleInsideThePersonalSpace.txt | - And "Alice" logs out - - - Scenario: Search using mediaType filter - Given "Admin" creates following users using API - | id | - | Alice | - And "Alice" logs in - And "Alice" creates the following folders in personal space using API - | name | - | mediaTest | - And "Alice" uploads the following local file into personal space using API - | localFile | to | - | filesForUpload/testavatar.jpg | mediaTest.jpg | - And "Alice" creates the following files into personal space using API - | pathToFile | content | - | mediaTest.txt | I'm a Document | - | mediaTest.pdf | I'm a PDF | - | mediaTest.mp3 | I'm a Audio | - | mediaTest.zip | I'm a Archive | - And "Alice" searches "mediaTest" using the global search and the "all files" filter and presses enter - And "Alice" selects mediaType "Document" from the search result filter chip - And "Alice" enables the option to search title only - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mediaTest.txt | - And "Alice" clears mediaType filter - When "Alice" selects mediaType "PDF" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mediaTest.pdf | - And "Alice" clears mediaType filter - When "Alice" selects mediaType "Audio" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mediaTest.mp3 | - And "Alice" clears mediaType filter - When "Alice" selects mediaType "Archive" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mediaTest.zip | - And "Alice" clears mediaType filter - # multiple choose - When "Alice" selects mediaType "Folder" from the search result filter chip - And "Alice" selects mediaType "Image" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mediaTest | - | mediaTest.jpg | - But following resources should not be displayed in the files list for user "Alice" - | resource | - | mediaTest.txt | - | mediaTest.pdf | - | mediaTest.mp3 | - | mediaTest.zip | - And "Alice" logs out - - - Scenario: Search using lastModified filter - Given "Admin" creates following users using API - | id | - | Alice | - And "Alice" logs in - And "Alice" creates the following folders in personal space using API - | name | - | mainFolder | - And "Alice" creates the following files with mtime into personal space using API - | pathToFile | content | mtimeDeltaDays | - | mainFolder/mediaTest.pdf | created 29 days ago | -29 days | - | mainFolder/mediaTest.txt | created 5 days ago | -5 days | - | mainFolder/mediaTest.md | created today | | - When "Alice" opens folder "mainFolder" - And "Alice" searches "mediaTest" using the global search and the "current folder" filter and presses enter - And "Alice" enables the option to search title only - And "Alice" selects lastModified "last 30 days" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mainFolder/mediaTest.pdf | - | mainFolder/mediaTest.txt | - | mainFolder/mediaTest.md | - When "Alice" selects lastModified "last 7 days" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mainFolder/mediaTest.txt | - | mainFolder/mediaTest.md | - But following resources should not be displayed in the files list for user "Alice" - | resource | - | mainFolder/mediaTest.pdf | - When "Alice" selects lastModified "today" from the search result filter chip - Then following resources should be displayed in the files list for user "Alice" - | resource | - | mainFolder/mediaTest.md | - But following resources should not be displayed in the files list for user "Alice" - | resource | - | mainFolder/mediaTest.pdf | - | mainFolder/mediaTest.txt | - And "Alice" clears lastModified filter - And "Alice" logs out diff --git a/tests/e2e/cucumber/features/search/web-packages.txt b/tests/e2e/cucumber/features/search/web-packages.txt deleted file mode 100644 index b3c4e5fc6f0..00000000000 --- a/tests/e2e/cucumber/features/search/web-packages.txt +++ /dev/null @@ -1,9 +0,0 @@ -###################################################################### -# USED FOR CI ONLY # -# Run the test suite only if the changes are in the listed packages. # -# # -# List of web packages that affect this test suite. # -###################################################################### - -web-app-files -web-app-search \ No newline at end of file diff --git a/tests/e2e/cucumber/features/shares/share.feature b/tests/e2e/cucumber/features/shares/share.feature deleted file mode 100644 index 175fd9cd461..00000000000 --- a/tests/e2e/cucumber/features/shares/share.feature +++ /dev/null @@ -1,190 +0,0 @@ -Feature: share - - Background: - Given "Admin" creates following users using API - | id | - | Alice | - | Brian | - - @predefined-users - Scenario: file - Given "Alice" logs in - And "Brian" logs in - And "Alice" creates the following resources - | resource | type | content | - | shareToBrian.txt | txtFile | some text | - | shareToBrian.md | mdFile | readme | - | sharedFile.txt | txtFile | some text | - And "Alice" edits the following resources - | resource | content | - | shareToBrian.txt | new content edited | - | shareToBrian.md | new readme content edited | - And "Alice" uploads the following resource - | resource | - | simple.pdf | - | testavatar.jpeg | - When "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | shareToBrian.txt | Brian | user | Can edit with trashbin | file | - | shareToBrian.md | Brian | user | Can edit with trashbin | file | - | testavatar.jpeg | Brian | user | Can view | file | - | simple.pdf | Brian | user | Can edit with trashbin | file | - | sharedFile.txt | Brian | user | Can edit with trashbin | file | - And "Alice" navigates to the shared with others page - And "Alice" opens the following file in mediaviewer - | resource | - | testavatar.jpeg | - Then "Alice" is in a media-viewer - And "Alice" closes the file viewer - - When "Brian" navigates to the shared with me page - And "Brian" disables the sync for the following share - | name | - | sharedFile.txt | - # user should have access to unsynced shares - And "Brian" opens the following file in texteditor - | resource | - | sharedFile.txt | - And "Brian" closes the file viewer - And "Brian" edits the following resources - | resource | content | - | shareToBrian.txt | new content | - | shareToBrian.md | new readme content | - And "Brian" opens the following file in mediaviewer - | resource | - | testavatar.jpeg | - Then "Brian" is in a media-viewer - When "Brian" closes the file viewer - And "Brian" opens the following file in pdfviewer - | resource | - | simple.pdf | - And "Brian" closes the file viewer - And "Alice" navigates to the personal space page - And "Alice" removes following sharee - | resource | recipient | - | shareToBrian.txt | Brian | - | shareToBrian.md | Brian | - And "Alice" logs out - Then "Brian" should not be able to see the following shares - | resource | owner | - | shareToBrian.txt | %user_alice_displayName% | - | shareToBrian.md | %user_alice_displayName% | - And "Brian" logs out - - - Scenario: share with expiration date - Given "Admin" creates following group using API - | id | - | sales | - And "Admin" adds user to the group using API - | user | group | - | Brian | sales | - And "Alice" creates the following folder in personal space using API - | name | - | myfolder | - | mainFolder | - And "Alice" creates the following files into personal space using API - | pathToFile | content | - | new.txt | some content | - | mainFolder/lorem.txt | lorem epsum | - And "Alice" logs in - When "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | expirationDate | - | new.txt | Brian | user | Can edit with trashbin | file | +5 days | - | myfolder | sales | group | Can view | folder | +10 days | - | mainFolder | Brian | user | Can edit with trashbin | folder | | - - # set expirationDate to existing share - And "Alice" sets the expiration date of share "mainFolder" of user "Brian" to "+5 days" - And "Alice" checks the following access details of share "mainFolder" for user "Brian" - | Name | %user_brian_displayName% | - | Type | User | - And "Alice" checks the following access details of share "mainFolder/lorem.txt" for user "Brian" - | Name | %user_brian_displayName% | - | Type | User | - And "Alice" sets the expiration date of share "myfolder" of group "sales" to "+3 days" - And "Alice" checks the following access details of share "myfolder" for group "sales" - | Name | sales department | - | Type | Group | - # remove share with group - When "Alice" removes following sharee - | resource | recipient | type | - | myfolder | sales | group | - And "Alice" logs out - - @predefined-users - Scenario: receive two shares with same name - Given "Admin" creates following users using API - | id | - | Carol | - And "Alice" logs in - And "Brian" logs in - And "Alice" creates the following folder in personal space using API - | name | - | test-folder | - And "Alice" creates the following files into personal space using API - | pathToFile | content | - | testfile.txt | example text | - When "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | testfile.txt | Brian | user | Can view | file | - | test-folder | Brian | user | Can view | folder | - Then "Alice" logs out - When "Carol" logs in - And "Carol" creates the following folder in personal space using API - | name | - | test-folder | - And "Carol" creates the following files into personal space using API - | pathToFile | content | - | testfile.txt | example text | - And "Carol" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | testfile.txt | Brian | user | Can view | file | - | test-folder | Brian | user | Can view | folder | - And "Carol" logs out - And "Brian" navigates to the shared with me page - Then following resources should be displayed in the Shares for user "Brian" - | resource | - | testfile.txt | - | test-folder | - # https://github.com/owncloud/ocis/issues/8471 - | testfile (1).txt | - | test-folder (1) | - And "Brian" logs out - - @predefined-users - Scenario: check file with same name but different paths are displayed correctly in shared with others page - Given "Alice" logs in - And "Brian" logs in - And "Alice" creates the following folder in personal space using API - | name | - | test-folder | - And "Alice" creates the following files into personal space using API - | pathToFile | content | - | testfile.txt | example text | - | test-folder/testfile.txt | some text | - And "Alice" shares the following resource using API - | resource | recipient | type | role | resourceType | - | testfile.txt | Brian | user | Can edit with trashbin | file | - | test-folder/testfile.txt | Brian | user | Can edit with trashbin | file | - And "Brian" logs out - When "Alice" navigates to the shared with others page - Then following resources should be displayed in the files list for user "Alice" - | resource | - | testfile.txt | - | test-folder/testfile.txt | - And "Alice" logs out - - - Scenario: share indication - When "Alice" creates the following folders in personal space using API - | name | - | shareFolder/subFolder | - And "Alice" shares the following resource using API - | resource | recipient | type | role | resourceType | - | shareFolder | Brian | user | Can edit with trashbin | folder | - And "Alice" logs in - Then "Alice" should see user-direct indicator on the folder "shareFolder" - When "Alice" opens folder "shareFolder" - Then "Alice" should see user-indirect indicator on the folder "subFolder" - And "Alice" logs out