Skip to content

Commit

Permalink
[tests-only] added e2e test to receive two shares with same name (#10488
Browse files Browse the repository at this point in the history
)

* added e2e test to receive two shares with same name

* removed web UI test related to receiving two shares with same name

* added step to share file with same name
  • Loading branch information
PrajwolAmatya authored and saw-jan committed Mar 5, 2024
1 parent af339a7 commit 9a2941e
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ config = {
"webUIPreview",
"webUILogin",
],
"oCISSharingBasic": [
"webUISharingAcceptShares",
],
"oCISFiles1": [
"webUICreateFilesFolders",
"webUIDeleteFilesFolders",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ Other free text and markdown formatting can be used elsewhere in the document if
### [empty subfolder inside a folder to be uploaded is not created on the server](https://github.com/owncloud/web/issues/6348)

- [webUIUpload/upload.feature:43](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L43)

### [PROPFIND to sub-folder of a shared resources with same name gives 404](https://github.com/owncloud/ocis/issues/3859)

- [webUISharingAcceptShares/acceptShares.feature:16](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L16)

This file was deleted.

41 changes: 41 additions & 0 deletions tests/e2e/cucumber/features/smoke/shares/share.feature
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,44 @@ Feature: share

And "Brian" navigates to the shared with me page
And "Brian" logs out


Scenario: receive two shares with same name
Given "Admin" creates following users using API
| id |
| Carol |
And "Alice" 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 |
And "Alice" opens the "files" app
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 |
And "Alice" logs out
And "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" opens the "files" app
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 |
And "Carol" logs out
When "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
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/steps/ui/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ When(
)

Then(
/^following resources (should|should not) be displayed in the (search list|files list) for user "([^"]*)"$/,
/^following resources (should|should not) be displayed in the (search list|files list|Shares) for user "([^"]*)"$/,
async function (
this: World,
actionType: string,
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/support/objects/app-files/resource/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const highlightedFileRowSelector = '#files-space-table tr.oc-table-highlighted'
const emptyTrashbinButtonSelector = '.oc-files-actions-empty-trash-bin-trigger'
const resourceLockIcon =
'//*[@data-test-resource-name="%s"]/ancestor::tr//td//span[contains(@class, "oc-resource-icon-status-badge-inner")]'
const sharesNavigationButtonSelector = '.oc-sidebar-nav [data-nav-name="files-shares"]'

export const clickResource = async ({
page,
Expand Down Expand Up @@ -1355,6 +1356,19 @@ export const getDisplayedResourcesFromFilesList = async (page): Promise<string[]
return files
}

export const getDisplayedResourcesFromShares = async (page): Promise<string[]> => {
const files = []
await page.locator(sharesNavigationButtonSelector).click()
const result = await page.locator('[data-test-resource-path]')

const count = await result.count()
for (let i = 0; i < count; i++) {
files.push(await result.nth(i).getAttribute('data-test-resource-name'))
}

return files
}

export interface switchViewModeArgs {
page: Page
target: 'resource-table' | 'resource-tiles'
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/support/objects/app-files/resource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ export class Resource {
return po.getDisplayedResourcesFromFilesList(this.#page)
} else if (args.keyword === 'search list') {
return po.getDisplayedResourcesFromSearch(this.#page)
} else if (args.keyword === 'Shares') {
return po.getDisplayedResourcesFromShares(this.#page)
} else {
throw new Error('Unknown keyword')
}
Expand Down

0 comments on commit 9a2941e

Please sign in to comment.