diff --git a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md index 32021fd6eb8..c84dd5ad79d 100644 --- a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md +++ b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md @@ -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) diff --git a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md index 2e7366c929d..c5908797e2e 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -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) @@ -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) diff --git a/tests/acceptance/features/webUIFilesDetails/fileDetails.feature b/tests/acceptance/features/webUIFilesDetails/fileDetails.feature index d5a000864d8..801a7dbafdd 100644 --- a/tests/acceptance/features/webUIFilesDetails/fileDetails.feature +++ b/tests/acceptance/features/webUIFilesDetails/fileDetails.feature @@ -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 @@ -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 diff --git a/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature b/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature index 907c7759f42..8e83638e247 100644 --- a/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature +++ b/tests/acceptance/features/webUISharingInternalGroupsSharingIndicator/shareWithGroups.feature @@ -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 diff --git a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature index 6fab6cf16d6..fd4e179628c 100644 --- a/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature +++ b/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature @@ -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" diff --git a/tests/acceptance/pageObjects/FilesPageElement/contextMenu.js b/tests/acceptance/pageObjects/FilesPageElement/contextMenu.js new file mode 100644 index 00000000000..40df79e4f1b --- /dev/null +++ b/tests/acceptance/pageObjects/FilesPageElement/contextMenu.js @@ -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' + } + } +} diff --git a/tests/acceptance/pageObjects/FilesPageElement/fileActionsMenu.js b/tests/acceptance/pageObjects/FilesPageElement/fileActionsMenu.js index 604dea26f98..620968a25aa 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/fileActionsMenu.js +++ b/tests/acceptance/pageObjects/FilesPageElement/fileActionsMenu.js @@ -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 @@ -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 }, @@ -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') @@ -96,33 +93,33 @@ 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} */ - restore: function() { - return this.performFileAction(this.FileAction.restore) + restore: async function() { + return await this.performFileAction(this.FileAction.restore) }, /** * @return {Promise} */ - download: function() { - return this.performFileAction(this.FileAction.download) + download: async function() { + return await this.performFileAction(this.FileAction.download) }, /** * @return {Promise} */ deleteResourceImmediately: async function() { - this.performFileAction(this.FileAction.delete) + await this.performFileAction(this.FileAction.delete) await this.api.page.FilesPageElement.filesList().confirmDeletion() return this @@ -130,14 +127,14 @@ module.exports = { /** * 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 diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index 70be3786302..778380dcfa3 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -2,8 +2,10 @@ const util = require('util') const assert = require('assert') const xpathHelper = require('../../helpers/xpath') const { client } = require('nightwatch-api') +const appSideBar = client.page.FilesPageElement.appSideBar() +const contextMenu = client.page.FilesPageElement.contextMenu() const filesRow = client.page.FilesPageElement.filesRow() -const filesActionsMenu = client.page.FilesPageElement.fileActionsMenu() +const fileActionsMenu = client.page.FilesPageElement.fileActionsMenu() module.exports = { commands: { @@ -12,10 +14,9 @@ module.exports = { * @return {Promise<*>} */ openSharingDialog: async function(resource) { - const appSidebar = client.page.FilesPageElement.appSideBar() - await appSidebar.closeSidebar(500) + appSideBar.closeSidebar(500) await this.openSideBar(resource) - return client.page.FilesPageElement.appSideBar().activatePanel('people') + return await appSideBar.activatePanel('people') }, /** * @param {string} resource @@ -38,16 +39,15 @@ module.exports = { openPublicLinkDialog: async function(fileName) { await this.waitForFileVisible(fileName) await this.openSideBar(fileName) - return client.page.FilesPageElement.appSideBar().activatePanel('links') + return await appSideBar.activatePanel('links') }, /** * @param {string} resource * @return {Promise} */ deleteFile: async function(resource) { - await this.waitForFileVisible(resource) - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.delete() + await this.openFileActionsMenu(resource) + await fileActionsMenu.delete() return this }, /** @@ -55,9 +55,8 @@ module.exports = { * @returns {Promise} */ acceptShare: async function(resource) { - await this.waitForFileVisible(resource) - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.acceptShare() + await this.openFileActionsMenu(resource) + await fileActionsMenu.acceptShare() return this }, /** @@ -65,9 +64,8 @@ module.exports = { * @returns {Promise} */ declineShare: async function(resource) { - await this.waitForFileVisible(resource) - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.declineShare() + await this.openFileActionsMenu(resource) + await fileActionsMenu.declineShare() return this }, /** @@ -77,40 +75,36 @@ module.exports = { * @return {Promise} */ renameFile: async function(fromName, toName, expectToSucceed = true) { - await this.waitForFileVisible(fromName) - await filesRow.openFileActionsMenu(fromName) - await filesActionsMenu.rename(toName, expectToSucceed) + await this.openFileActionsMenu(fromName) + await fileActionsMenu.rename(toName, expectToSucceed) return this }, /** - * @param {string} path + * @param {string} resource * @return {Promise} */ - markFavorite: async function(path) { - await this.waitForFileVisible(path) - await filesRow.openFileActionsMenu(path) - await filesActionsMenu.favorite() + markFavorite: async function(resource) { + await this.openFileActionsMenu(resource) + await fileActionsMenu.favorite() return this }, /** - * @param {string} path + * @param {string} resource * @return {Promise} */ - unmarkFavorite: async function(path) { - await this.waitForFileVisible(path) - await filesRow.openFileActionsMenu(path) - await filesActionsMenu.unmarkFavorite() + unmarkFavorite: async function(resource) { + await this.openFileActionsMenu(resource) + await fileActionsMenu.unmarkFavorite() return this }, /** - * @param {string} element + * @param {string} resource * @param {string} elementType * @return {Promise} */ - restoreFile: async function(element, elementType) { - await this.waitForFileWithPathVisible(element, elementType) - await filesRow.openFileActionsMenu(element, elementType) - await filesActionsMenu.restore() + restoreFile: async function(resource, elementType) { + await this.openFileActionsMenu(resource, elementType) + await fileActionsMenu.restore() return this }, /** @@ -118,9 +112,8 @@ module.exports = { * @return {Promise} */ deleteImmediately: async function(resource) { - await this.waitForFileVisible(resource) - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.deleteResourceImmediately(resource) + await this.openFileActionsMenu(resource) + await fileActionsMenu.deleteResourceImmediately(resource) return this }, /** @@ -129,18 +122,16 @@ module.exports = { * @return {Promise} */ isActionAttributeDisabled: async function(action, resource) { - await this.waitForFileVisible(resource) - await filesRow.openFileActionsMenu(resource) - return await filesActionsMenu.getActionDisabledAttr('delete') + await this.openFileActionsMenu(resource) + return await fileActionsMenu.getActionDisabledAttr('delete') }, /** * @param {string} resource * @return {Promise} */ downloadFile: async function(resource) { - await this.waitForFileVisible(resource) - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.download() + await this.openFileActionsMenu(resource) + await fileActionsMenu.download() return this }, /** @@ -188,6 +179,37 @@ module.exports = { return this }, + /** + * opens context menu for given resource + * + * @param {string} resource The name or path of a resource + * @param {string} elementType The resource type (file|folder|any) + * @returns {*} + */ + openContextMenu: async function(resource, elementType = 'any') { + await this.waitForFileVisible(resource, elementType) + const selectorContextMenu = + this.getFileRowSelectorByFileName(resource, elementType) + + this.elements.contextBtnInFileRow.selector + await this.click('xpath', selectorContextMenu) + await this.waitForElementVisible('@contextMenuPanel') + return contextMenu + }, + + /** + * opens file-actions menu for given resource + * + * @param {string} resource The resource name + * @param {string} elementType The resource type (file|folder|any) + * + * @returns {*} + */ + openFileActionsMenu: async function(resource, elementType = 'any') { + await this.openContextMenu(resource, elementType) + await contextMenu.showActions() + return fileActionsMenu + }, + /** * opens sidebar for given resource * @@ -195,8 +217,9 @@ module.exports = { * @returns {*} */ openSideBar: async function(resource) { - await this.clickDetailsInContextMenu(resource) - return this.api.page.FilesPageElement.appSideBar() + await this.openContextMenu(resource) + await contextMenu.showDetails() + return appSideBar }, /** * @@ -218,20 +241,6 @@ module.exports = { .waitForOutstandingAjaxCalls() .useCss() }, - /** - * @param {string} item the file/folder to click - */ - clickDetailsInContextMenu: async function(item) { - await this.waitForFileVisible(item) - const selectorContextMenu = - this.getFileRowSelectorByFileName(item) + this.elements.contextBtnInFileRow.selector - await this.click({ - selector: selectorContextMenu, - locateStrategy: 'xpath' - }) - await this.click('@detailsBtnInContextMenu') - return this - }, /** * Toggle enable or disable file/folder select checkbox @@ -305,7 +314,7 @@ module.exports = { waitForFileVisible: async function(fileName, elementType = 'any') { const rowSelector = this.getFileRowSelectorByFileName(fileName, elementType) - await client.page.FilesPageElement.appSideBar().closeSidebar(500) + await appSideBar.closeSidebar(500) let rowElementId = null await this.waitForElementPresent( { selector: rowSelector, locateStrategy: 'xpath' }, @@ -317,7 +326,6 @@ module.exports = { await this.api.elementIdLocation(rowElementId, result => { offset = result.value.y }) - let firstRowElementId = null await this.waitForElementPresent('@fileRow', result => { firstRowElementId = result.WebdriverElementId @@ -327,29 +335,8 @@ module.exports = { }) this.api.execute('scrollTo(0,' + offset + ')') - return this }, - /** - * Wait for a filerow with given path to be visible - * This only works in the favorites page as it uses the whole path of a file rather than just the name - * This does not works in cases where the path starts with a space (eg. " ParentFolder/file.txt") - * - * @param {string} path - * @param {string} elementType - */ - waitForFileWithPathVisible: async function(path, elementType = 'any') { - await client.page.FilesPageElement.appSideBar().closeSidebar(500) - const linkSelector = this.getFileLinkSelectorByFileName(path, elementType) - const rowSelector = this.getFileRowSelectorByFileName(path, elementType) - return this.useXpath() - .waitForElementVisible(rowSelector) - .waitForElementVisible(linkSelector) - .getText(linkSelector, function(result) { - assert.strictEqual(result.value.trim(), path, 'displayed file name not as expected') - }) - .useCss() - }, /** * * @param {string} fileName @@ -538,24 +525,9 @@ module.exports = { return this.useCss() }, - /** - * Returns original string with replaced target character - * @param {string} string String in which will be the target character replaced - * @param {string} targetChar Target character which is to be replaced - * @param {string} newChar New character which will replace target character - * @returns {string} String with replaced target character - */ - replaceChar: function(string, targetChar, newChar) { - const regex = new RegExp(targetChar, 'g') - return string.replace(regex, newChar) - }, - useQuickAction: async function(resource, action) { action = action.replace(/\s/, '-') - const actionSelector = util.format( - this.api.page.FilesPageElement.filesRow().elements.quickAction.selector, - action - ) + const actionSelector = util.format(filesRow.elements.quickAction.selector, action) const resourceRowSelector = this.getFileRowSelectorByFileName(resource) await this.waitForFileVisible(resource) @@ -566,11 +538,9 @@ module.exports = { }, moveResource: async function(resource, target) { - await this.waitForFileVisible(resource) - // Trigger move - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.move() + await this.openFileActionsMenu(resource) + await fileActionsMenu.move() // Execute move await client.page.locationPicker().selectFolderAndConfirm(target) @@ -578,19 +548,6 @@ module.exports = { return this }, - attemptToMoveResource: async function(resource, target) { - await this.waitForFileVisible(resource) - - // Trigger move - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.move() - - // select folder - await client.page.locationPicker().selectFolder(target) - - return this - }, - cancelResourceMoveOrCopyProgress: async function() { // cancel copy or move await this.waitForElementVisible(this.elements.cancelMoveCopyBtn.selector).click( @@ -602,11 +559,9 @@ module.exports = { }, copyResource: async function(resource, target) { - await this.waitForFileVisible(resource) - // Trigger copy - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.copy() + await this.openFileActionsMenu(resource) + await fileActionsMenu.copy() // Execute copy await client.page.locationPicker().selectFolderAndConfirm(target) @@ -614,18 +569,6 @@ module.exports = { return this }, - attemptToCopyResource: async function(resource, target) { - await this.waitForFileVisible(resource) - - // Trigger copy - await filesRow.openFileActionsMenu(resource) - await filesActionsMenu.copy() - - // Execute copy - await client.page.locationPicker().selectFolder(target) - - return this - }, clickOnFileName: function(fileName) { const file = this.getFileLinkSelectorByFileName(fileName, 'file') return this.useXpath() @@ -699,8 +642,8 @@ module.exports = { selector: '//button[contains(@class, "oc-table-files-btn-action-dropdown")]', locateStrategy: 'xpath' }, - detailsBtnInContextMenu: { - selector: 'button.oc-files-actions-show-details-trigger' + contextMenuPanel: { + selector: 'ul#oc-files-context-actions' }, /** * This element is concatenated as child of @see fileRowByResourcePath diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesRow.js b/tests/acceptance/pageObjects/FilesPageElement/filesRow.js index 8169b86ab76..2144550a082 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesRow.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesRow.js @@ -3,19 +3,6 @@ const util = require('util') module.exports = { commands: { - /** - * opens file-actions menu for given resource - * - * @param {string} resource The resource name - * @param {string} elementType The resource type (file|folder) - * - * @returns {*} - */ - openFileActionsMenu: async function(resource, elementType = 'any') { - await this.api.page.FilesPageElement.filesList().openSideBar(resource) - await this.api.page.FilesPageElement.appSideBar().activatePanel('actions') - return await this.api.page.FilesPageElement.fileActionsMenu() - }, isQuickActionVisible: function(action) { action = action.replace(/\s/, '-') const actionSelector = util.format(this.elements.quickAction.selector, action) diff --git a/tests/acceptance/pageObjects/FilesPageElement/mediaViewerPage.js b/tests/acceptance/pageObjects/FilesPageElement/mediaViewerPage.js index d8180999e6a..da2d023106d 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/mediaViewerPage.js +++ b/tests/acceptance/pageObjects/FilesPageElement/mediaViewerPage.js @@ -1,12 +1,12 @@ const util = require('util') const { client } = require('nightwatch-api') -const filesRow = client.page.FilesPageElement.filesRow() +const filesList = client.page.FilesPageElement.filesList() const filesActionsMenu = client.page.FilesPageElement.fileActionsMenu() module.exports = { commands: { openMediaViewer: async function(fileName) { - await filesRow.openFileActionsMenu(fileName) + await filesList.openFileActionsMenu(fileName) await filesActionsMenu.mediaViewer() return this diff --git a/tests/acceptance/pageObjects/markdownEditorPage.js b/tests/acceptance/pageObjects/markdownEditorPage.js index 1bbc9695653..233e15b1364 100644 --- a/tests/acceptance/pageObjects/markdownEditorPage.js +++ b/tests/acceptance/pageObjects/markdownEditorPage.js @@ -1,7 +1,6 @@ const { client } = require('nightwatch-api') const filesList = client.page.FilesPageElement.filesList() -const filesRow = client.page.FilesPageElement.filesRow() const filesActionsMenu = client.page.FilesPageElement.fileActionsMenu() module.exports = { @@ -72,8 +71,7 @@ module.exports = { * @param {string} fileName */ openMdEditorUsingActionMenu: async function(fileName) { - await filesList.waitForFileVisible(fileName) - await filesRow.openFileActionsMenu(fileName) + await filesList.openFileActionsMenu(fileName) await filesActionsMenu.markdownEditor() return this } diff --git a/tests/acceptance/stepDefinitions/filesContext.js b/tests/acceptance/stepDefinitions/filesContext.js index 8e1d1679e18..f881466012d 100644 --- a/tests/acceptance/stepDefinitions/filesContext.js +++ b/tests/acceptance/stepDefinitions/filesContext.js @@ -422,7 +422,7 @@ Then('folder {string} should be listed on the webUI', folder => { }) Then('file/folder with path {string} should be listed on the webUI', function(path) { - return client.page.FilesPageElement.filesList().waitForFileWithPathVisible(path) + return client.page.FilesPageElement.filesList().waitForFileVisible(path) }) Then('the last uploaded folder should be listed on the webUI', async function() { @@ -1020,7 +1020,7 @@ Then( When( 'the user opens the actions sidebar panel of file/folder {string} on the webUI', async function(resource) { - await client.page.FilesPageElement.filesRow().openFileActionsMenu(resource) + await client.page.FilesPageElement.filesList().openFileActionsMenu(resource) } ) @@ -1257,8 +1257,8 @@ Then('the move here file/folder button should be disabled', function() { When('the user selects move action for folder/file {string} using the webUI', async function( resource ) { - await client.page.FilesPageElement.filesRow().openFileActionsMenu(resource) - return client.page.FilesPageElement.fileActionsMenu().move() + await client.page.FilesPageElement.filesList().openFileActionsMenu(resource) + return await client.page.FilesPageElement.fileActionsMenu().move() }) When('the user cancels the attempt to move/copy resources using the webUI', function() { @@ -1311,18 +1311,11 @@ When('the user tries to copy file/folder {string} into folder {string} using the }) }) -When('the user opens the file action menu of file/folder {string} using the webUI', async function( - resource -) { - await client.page.FilesPageElement.filesList().waitForFileVisible(resource) - await client.page.FilesPageElement.filesRow().openFileActionsMenu(resource) -}) - When('the user selects copy action for file/folder {string} using the webUI', async function( resource ) { - await client.page.FilesPageElement.filesRow().openFileActionsMenu(resource) - return client.page.FilesPageElement.fileActionsMenu().copy() + await client.page.FilesPageElement.filesList().openFileActionsMenu(resource) + return await client.page.FilesPageElement.fileActionsMenu().copy() }) When(