Skip to content

Commit

Permalink
Introduce context menu in acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Aug 26, 2021
1 parent ccfb75b commit 2d0b428
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingNotifications/notificationLink.feature:18](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingNotifications/notificationLink.feature#L18)
- [webUISharingNotificationsToRoot/notificationLink.feature:17](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingNotificationsToRoot/notificationLink.feature#L17)

### [Cannot determine share source path when sharing same name file from different path in shared-with pages](https://github.com/owncloud/web/issues/5302)
- [webUISharingPublicBasic/publicLinkCreate.feature:88](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L88)

### [impossible to navigate into a folder in the trashbin](https://github.com/owncloud/web/issues/1725)
- [webUITrashbinDelete/trashbinDelete.feature:29](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L29)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingInternalUsersShareWithPage/shareWithUsers.feature:118](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature#L118)
- [webUIResharing1/reshareUsers.feature:230](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing1/reshareUsers.feature#L230)

### [delete pending share option is not available for sharee](https://github.com/owncloud/web/issues/5435)
- [webUIDeleteFilesFolders/deleteFilesFolders.feature:235](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature#L235)

### [file_path property is not unique for a share created with same resource name i.e already present in sharee](https://github.com/owncloud/ocis/issues/2249)
- [webUIRenameFiles/renameFiles.feature:205](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIRenameFiles/renameFiles.feature#L205)

Expand Down Expand Up @@ -429,9 +426,6 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature:41](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature#L41)
- [webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature:42](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroupsEdgeCases/shareWithGroupsEdgeCases.feature#L42)

### [Cannot determine share source path when sharing same name file from different path in shared-with pages](https://github.com/owncloud/web/issues/5302)
- [webUISharingPublicBasic/publicLinkCreate.feature:88](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L88)

### [impossible to navigate into a folder in the trashbin](https://github.com/owncloud/web/issues/1725)
- [webUITrashbinDelete/trashbinDelete.feature:29](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L29)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Feature: User can open the details panel for any file or folder
And user "Alice" has created a public link with following settings
| path | simple-folder |
And the user has browsed to the shared-via-link page
When the user opens the file action menu of folder "simple-folder" using the webUI
When the user opens the actions sidebar panel of file "simple-folder" on the webUI
Then the thumbnail should be visible in the app-sidebar
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
Expand Down Expand Up @@ -156,7 +156,7 @@ Feature: User can open the details panel for any file or folder
When the user browses to the tags page
And the user searches for tag "simple" using the webUI
Then folder "simple-folder" should be listed on the webUI
When the user opens the file action menu of folder "simple-folder" using the webUI
When the user opens the actions sidebar panel of file "simple-folder" on the webUI
Then the thumbnail should be visible in the app-sidebar
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Feature: Sharing files and folders with internal groups
| grp3 |
| grp4 |
And user "Alice" has created folder "simple-folder"
And user "Alice" has created folder "simple-folder2"
And user "Alice" has created file "simple-folder/testimage.png"
When user "Alice" has logged in using the webUI
Then the following resources should not have share indicators on the webUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Feature: Create public link shares
Then file "lorem.txt" should be listed on the webUI

@issue-5302
Scenario: share two file with same name but different paths by public link
Scenario: share two files with same name but different paths by public link
Given user "Alice" has created folder "simple-folder"
And user "Alice" has created file "simple-folder/lorem.txt"
And user "Alice" has created file "lorem.txt"
Expand Down
53 changes: 53 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/contextMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module.exports = {
commands: {
/**
* @enum {string}
* @readonly
*/
ContextMenuItem: Object.freeze({
showDetails: 'detailsButton',
showActions: 'actionsButton'
}),

/**
* @param {string} elementName the name of the element (mapped in `ContextMenuItem`)
*/
clickMenuItem: async function(elementName) {
const element = this.elements[elementName]
await this.click(element.locateStrategy, element.selector)
return this
},

/**
* Clicks the menu item for showing details
*
* @returns {*}
*/
showDetails: async function() {
await this.clickMenuItem(this.ContextMenuItem.showDetails)
await this.waitForAnimationToFinish() // wait for sidebar animation to finish
return this
},

/**
* Clicks the menu item for showing all actions
*
* @returns {*}
*/
showActions: async function() {
await this.clickMenuItem(this.ContextMenuItem.showActions)
await this.waitForAnimationToFinish() // wait for sidebar animation to finish
return this
}
},
elements: {
detailsButton: {
selector: '//button[contains(@class, "oc-files-actions-show-details-trigger")]',
locateStrategy: 'xpath'
},
actionsButton: {
selector: '//button[contains(@class, "oc-files-actions-show-actions-trigger")]',
locateStrategy: 'xpath'
}
}
}
37 changes: 17 additions & 20 deletions tests/acceptance/pageObjects/FilesPageElement/fileActionsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ module.exports = {
* @throws Error
* @returns {*}
*/
performFileAction: function(action) {
performFileAction: async function(action) {
const fileActionBtnSelectorXpath = this.getActionSelector(action)
return this.useXpath()
.waitForElementVisible(fileActionBtnSelectorXpath)
.click(fileActionBtnSelectorXpath)
.useCss()
return await this.click('xpath', fileActionBtnSelectorXpath)
},
/**
* returns the disabled state of given action
Expand All @@ -67,7 +64,7 @@ module.exports = {
* @returns {Promise<*>}
*/
delete: async function() {
this.performFileAction(this.FileAction.delete)
await this.performFileAction(this.FileAction.delete)
await this.api.page.FilesPageElement.filesList().confirmDeletion()
return this
},
Expand All @@ -77,8 +74,8 @@ module.exports = {
* @return {*}
*/
rename: async function(toName, expectToSucceed = true) {
await this.performFileAction(this.FileAction.rename)
await this.useXpath()
.performFileAction(this.FileAction.rename)
.waitForElementVisible('@dialog')
.waitForAnimationToFinish() // wait for transition on the modal to finish
.clearValue('@dialogInput')
Expand All @@ -96,48 +93,48 @@ module.exports = {
* mark as favorite resource using fileActions 'favorite' button
* @returns {Promise<*>}
*/
favorite: function() {
return this.performFileAction(this.FileAction.favorite)
favorite: async function() {
return await this.performFileAction(this.FileAction.favorite)
},
/**
* unmark as favorite resource using fileActions 'favorite' button
* @returns {Promise<*>}
*/
unmarkFavorite: function() {
return this.performFileAction(this.FileAction.unmarkFavorite)
unmarkFavorite: async function() {
return await this.performFileAction(this.FileAction.unmarkFavorite)
},
/**
* @return {Promise<module.exports.commands>}
*/
restore: function() {
return this.performFileAction(this.FileAction.restore)
restore: async function() {
return await this.performFileAction(this.FileAction.restore)
},
/**
* @return {Promise<module.exports.commands>}
*/
download: function() {
return this.performFileAction(this.FileAction.download)
download: async function() {
return await this.performFileAction(this.FileAction.download)
},
/**
* @return {Promise<module.exports.commands>}
*/
deleteResourceImmediately: async function() {
this.performFileAction(this.FileAction.delete)
await this.performFileAction(this.FileAction.delete)
await this.api.page.FilesPageElement.filesList().confirmDeletion()

return this
},
/**
* Trigger the move of a resource via its file action
*/
move: function() {
return this.performFileAction(this.FileAction.move)
move: async function() {
return await this.performFileAction(this.FileAction.move)
},
/**
* Trigger the copy of a resource via its file action
*/
copy: function() {
return this.performFileAction(this.FileAction.copy)
copy: async function() {
return await this.performFileAction(this.FileAction.copy)
},
/**
* Trigger accepting a share
Expand Down
Loading

0 comments on commit 2d0b428

Please sign in to comment.