From f77d04015c66770718637f4668ce293166cb6874 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Fri, 30 Sep 2022 10:13:13 +0200 Subject: [PATCH] Fix acceptance tests --- tests/acceptance/pageObjects/webPage.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/acceptance/pageObjects/webPage.js b/tests/acceptance/pageObjects/webPage.js index d9bdb7b3ea4..ff2091a9d1a 100644 --- a/tests/acceptance/pageObjects/webPage.js +++ b/tests/acceptance/pageObjects/webPage.js @@ -12,7 +12,9 @@ module.exports = { * * @param {string} searchTerm */ - search: function (searchTerm) { + search: async function (searchTerm) { + // wait for search indexing to be finished + await this.pause(1000) return this.initAjaxCounters() .isVisible( { @@ -22,13 +24,13 @@ module.exports = { (result) => { if (result.value === true) { this.click('@openSearchButton') - .waitForElementVisible('@searchInputFieldHighResolution') - .setValue('@searchInputFieldHighResolution', [searchTerm, this.api.Keys.ENTER]) + .waitForElementVisible('@searchInputField') + .setValue('@searchInputField', [searchTerm, this.api.Keys.ENTER]) } else { - this.waitForElementVisible('@searchInputFieldHighResolution').setValue( - '@searchInputFieldHighResolution', - [searchTerm, this.api.Keys.ENTER] - ) + this.waitForElementVisible('@searchInputField').setValue('@searchInputField', [ + searchTerm, + this.api.Keys.ENTER + ]) } } ) @@ -287,14 +289,10 @@ module.exports = { ocDialogPromptAlert: { selector: '.oc-modal .oc-text-input-message' }, - searchInputFieldHighResolution: { + searchInputField: { selector: '(//input[contains(@class, "oc-search-input")])[1]', locateStrategy: 'xpath' }, - searchInputFieldLowResolution: { - selector: '(//input[contains(@class, "oc-search-input")])[2]', - locateStrategy: 'xpath' - }, searchLoadingIndicator: { selector: '#files-global-search-bar .oc-spinner' },