Skip to content

Commit

Permalink
[Discover] Unksip and improve index pattern without time field functi…
Browse files Browse the repository at this point in the history
…onal test (#112698) (#113393)

Co-authored-by: Matthias Wilhelm <[email protected]>
  • Loading branch information
kibanamachine and kertal authored Sep 29, 2021
1 parent 24b7c67 commit 52113fb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/functional/apps/discover/_indexpattern_without_timefield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
Expand Down Expand Up @@ -56,22 +57,33 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('should display a timepicker after switching to an index pattern with timefield', async () => {
await PageObjects.discover.selectIndexPattern('with-timefield');
await PageObjects.discover.waitForDocTableLoadingComplete();
if (!(await PageObjects.timePicker.timePickerExists())) {
throw new Error('Expected timepicker to exist');
}
});
it('should switch between with and without timefield using the browser back button', async () => {
await PageObjects.discover.selectIndexPattern('without-timefield');
await PageObjects.discover.waitForDocTableLoadingComplete();
if (await PageObjects.timePicker.timePickerExists()) {
throw new Error('Expected timepicker not to exist');
}

await PageObjects.discover.selectIndexPattern('with-timefield');
await PageObjects.discover.waitForDocTableLoadingComplete();
if (!(await PageObjects.timePicker.timePickerExists())) {
throw new Error('Expected timepicker to exist');
}
// Navigating back to discover
// Navigating back
await browser.goBack();
await PageObjects.discover.waitForDocTableLoadingComplete();
await retry.waitForWithTimeout(
'index pattern to have been switched back to "without-timefield"',
5000,
async () =>
(await testSubjects.getVisibleText('indexPattern-switch-link')) === 'without-timefield'
);

if (await PageObjects.timePicker.timePickerExists()) {
throw new Error('Expected timepicker not to exist');
}
Expand Down

0 comments on commit 52113fb

Please sign in to comment.