-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional tests for ESQL + Dashboard/No-Data
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
test/functional/apps/dashboard/group6/dashboard_esql_no_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", 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) { | ||
const kibanaServer = getService('kibanaServer'); | ||
const testSubjects = getService('testSubjects'); | ||
const { dashboard } = getPageObjects(['dashboard']); | ||
|
||
describe('dashboard from esql button on no-data-prompt', () => { | ||
before(async () => { | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
}); | ||
|
||
it('enables user to create a dashboard with ES|QL from no-data-prompt', async () => { | ||
await dashboard.navigateToApp(); | ||
|
||
await testSubjects.existOrFail('noDataViewsPrompt'); | ||
await testSubjects.click('tryESQLLink'); | ||
|
||
// ensure we have landed on Discover | ||
await testSubjects.existOrFail('switch-to-dataviews'); // "Switch to Classic" app menu button | ||
await testSubjects.existOrFail('discoverNewButton'); | ||
await testSubjects.existOrFail('discoverOpenButton'); | ||
|
||
const codeEditor = await testSubjects.find('kibanaCodeEditor'); | ||
expect(await codeEditor.getAttribute('innerText')).to.contain('FROM logs* | LIMIT 10'); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", 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) { | ||
const PageObjects = getPageObjects(['settings', 'common']); | ||
const testSubjects = getService('testSubjects'); | ||
|
||
describe('No Data Views: Try ES|QL', () => { | ||
it('navigates to Discover and presents an ES|QL query', async () => { | ||
await PageObjects.settings.navigateTo(); | ||
await PageObjects.settings.clickKibanaIndexPatterns(); | ||
await testSubjects.click('tryESQLLink'); | ||
|
||
// ensure we have landed on Discover | ||
await testSubjects.existOrFail('switch-to-dataviews'); // "Switch to Classic" app menu button | ||
await testSubjects.existOrFail('discoverNewButton'); | ||
await testSubjects.existOrFail('discoverOpenButton'); | ||
|
||
const codeEditor = await testSubjects.find('kibanaCodeEditor'); | ||
expect(await codeEditor.getAttribute('innerText')).to.contain('FROM logs* | LIMIT 10'); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters