Skip to content

Commit

Permalink
add ftr
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Feb 2, 2024
1 parent 672e8c9 commit 790c3c4
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions test/functional/apps/discover/group1/_no_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
Expand All @@ -14,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects');
const dataGrid = getService('dataGrid');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']);

const createDataView = async (dataViewName: string) => {
Expand Down Expand Up @@ -53,8 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await PageObjects.common.navigateToApp('discover');

const button = await testSubjects.find('createDataViewButton');
button.click();
await testSubjects.click('createDataViewButton');
await retry.waitForWithTimeout('data view editor form to be visible', 15000, async () => {
return await (await find.byClassName('indexPatternEditor__form')).isDisplayed();
});
Expand All @@ -73,5 +74,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}
);
});

it('skips to Discover to try ES|QL', async () => {
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.uiSettings.update({
'timepicker:timeDefaults': '{ "from": "2015-09-18T19:37:13.000Z", "to": "now"}',
});
await PageObjects.common.navigateToApp('discover');

await testSubjects.click('tryESQLLink');

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await testSubjects.existOrFail('TextBasedLangEditor');
await testSubjects.existOrFail('unifiedHistogramChart');
const rows = await dataGrid.getDocTableRows();
expect(rows.length).to.be.above(0);
});
});
}

0 comments on commit 790c3c4

Please sign in to comment.