kibana/test/functional/apps/management/_runtime_fields.js
Tre 50eb5d9828
[Archive Migration][Partial] discover apps-management (#110444)
* [Archive Migration][Partial] discover apps-management

Comes from https://github.com/elastic/kibana/pull/102827

Helps with https://github.com/elastic/kibana/pull/108503

Only include the changes under the
test/functional/apps/management folder.

* Remove the index pattern, that the test
creates.

* Drop beforeEach(), in favour of before(),
since there's only one test.

* Drop outdated comment,
drop these three cleanup lines
as the unload should handle it.

* Just keep one cleanup.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-15 10:48:16 +01:00

75 lines
2.8 KiB
JavaScript

/*
* 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 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 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) {
const kibanaServer = getService('kibanaServer');
const log = getService('log');
const browser = getService('browser');
const retry = getService('retry');
const PageObjects = getPageObjects(['settings']);
const testSubjects = getService('testSubjects');
// FLAKY: https://github.com/elastic/kibana/issues/95376
describe.skip('runtime fields', function () {
this.tags(['skipFirefox']);
before(async function () {
await browser.setWindowSize(1200, 800);
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({});
});
after(async function afterAll() {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
});
describe('create runtime field', function describeIndexTests() {
const fieldName = 'atest';
it('should create runtime field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getFieldsTabCount());
await log.debug('add runtime field');
await PageObjects.settings.addRuntimeField(
fieldName,
'Keyword',
"emit('hello world')",
false
);
await log.debug('check that field preview is rendered');
expect(await testSubjects.exists('fieldPreviewItem', { timeout: 1500 })).to.be(true);
await PageObjects.settings.clickSaveField();
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getFieldsTabCount())).to.be(startingCount + 1);
});
});
it('should modify runtime field', async function () {
await PageObjects.settings.filterField(fieldName);
await testSubjects.click('editFieldFormat');
await PageObjects.settings.setFieldType('Long');
await PageObjects.settings.changeFieldScript('emit(6);');
await testSubjects.find('changeWarning');
await PageObjects.settings.clickSaveField();
await PageObjects.settings.confirmSave();
});
it('should delete runtime field', async function () {
await testSubjects.click('deleteField');
await PageObjects.settings.confirmDelete();
});
});
});
}