Skip to content

Commit

Permalink
moved copyPrivateLink and related methods/elements to publicLinksDial…
Browse files Browse the repository at this point in the history
…og PO
  • Loading branch information
kiranparajuli589 committed Feb 26, 2020
1 parent e2c72e2 commit 5bd36c3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
25 changes: 0 additions & 25 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,30 +558,11 @@ module.exports = {
}
return visible
},
copyPrivateLink: function () {
const appSideBar = this.api.page.FilesPageElement.appSideBar()
const sidebarLinksTabXpath = appSideBar.elements.sidebarLinksTab.selector
const sidebarCss = appSideBar.elements.sideBar.selector

return this
.waitForElementVisible(sidebarCss)
.useXpath()
.waitForElementVisible(sidebarLinksTabXpath)
.click(sidebarLinksTabXpath)
.waitForElementVisible('@sidebarPrivateLinkLabel')
.click('@sidebarPrivateLinkLabel')
.waitForElementNotPresent('@sidebarPrivateLinkLabel')
.waitForElementVisible('@sidebarPrivateLinkIconCopied')
.waitForElementNotPresent('@sidebarPrivateLinkIconCopied')
.waitForElementVisible('@sidebarPrivateLinkLabel')
.useCss()
},
deleteImmediately: async function (fileName) {
await this.waitForFileVisible(fileName)
await this
.performFileAction(fileName, FileAction.deleteImmediately)
.confirmDeletion()

return this
},
countFilesAndFolders: async function () {
Expand Down Expand Up @@ -843,12 +824,6 @@ module.exports = {
selector: '//div[@class="sidebar-container"]//a[normalize-space(.)="Links"]',
locateStrategy: 'xpath'
},
sidebarPrivateLinkLabel: {
selector: '#files-sidebar-private-link-label'
},
sidebarPrivateLinkIconCopied: {
selector: '#files-sidebar-private-link-icon-copied'
},
collaboratorsList: {
selector: '.files-collaborators-lists'
},
Expand Down
24 changes: 24 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,24 @@ module.exports = {
return this
.waitForElementVisible(copyBtnSelector)
.click(copyBtnSelector)
},
copyPrivateLink: function () {
const appSideBarElements = this.api.page.FilesPageElement.appSideBar().elements
const sidebarLinksTabXpath = appSideBarElements.sidebarLinksTab.selector
const sidebarCss = appSideBarElements.sideBar.selector

return this
.waitForElementVisible(sidebarCss)
.useXpath()
.waitForElementVisible(sidebarLinksTabXpath)
.click(sidebarLinksTabXpath)
.waitForElementVisible('@sidebarPrivateLinkLabel')
.click('@sidebarPrivateLinkLabel')
.waitForElementNotPresent('@sidebarPrivateLinkLabel')
.waitForElementVisible('@sidebarPrivateLinkIconCopied')
.waitForElementNotPresent('@sidebarPrivateLinkIconCopied')
.waitForElementVisible('@sidebarPrivateLinkLabel')
.useCss()
}
},
elements: {
Expand Down Expand Up @@ -579,6 +597,12 @@ module.exports = {
dateTimeCancelButton: {
selector: '//div[@class="vdatetime-popup__actions"]/div[.="Cancel"]',
locateStrategy: 'xpath'
},
sidebarPrivateLinkLabel: {
selector: '#files-sidebar-private-link-label'
},
sidebarPrivateLinkIconCopied: {
selector: '#files-sidebar-private-link-icon-copied'
}
}
}
7 changes: 3 additions & 4 deletions tests/acceptance/stepDefinitions/privateLinksContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ const { When } = require('cucumber')
const webdav = require('../helpers/webdavHelper')

When('the user copies the private link of the file/folder {string} using the webUI', async function (resource) {
const api = client.page.FilesPageElement.filesList()
await api
.clickRow(resource)
const api = client.page.FilesPageElement
await api.filesList().clickRow(resource)

return api.copyPrivateLink()
return api.publicLinksDialog().copyPrivateLink()
})

When('the user navigates to the copied private/public link using the webUI', function () {
Expand Down

0 comments on commit 5bd36c3

Please sign in to comment.