mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Change painless scripted field * Remove wrong char * Remove invalid escape chars
This commit is contained in:
parent
126743296f
commit
54d4c5332c
1 changed files with 5 additions and 1 deletions
|
@ -149,7 +149,11 @@ export default function ({ getService, getPageObjects }) {
|
|||
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount());
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
await log.debug('add scripted field');
|
||||
const script = 'doc[\'machine.ram\'].value / (1024 * 1024 * 1024)';
|
||||
const script = `if (doc['machine.ram'].size() == 0) {
|
||||
return -1;
|
||||
} else {
|
||||
return doc['machine.ram'].value / (1024 * 1024 * 1024);
|
||||
}`;
|
||||
await PageObjects.settings.addScriptedField(scriptedPainlessFieldName, 'painless', 'number', null, '1', script);
|
||||
await retry.try(async function () {
|
||||
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be(startingCount + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue