[Discover] Cleanup in runtime fields editor functional test (#97820)

* [Discover] Cleanup in runtime fields editor functional test

* Add uuid to field label

* Adding field after the update

* Unskip test

* Remove uuid from custom label

* Remove unused import
This commit is contained in:
Maja Grubic 2021-04-27 07:40:39 +01:00 committed by GitHub
parent 9cade4299f
commit 26962cd705
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,8 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await fieldEditor.save();
};
// FLAKY: https://github.com/elastic/kibana/issues/97864
describe.skip('discover integration with runtime fields editor', function describeIndexTests() {
describe('discover integration with runtime fields editor', function describeIndexTests() {
before(async function () {
await esArchiver.load('discover');
await esArchiver.loadIfNeeded('logstash_functional');
@ -43,19 +42,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.timePicker.setDefaultAbsoluteRange();
});
after(async () => {
await kibanaServer.uiSettings.replace({ 'discover:searchFieldsFromSource': true });
});
it('allows adding custom label to existing fields', async function () {
await PageObjects.discover.clickFieldListItemAdd('bytes');
const customLabel = 'megabytes';
await PageObjects.discover.editField('bytes');
await fieldEditor.enableCustomLabel();
await fieldEditor.setCustomLabel('megabytes');
await fieldEditor.setCustomLabel(customLabel);
await fieldEditor.save();
await PageObjects.header.waitUntilLoadingHasFinished();
expect(await PageObjects.discover.getDocHeader()).to.have.string('megabytes');
expect((await PageObjects.discover.getAllFieldNames()).includes('megabytes')).to.be(true);
expect((await PageObjects.discover.getAllFieldNames()).includes(customLabel)).to.be(true);
await PageObjects.discover.clickFieldListItemAdd('bytes');
expect(await PageObjects.discover.getDocHeader()).to.have.string(customLabel);
});
it('allows creation of a new field', async function () {