Skip to content

Commit

Permalink
[Discover] Unskip indexpattern without timefield functional tests (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored and kibanamachine committed Dec 22, 2021
1 parent afaf760 commit e8eb295
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions test/functional/apps/discover/_indexpattern_without_timefield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);

// FLAKY https://github.com/elastic/kibana/issues/107057
describe.skip('indexpattern without timefield', () => {
describe('indexpattern without timefield', () => {
before(async () => {
await security.testUser.setRoles(['kibana_admin', 'kibana_timefield']);
await esArchiver.loadIfNeeded(
Expand Down Expand Up @@ -66,28 +65,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
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 retry.waitForWithTimeout(
'The timepicker not to exist',
5000,
async () => !(await PageObjects.timePicker.timePickerExists())
);

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

if (await PageObjects.timePicker.timePickerExists()) {
throw new Error('Expected timepicker not to exist');
}
await retry.waitForWithTimeout(
'The timepicker not to exist',
5000,
async () => !(await PageObjects.timePicker.timePickerExists())
);
});
});
}

0 comments on commit e8eb295

Please sign in to comment.