-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce context menu in acceptance tests
- Loading branch information
Showing
12 changed files
with
157 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
tests/acceptance/pageObjects/FilesPageElement/contextMenu.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.