Skip to content

Commit

Permalink
Improve query reset to prevent cloud flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Sep 1, 2020
1 parent e7951eb commit 5c9858d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ export default function ({ getService, getPageObjects }) {
await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'America/Phoenix' });
await PageObjects.common.navigateToApp('discover');
await PageObjects.header.awaitKibanaChrome();
await queryBar.setQuery('');
// To remove focus of the of the search bar so date/time picker can show
await PageObjects.discover.selectIndexPattern(defaultSettings.defaultIndex);
await queryBar.clearQuery();
await PageObjects.timePicker.setDefaultAbsoluteRange();

log.debug(
Expand Down
4 changes: 4 additions & 0 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
await browser.pressKeys(browser.keys.ENTER);
}

async pressTabKey() {
await browser.pressKeys(browser.keys.TAB);
}

// Pause the browser at a certain place for debugging
// Not meant for usage in CI, only for dev-usage
async pause() {
Expand Down
5 changes: 5 additions & 0 deletions test/functional/services/query_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export function QueryBarProvider({ getService, getPageObjects }: FtrProviderCont
});
}

public async clearQuery(): Promise<void> {
await this.setQuery('');
await PageObjects.common.pressTabKey();
}

public async submitQuery(): Promise<void> {
log.debug('QueryBar.submitQuery');
await testSubjects.click('queryInput');
Expand Down

0 comments on commit 5c9858d

Please sign in to comment.