Skip to content

Commit

Permalink
Fix resource names in share tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed Mar 1, 2021
1 parent 929e62c commit 61fd0f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 2 additions & 11 deletions tests/acceptance/pageObjects/sharedWithMePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>}
*/
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()
Expand All @@ -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()
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 61fd0f9

Please sign in to comment.