Skip to content

Commit

Permalink
Reuse openSideBar in filesRow
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Aug 26, 2021
1 parent eeddbd3 commit ccfb75b
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions tests/acceptance/pageObjects/FilesPageElement/filesRow.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
/* eslint-disable no-unused-expressions */
const { client } = require('nightwatch-api')
const util = require('util')
const filesList = client.page.FilesPageElement.filesList()

module.exports = {
commands: {
/**
* Get Selector for File Actions expander
*
* @param {string} fileName
* @param {string} elementType
* @returns {string} file action button selector
*/
getFileActionBtnSelector: function(fileName, elementType = 'any') {
return (
filesList.getFileRowSelectorByFileName(fileName, elementType) +
this.elements.fileActionsButtonInFileRow.selector
)
},
/**
* opens file-actions menu for given resource
*
Expand All @@ -27,14 +12,7 @@ module.exports = {
* @returns {*}
*/
openFileActionsMenu: async function(resource, elementType = 'any') {
const fileActionsBtnSelector = this.getFileActionBtnSelector(resource, elementType)
this.useXpath()
.initAjaxCounters()
.waitForElementVisible(fileActionsBtnSelector)
.click(fileActionsBtnSelector)
.waitForOutstandingAjaxCalls()
.waitForAnimationToFinish()
.useCss()
await this.api.page.FilesPageElement.filesList().openSideBar(resource)
await this.api.page.FilesPageElement.appSideBar().activatePanel('actions')
return await this.api.page.FilesPageElement.fileActionsMenu()
},
Expand All @@ -49,10 +27,6 @@ module.exports = {
}
},
elements: {
fileActionsButtonInFileRow: {
selector: '//button[contains(@class, "oc-table-files-btn-show-details")]',
locateStrategy: 'xpath'
},
quickAction: {
selector: '//button[contains(@class, "files-quick-action-%s")]',
locateStrategy: 'xpath'
Expand Down

0 comments on commit ccfb75b

Please sign in to comment.