mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* Advanced JSON input functional test * Replace string check with object property check Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
5daae0b0c0
commit
77e3f33b3c
1 changed files with 31 additions and 0 deletions
|
@ -6,12 +6,15 @@
|
|||
* Public License, v 1.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const log = getService('log');
|
||||
const inspector = getService('inspector');
|
||||
const filterBar = getService('filterBar');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']);
|
||||
|
||||
describe('inspector', function describeIndexTests() {
|
||||
|
@ -23,6 +26,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
||||
});
|
||||
|
||||
describe('advanced input JSON', () => {
|
||||
it('should have "missing" property with value 10', async () => {
|
||||
log.debug('Add Max Metric on memory field');
|
||||
await PageObjects.visEditor.clickBucket('Y-axis', 'metrics');
|
||||
await PageObjects.visEditor.selectAggregation('Max', 'metrics');
|
||||
await PageObjects.visEditor.selectField('memory', 'metrics');
|
||||
|
||||
log.debug('Add value to advanced JSON input');
|
||||
await PageObjects.visEditor.toggleAdvancedParams('2');
|
||||
await testSubjects.setValue('codeEditorContainer', '{ "missing": 10 }');
|
||||
await PageObjects.visEditor.clickGo();
|
||||
|
||||
await inspector.open();
|
||||
await inspector.openInspectorRequestsView();
|
||||
const requestTab = await inspector.getOpenRequestDetailRequestButton();
|
||||
await requestTab.click();
|
||||
const requestJSON = JSON.parse(await inspector.getCodeEditorValue());
|
||||
|
||||
expect(requestJSON.aggs['2'].max).property('missing', 10);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await inspector.close();
|
||||
await PageObjects.visEditor.removeDimension(2);
|
||||
await PageObjects.visEditor.clickGo();
|
||||
});
|
||||
});
|
||||
|
||||
describe('inspector table', function indexPatternCreation() {
|
||||
it('should update table header when columns change', async function () {
|
||||
await inspector.open();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue