-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add runtime field functional test (#93710)
Add runtime fields editor functional test
- Loading branch information
Showing
4 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
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,52 @@ | ||
/* | ||
* 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 esArchiver = getService('esArchiver'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const log = getService('log'); | ||
const browser = getService('browser'); | ||
const retry = getService('retry'); | ||
const PageObjects = getPageObjects(['settings']); | ||
|
||
describe('runtime fields', function () { | ||
this.tags(['skipFirefox']); | ||
|
||
before(async function () { | ||
await browser.setWindowSize(1200, 800); | ||
await esArchiver.load('discover'); | ||
// delete .kibana index and then wait for Kibana to re-create it | ||
await kibanaServer.uiSettings.replace({}); | ||
await kibanaServer.uiSettings.update({}); | ||
}); | ||
|
||
after(async function afterAll() { | ||
await PageObjects.settings.navigateTo(); | ||
await PageObjects.settings.clickKibanaIndexPatterns(); | ||
await PageObjects.settings.removeLogstashIndexPatternIfExist(); | ||
}); | ||
|
||
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')"); | ||
await retry.try(async function () { | ||
expect(parseInt(await PageObjects.settings.getFieldsTabCount())).to.be(startingCount + 1); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} |
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