diff --git a/tests/acceptance/helpers/loginHelper.js b/tests/acceptance/helpers/loginHelper.js index 51a71d91855..8d93f647574 100644 --- a/tests/acceptance/helpers/loginHelper.js +++ b/tests/acceptance/helpers/loginHelper.js @@ -20,7 +20,9 @@ module.exports = { } return client .page.phoenixPage() + .initAjaxCounters() .waitForElementVisible('@appContainer') + .waitForOutstandingAjaxCalls() .then(() => { client.globals.currentUser = userId }) diff --git a/tests/acceptance/helpers/navigationHelper.js b/tests/acceptance/helpers/navigationHelper.js index a270a004cad..10b163f6ebb 100644 --- a/tests/acceptance/helpers/navigationHelper.js +++ b/tests/acceptance/helpers/navigationHelper.js @@ -17,7 +17,9 @@ module.exports = { throw new Error('Invalid type for loading indicator selector') } return client + .initAjaxCounters() .waitForElementPresent({ ...locator, abortOnFailure: false }) // don't fail if we are too late .waitForElementNotPresent(locator) + .waitForOutstandingAjaxCalls() } } diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index fbb15c0b8c6..ed652ba57e3 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -199,6 +199,7 @@ module.exports = { */ navigateToFolder: async function (folder) { await this.waitForFileVisible(folder) + await this.initAjaxCounters() await this.useXpath() .moveToElement(this.getFileRowSelectorByFileName(folder), 0, 0) @@ -206,6 +207,9 @@ module.exports = { .useCss() .waitForElementNotPresent('@filesListProgressBar') + // wait for previews to finish loading + await this.waitForOutstandingAjaxCalls() + return this }, /** @@ -540,6 +544,7 @@ module.exports = { itemName = this.replaceChar(itemName, '"', '\\"') } + await this.initAjaxCounters() await this.waitForElementVisible('@virtualScrollWrapper') await this.api.executeAsync( function ( @@ -588,6 +593,10 @@ module.exports = { listHeaderSelector: this.elements.filesTableHeader.selector }]) + // wait for previews to be loaded after scrolling to resources that were + // not rendered before + await this.waitForOutstandingAjaxCalls() + return this },