From 82bdf04166413e7e7180978415242f631acdf4c0 Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Tue, 12 May 2020 10:33:45 +0200 Subject: [PATCH] Removed unused test and moved favorite check to context file --- .../pageObjects/FilesPageElement/appSideBar.js | 18 ------------------ .../acceptance/stepDefinitions/filesContext.js | 15 ++++----------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js b/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js index 64958d6c1d0..68620caf9ec 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js +++ b/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js @@ -69,24 +69,6 @@ module.exports = { .waitForElementVisible('@favoriteStarShining') .click('@sidebarToggleFavoriteButton') .waitForElementVisible('@favoriteStarDimm') - }, - - /** - * Asserts whether the resource in the sidebar is marked as favorite - * @param {Boolean} shouldBeMarked - */ - isMarkedAsFavorite: function(shouldBeMarked) { - if (shouldBeMarked) { - this.expect.element('@favoriteStarShining').to.be.visible - this.closeSidebar(500) - - return this - } - - this.expect.element('@favoriteStarDimm').to.be.visible - this.closeSidebar(500) - - return this } }, elements: { diff --git a/tests/acceptance/stepDefinitions/filesContext.js b/tests/acceptance/stepDefinitions/filesContext.js index 1e8060d828c..c297e5eb2db 100644 --- a/tests/acceptance/stepDefinitions/filesContext.js +++ b/tests/acceptance/stepDefinitions/filesContext.js @@ -318,15 +318,6 @@ When('the user unmarks the favorited file/folder {string} using the webUI', func return client.page.FilesPageElement.filesList().unmarkFavorite(path) }) -When('the user has marked file/folder {string} as favorite using the webUI sidebar', async function( - path -) { - const api = client.page.FilesPageElement - await api.filesList().clickRow(path) - api.appSideBar().markFavoriteSidebar() - return client -}) - When('the user marks file/folder {string} as favorite using the webUI sidebar', async function( path ) { @@ -664,15 +655,17 @@ Then('file/folder {string} should not be marked as favorite', async function(pat }) Then('file/folder {string} should be marked as favorite on the webUI', async function(path) { + const selector = client.page.FilesPageElement.appSideBar().elements.breadcrumb.favoriteStarShining await client.page.FilesPageElement.filesList().clickRow(path) - return client.page.FilesPageElement.appSideBar().isMarkedAsFavorite(true) + return client.expect.element(selector).to.be.visible }) Then('file/folder {string} should not be marked as favorite on the webUI', async function(path) { + const selector = client.page.FilesPageElement.appSideBar().elements.breadcrumb.favoriteStarDimm await client.page.FilesPageElement.filesList().clickRow(path) - return client.page.FilesPageElement.appSideBar().isMarkedAsFavorite() + return client.expect.element(selector).to.be.visible }) Then(/there should be (\d+) files\/folders listed on the webUI/, async function(noOfItems) {