Skip to content

Commit

Permalink
fix some async/await in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Aug 12, 2021
1 parent 74a2168 commit eb8863c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tests/acceptance/pageObjects/FilesPageElement/appSideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module.exports = {
this.api.page.personalPage().elements.sideBar
).waitForElementVisible(this.elements.fileInfoIcon)
},
closeSidebar: function(timeout = null) {
closeSidebar: async function(timeout = null) {
timeout = timeoutHelper.parseTimeout(timeout)
try {
this.click({
await this.click({
selector: '@sidebarCloseBtn',
timeout: timeout
})
Expand All @@ -29,18 +29,14 @@ module.exports = {
this.api.globals.waitForNegativeConditionTimeout
)
if (!active) {
try {
this.click({
selector: '@sidebarBackBtn'
})
} catch (e) {
// do nothing
}
await this.click({
selector: '@sidebarBackBtn',
timeout: timeoutHelper.parseTimeout(this.api.globals.waitForNegativeConditionTimeout)
})
await this.waitForAnimationToFinish()
this.useXpath()
.initAjaxCounters()
.click(this.getXpathOfPanelSelect(item))
.waitForOutstandingAjaxCalls()
.waitForAjaxCallsToStartAndFinish()
.useCss()
await this.waitForAnimationToFinish()
}
Expand Down Expand Up @@ -117,7 +113,7 @@ module.exports = {
let isVisible = false
timeout = timeoutHelper.parseTimeout(timeout)
await this.isVisible({ locateStrategy: 'css selector', selector, timeout }, result => {
isVisible = result.status === 0
isVisible = result.value === true
})
return isVisible
},
Expand Down

0 comments on commit eb8863c

Please sign in to comment.