Skip to content

Commit

Permalink
Fix acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Sep 30, 2022
1 parent f6f7fd2 commit f77d040
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tests/acceptance/pageObjects/webPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand All @@ -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
])
}
}
)
Expand Down Expand Up @@ -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'
},
Expand Down

0 comments on commit f77d040

Please sign in to comment.