[Discover] Unskip indexpattern without timefield functional tests (#121505) (#121862)

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
This commit is contained in:
Kibana Machine 2021-12-22 06:31:09 -05:00 committed by GitHub
parent a037adbe6a
commit 4cf503dae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(
@ -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())
);
});
});
}