Skip to content

Commit

Permalink
Removed unused test and moved favorite check to context file
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed May 12, 2020
1 parent 903e177 commit 82bdf04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
18 changes: 0 additions & 18 deletions tests/acceptance/pageObjects/FilesPageElement/appSideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
15 changes: 4 additions & 11 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 82bdf04

Please sign in to comment.