Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Unksip and improve index pattern without time field functional test #112698

Merged
merged 6 commits into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions test/functional/apps/discover/_indexpattern_without_timefield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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');
const security = getService('security');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'timePicker', 'discover']);

// Failing: See 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 @@ -57,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