diff --git a/tests/e2e/cucumber/features/ocm/ocm.feature b/tests/e2e/cucumber/features/ocm/ocm.feature index 44a0d56c8bc..715c314d32e 100644 --- a/tests/e2e/cucumber/features/ocm/ocm.feature +++ b/tests/e2e/cucumber/features/ocm/ocm.feature @@ -9,13 +9,18 @@ Feature: federation management And "Admin" creates following user using API | id | | Alice | - And "Alice" creates the following files into personal space using API - | pathToFile | content | - | example1.txt | example text | + And "Alice" creates the following folders in personal space using API + | name | + | folderPublic | + And "Alice" uploads the following local file into personal space using API + | localFile | to | + | filesForUpload/simple.pdf | folderPublic/simple.pdf | + | filesForUpload/testavatar.jpg | testavatar.jpg | + | filesForUpload/sampleGif.gif | sampleGif.gif | And "Alice" logs in And "Alice" opens the "open-cloud-mesh" app - When "Alice" generates invitation token for the federation share - And "Alice" logs out + And "Alice" generates invitation token for the federation share + Given using "FEDERATED" server And "Admin" creates following user using API | id | @@ -26,4 +31,37 @@ Feature: federation management Then "Brian" should see the following federated connections: | user | email | | Alice Hansen | alice@example.org | + + Given using "LOCAL" server + When "Alice" reloads the page + Then "Alice" should see the following federated connections: + | user | email | + | Brian Murphy | brian@example.org | + And "Alice" opens the "files" app + And "Alice" shares the following resource using the sidebar panel + | resource | recipient | type | role | resourceType | shareType | + | folderPublic | Brian | user | Can edit | folder | external | + | sampleGif.gif | Brian | user | Can edit | file | external | + | testavatar.jpg | Brian | user | Can view | file | external | + And "Alice" logs out + + Given using "FEDERATED" server + And "Brian" opens the "files" app + When "Brian" navigates to the shared with me page + + # should be work after fixing https://github.com/owncloud/ocis/issues/10272 + # Then "Brian" should see thumbnail and preview for file "testavatar.jpg" + # And "Brian" should see thumbnail and preview for file "sampleGif.gif" + # When "Brian" opens the following file in mediaviewer + # | resource | + # | testavatar.jpg | + # Then "Brian" is in a media-viewer + # And "Brian" navigates to the next media resource + # When "Brian" closes the file viewer + + And "Brian" downloads the following resources using the batch action + | resource | type | + | folderPublic | folder | + | sampleGif.gif | file | + | testavatar.jpg | file | And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/ui/shares.ts b/tests/e2e/cucumber/steps/ui/shares.ts index 670637cbe78..5726c0671b0 100644 --- a/tests/e2e/cucumber/steps/ui/shares.ts +++ b/tests/e2e/cucumber/steps/ui/shares.ts @@ -13,7 +13,7 @@ const parseShareTable = function ( usersEnvironment: environment.UsersEnvironment ) { return stepTable.hashes().reduce>((acc, stepRow) => { - const { resource, recipient, type, role, resourceType, expirationDate } = stepRow + const { resource, recipient, type, role, resourceType, expirationDate, shareType } = stepRow if (!acc[resource]) { acc[resource] = [] @@ -27,7 +27,8 @@ const parseShareTable = function ( role, type: type as CollaboratorType, resourceType, - expirationDate + expirationDate, + shareType }) return acc diff --git a/tests/e2e/support/objects/app-files/share/actions.ts b/tests/e2e/support/objects/app-files/share/actions.ts index d6e526fe8b6..537160db4ba 100644 --- a/tests/e2e/support/objects/app-files/share/actions.ts +++ b/tests/e2e/support/objects/app-files/share/actions.ts @@ -21,6 +21,8 @@ const showMoreOptionsButton = '#show-more-share-options-btn' const calendarDatePickerId = 'recipient-datepicker-btn' const informMessage = '//div[contains(@class,"oc-notification-message-title")]' const showMoreBtn = '.toggle-shares-list-btn:has-text("Show more")' +const userTypeFilter = '.invite-form-share-role-type' +const userTypeSelector = '.invite-form-share-role-type-item' export interface ShareArgs { page: Page @@ -71,6 +73,7 @@ export const createShare = async (args: createShareArgs): Promise => { await openSharingPanel(page, resource, via) } const expirationDate = recipients[0].expirationDate + await page.pause() if (expirationDate) { await page.locator(showMoreOptionsButton).click() @@ -80,6 +83,14 @@ export const createShare = async (args: createShareArgs): Promise => { ]) await Collaborator.setExpirationDate(page, expirationDate) } + const federatedShare = recipients[0].shareType + if (federatedShare) { + await Promise.all([ + locatorUtils.waitForEvent(page.locator(invitePanel), 'transitionend'), + page.locator(userTypeFilter).click() + ]) + await page.locator(userTypeSelector).filter({ hasText: federatedShare }).click() + } await Collaborator.inviteCollaborators({ page, collaborators: recipients }) await sidebar.close({ page }) } diff --git a/tests/e2e/support/objects/app-files/share/collaborator.ts b/tests/e2e/support/objects/app-files/share/collaborator.ts index 9bc522cb5b0..b26f9b4a036 100644 --- a/tests/e2e/support/objects/app-files/share/collaborator.ts +++ b/tests/e2e/support/objects/app-files/share/collaborator.ts @@ -11,6 +11,7 @@ export interface ICollaborator { type?: CollaboratorType resourceType?: string expirationDate?: string + shareType?: string } export interface InviteCollaboratorsArgs { @@ -98,7 +99,7 @@ export default class Collaborator { const collaboratorInputLocator = page.locator(Collaborator.inviteInput) await collaboratorInputLocator.click() await Promise.all([ - page.waitForResponse((resp) => resp.url().includes('groups') && resp.status() === 200), + page.waitForResponse((resp) => resp.url().includes('users') && resp.status() === 200), collaboratorInputLocator.fill(collaborator.id) ]) await collaboratorInputLocator.focus()