Skip to content

Commit

Permalink
Fix more acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed May 9, 2023
1 parent 5821064 commit c40770f
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingPublicManagement/shareByPublicLink.feature:24](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L24)

### [Uploading folders does not work in files-drop](https://github.com/owncloud/web/issues/2443)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:282](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L282)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:268](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L268)

### [Writing to locked files/folders give only a generic error message](https://github.com/owncloud/web/issues/5741)
- [webUIWebdavLockProtection/upload.feature:32](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingExpirationDate/shareWithExpirationDate.feature:21](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingExpirationDate/shareWithExpirationDate.feature#L21)

### [Listing shares via ocs API does not show path for parent folders](https://github.com/owncloud/ocis/issues/1231)
- [webUISharingPublicManagement/shareByPublicLink.feature:127](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L127)
- [webUISharingPublicManagement/shareByPublicLink.feature:110](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L110)

### [Propfind response to trashbin endpoint is different in ocis](https://github.com/owncloud/product/issues/186)
- [webUIFilesSearch/search.feature:131](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesSearch/search.feature#L131)
Expand Down Expand Up @@ -84,7 +84,7 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingPublicManagement/shareByPublicLink.feature:24](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L24)

### [Uploading folders does not work in files-drop](https://github.com/owncloud/web/issues/2443)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:282](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L282)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:268](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L268)

### [Resources cannot be locked under ocis](https://github.com/owncloud/ocis/issues/1284)
- [webUIWebdavLockProtection/delete.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/delete.feature#L33)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ Feature: rename files
And user "Alice" has uploaded file "lorem.txt" to "simple-folder/lorem.txt" in the server
And user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions in the server
When the public uses the webUI to access the last public link created by user "Alice" in a new session
And the user renames file "lorem.txt" to "a-renamed-file.txt" using the webUI
Then file "a-renamed-file.txt" should be listed on the webUI
And the user renames single share "lorem.txt" to "a-renamed-file.txt" using the webUI
Then file "a-renamed-file.txt" should be listed on the webUI as single share
But file "lorem.txt" should not be listed on the webUI
When the user reloads the current page of the webUI
Then file "a-renamed-file.txt" should be listed on the webUI
Then file "a-renamed-file.txt" should be listed on the webUI as single share
But file "lorem.txt" should not be listed on the webUI
And as "Alice" file "simple-folder/a-renamed-file.txt" should exist in the server
And as "Alice" file "simple-folder/lorem.txt" should not exist in the server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ Feature: Edit public link shares
And the user deletes the following elements using the webUI
| name |
| simple-empty-folder |
| lorem.txt |
And the user deletes the following single share using the webUI
| name-parts |
| lorem.txt |
Then the deleted elements should not be listed on the webUI
And the deleted elements should not be listed on the webUI after a page reload

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ Feature: Share by public link with different roles
| simple-empty-folder |
| lorem.txt |
| strängé filename (duplicate #2 &).txt |
| zzzz-must-be-last-file-in-folder.txt |
And the user deletes the following single share using the webUI
| name |
| zzzz-must-be-last-file-in-folder.txt |
Then the deleted elements should not be listed on the webUI
And the deleted elements should not be listed on the webUI after a page reload

Expand All @@ -144,7 +146,9 @@ Feature: Share by public link with different roles
| simple-empty-folder |
| lorem.txt |
| strängé filename (duplicate #2 &).txt |
| zzzz-must-be-last-file-in-folder.txt |
And the user deletes the following single share using the webUI
| name |
| zzzz-must-be-last-file-in-folder.txt |
Then the deleted elements should not be listed on the webUI

@issue-ocis-270
Expand Down Expand Up @@ -179,7 +183,7 @@ Feature: Share by public link with different roles
And the user uploads folder "PARENT" using the webUI
Then folder "PARENT" should be listed on the webUI
And folder "CHILD" should be listed in the folder "PARENT" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI as single share
And as "Alice" file "simple-folder/PARENT/CHILD/child.txt" should exist in the server


Expand All @@ -191,7 +195,7 @@ Feature: Share by public link with different roles
And the user uploads folder "PARENT" using the webUI
Then folder "PARENT" should be listed on the webUI
And folder "CHILD" should be listed in the folder "PARENT" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI as single share
And as "Alice" file "simple-folder/simple-empty-folder/PARENT/CHILD/child.txt" should exist in the server


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ Feature: Public link share management
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: access details dialog of public share and check the tabs displayed
Given user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has logged in using the webUI
When the user creates a new public link for folder "simple-folder" using the webUI
And the user renames the most recently created public link of folder "simple-folder" to "link1"
And the user tries to edit the public link named "link1" of folder "simple-folder" changing the role to "Editor"
And the public uses the webUI to access the last public link created by user "Alice" in a new session
Then the following panels should be visible in the details dialog on the webUI
| name |
| actions |
And the following panels should not be visible in the details dialog on the webUI
| name |
| people |
| links |
| versions |


@issue-2897
Scenario: sharing details of indirect items inside a shared folder
Given user "Alice" has created folder "/simple-folder/sub-folder" in the server
Expand Down
13 changes: 0 additions & 13 deletions tests/acceptance/pageObjects/FilesPageElement/appSideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ module.exports = {
const panelElement = this.elements[panelName + 'Panel']
return await this.waitForElementPresent(panelElement.locateStrategy, panelElement.selector)
},
getVisibleAccordionItems: async function () {
const items = []
let elements
await this.api.elements('@panelSelectButtons', function (result) {
elements = result.value
})
for (const { ELEMENT } of elements) {
await this.api.elementIdText(ELEMENT, function (result) {
items.push(result.value.toLowerCase())
})
}
return items
},
getActionsMenuItemsExceptDefaults: async function () {
const defaultItems = ['add to favorites', 'copy', 'cut', 'rename', 'delete']
const items = []
Expand Down
9 changes: 9 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ module.exports = {
await fileActionsMenu.rename(toName, expectToSucceed)
return this
},
renameSingleShare: async function (
fromName,
toName,
expectToSucceed = true,
elementType = 'any'
) {
await fileActionsMenu.rename(toName, expectToSucceed)
return this
},
renameFileFromContextMenu: async function (
fromName,
toName,
Expand Down
45 changes: 15 additions & 30 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ When(
}
)

When(
'the user renames single share {string} to {string} using the webUI',
function (fromName, toName) {
return client.page.FilesPageElement.filesList().renameSingleShare(fromName, toName)
}
)

Given('the user has renamed file/folder {string} to {string}', function (fromName, toName) {
return client.page.FilesPageElement.filesList().renameFile(fromName, toName)
})
Expand Down Expand Up @@ -889,36 +896,6 @@ Then('the {string} details panel should be visible', async function (panel) {
assert.strictEqual(expanded, true, `'${panel}-panel' should be active, but is not`)
})

Then(
'the following panels should be visible in the details dialog on the webUI',
async function (table) {
const visibleItems = await client.page.FilesPageElement.appSideBar().getVisibleAccordionItems()
const expectedVisibleItems = table.rows()
const difference = _.difference(expectedVisibleItems.flat(), visibleItems)

assert.strictEqual(
difference.length,
0,
`'${difference}' panels were expected to be visible but not found. Available panels '${visibleItems}'`
)
}
)

Then(
'the following panels should not be visible in the details dialog on the webUI',
async function (table) {
const visibleItems = await client.page.FilesPageElement.appSideBar().getVisibleAccordionItems()
const expectedNotVisibleItems = table.rows()
const difference = _.difference(expectedNotVisibleItems.flat(), visibleItems)

assert.strictEqual(
expectedNotVisibleItems.length,
difference.length,
`'${expectedNotVisibleItems}' panels were not expected to be visible but found. Available panels '${visibleItems}'`
)
}
)

const assertElementsAreListed = async function (elements) {
for (const element of elements) {
const state = await client.page.FilesPageElement.filesList().isElementListed(element)
Expand Down Expand Up @@ -971,6 +948,14 @@ Then(
}
)

Then(
'file/folder {string} should be listed in the folder {string} on the webUI as single share',
async function (file, folder) {
await client.page.FilesPageElement.filesList().navigateToFolder(folder)
return client.page.FilesPageElement.filesList().waitForFileVisibleAsSingleShare(file)
}
)

Then('the deleted elements should be listed on the webUI', function () {
return assertDeletedElementsAreListed()
})
Expand Down

0 comments on commit c40770f

Please sign in to comment.