Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] added e2e test to receive two shares with same name #10488

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the status of this issue? I see it is still open

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mentioned issue doesn't exist on the latest oCIS master. The expected behavior (1) to be added on the second share with same name, and resources can be accessed via propfind. So, that issue is closed now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then please, find the API test coverage for that one and if there is none we have to add one


- [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 @@ -114,6 +114,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 @@ -1360,6 +1361,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