diff --git a/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature b/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature index 274cdcfb0fd..51f314c7d02 100644 --- a/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature @@ -1,37 +1,34 @@ Feature: internal link share - Scenario: link share as an internal role + Scenario: share a link with internal role Given "Admin" creates following users | id | | Alice | | Brian | And "Alice" creates the following folder in personal space using API - | name | - | folderPublic | + | name | + | myfolder | + And "Alice" shares the following resource using API + | resource | recipient | type | role | + | myfolder | Brian | user | editor | And "Alice" logs in And "Alice" opens the "files" app - And "Alice" uploads the following resources - | resource | to | - | lorem.txt | folderPublic | - And "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | - | folderPublic | Brian | user | editor | - And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel - When "Alice" edits the public link named "Link" of resource "folderPublic" changing role to "internal" + And "Alice" creates a public link for the resource "myfolder" using the sidebar panel + When "Alice" edits the public link named "Link" of resource "myfolder" changing role to "internal" And "Brian" opens the public link "Link" And "Brian" logs in from the internal link And "Brian" opens shared-with-me page from the internal link And "Brian" accepts the following share - | name | - | folderPublic | + | name | + | myfolder | And "Brian" uploads the following resource - | resource | to | - | simple.pdf | folderPublic | + | resource | to | + | simple.pdf | myfolder | And "Alice" updates following sharee role - | resource | recipient | type | role | - | folderPublic | Brian | user | custom_permissions:read | + | resource | recipient | type | role | + | myfolder | Brian | user | custom_permissions:read | And "Alice" logs out -# Then "Brian" should not able to edit the following resources -# | resource | -# | folderPublic | + Then "Brian" should not be able to reshare the following resource + | resource | + | myfolder | And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/api.ts b/tests/e2e/cucumber/steps/api.ts index 85d1d8739d8..dbc924eac82 100644 --- a/tests/e2e/cucumber/steps/api.ts +++ b/tests/e2e/cucumber/steps/api.ts @@ -120,9 +120,10 @@ Given( await api.share.createShare({ user, path: info.resource, - shareWith: info.recipient, shareType: info.type, - role: info.role + shareWith: info.recipient, + role: info.role, + name: info.name }) } } diff --git a/tests/e2e/cucumber/steps/ui/links.ts b/tests/e2e/cucumber/steps/ui/links.ts index 80a939275db..f6c23591759 100644 --- a/tests/e2e/cucumber/steps/ui/links.ts +++ b/tests/e2e/cucumber/steps/ui/links.ts @@ -2,8 +2,6 @@ import { Then, When } from '@cucumber/cucumber' import { expect } from '@playwright/test' import { World } from '../../environment' import { objects } from '../../../support' -import { kebabCase } from 'lodash' -import { DateTime } from 'luxon' When( '{string} creates a public link for the resource {string} using the sidebar panel', diff --git a/tests/e2e/support/api/share/share.ts b/tests/e2e/support/api/share/share.ts index a3c97182698..d038afdcaf9 100644 --- a/tests/e2e/support/api/share/share.ts +++ b/tests/e2e/support/api/share/share.ts @@ -21,19 +21,22 @@ export const createShare = async ({ path, shareWith, shareType, - role + role, + name }: { user: User path: string - shareWith: string shareType: string - role: string + shareWith?: string + role?: string + name?: string }): Promise => { const body = new URLSearchParams() body.append('path', path) body.append('shareWith', shareWith) body.append('shareType', shareTypes[shareType]) body.append('role', role) + body.append('name', name) const response = await request({ method: 'POST', diff --git a/tests/e2e/support/objects/runtime/session.ts b/tests/e2e/support/objects/runtime/session.ts index 75258824fe7..81031e5bc73 100644 --- a/tests/e2e/support/objects/runtime/session.ts +++ b/tests/e2e/support/objects/runtime/session.ts @@ -15,6 +15,7 @@ class Ocis implements LoginAdapter { async login({ user }: { user: User }): Promise { const { id, password } = user + await this.#page.locator('#oc-login-username').fill(id) await this.#page.locator('#oc-login-password').fill(password) await this.#page.locator('button[type="submit"]').click()