[Discover] Fix time zone switch functional test in cloud env (#76396)

This commit is contained in:
Matthias Wilhelm 2020-09-04 13:22:35 +02:00 committed by GitHub
parent 89bf20ef6a
commit 1eec83d7b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View file

@ -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(

View file

@ -346,6 +346,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() {

View file

@ -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');