From 61fd0f9fe079967bb632474b8aa054beff3f646c Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Mon, 1 Mar 2021 16:44:59 +0100 Subject: [PATCH] Fix resource names in share tests --- .../acceptShares.feature | 4 ++-- tests/acceptance/pageObjects/sharedWithMePage.js | 13 ++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature b/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature index 18b6c8d4845..108babceb62 100644 --- a/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature +++ b/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature @@ -257,7 +257,7 @@ Feature: accept/decline shares coming from internal users And user "user1" has shared file "testimage.jpg" with user "user2" And the user has browsed to the shared-with-me page When the user accepts share "lorem.txt" offered by user "User One" using the webUI - Then file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI + Then file "lorem.txt" shared by "User One" should be in "Accepted" state on the webUI And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI And the file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI after a page reload And the file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI after a page reload @@ -273,7 +273,7 @@ Feature: accept/decline shares coming from internal users And user "user2" has declined the share "lorem.txt" offered by user "user1" And the user has browsed to the shared-with-me page When the user accepts share "lorem.txt" offered by user "User One" using the webUI - Then file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI + Then file "lorem.txt" shared by "User One" should be in "Accepted" state on the webUI And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI When the user browses to the files page Then file "lorem (2).txt" should be listed on the webUI diff --git a/tests/acceptance/pageObjects/sharedWithMePage.js b/tests/acceptance/pageObjects/sharedWithMePage.js index f5004e2f5b0..a8aec1a9b88 100644 --- a/tests/acceptance/pageObjects/sharedWithMePage.js +++ b/tests/acceptance/pageObjects/sharedWithMePage.js @@ -21,15 +21,13 @@ module.exports = { * gets displayed share status of file-name (shared by user of given username) * * @param {string} filename - * @param {string} sharer * * @return {Promise} */ - getShareStatusOfResource: async function(filename, sharer) { + getShareStatusOfResource: async function(filename) { let status const requiredXpath = this.api.page.FilesPageElement.filesList().getFileRowSelectorByFileName(filename) + - util.format(this.elements.resourceRowByShareOwner.selector, sharer) + this.elements.shareStatusOnFileRow.selector await this.useXpath() .waitForAnimationToFinish() @@ -48,16 +46,14 @@ module.exports = { /** * @param {string} filename * @param {string} action - It takes one of the following : Decline and Accept - * @param {string} user *Performs required action, such as accept and decline, on the file row element of the desired file name * shared by specific user */ - declineAcceptFile: function(action, filename, user) { + declineAcceptFile: function(action, filename) { const actionLocatorButton = { locateStrategy: this.elements.shareStatusActionOnFileRow.locateStrategy, selector: this.api.page.FilesPageElement.filesList().getFileRowSelectorByFileName(filename) + - util.format(this.elements.resourceRowByShareOwner.selector, user) + util.format(this.elements.shareStatusActionOnFileRow.selector, action) } return this.initAjaxCounters() @@ -97,11 +93,6 @@ module.exports = { } }, elements: { - resourceRowByShareOwner: { - selector: - '//td[contains(@class,"oc-table-data-cell-owner")]//div[@alt=normalize-space("%s")]/ancestor::tr', - locateStrategy: 'xpath' - }, shareStatusOnFileRow: { selector: "//span[contains(@class,'file-row-share-status-text')]", locateStrategy: 'xpath'