diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index db916b1d9b5..d4f4803fc2c 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -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 () { @@ -866,12 +847,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' }, diff --git a/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js b/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js index af518cd0e85..4bef0f2243e 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js +++ b/tests/acceptance/pageObjects/FilesPageElement/publicLinksDialog.js @@ -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: { @@ -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' } } } diff --git a/tests/acceptance/stepDefinitions/privateLinksContext.js b/tests/acceptance/stepDefinitions/privateLinksContext.js index b12e50ec859..f1b7e7f1cad 100644 --- a/tests/acceptance/stepDefinitions/privateLinksContext.js +++ b/tests/acceptance/stepDefinitions/privateLinksContext.js @@ -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 () {