Skip to content

Commit

Permalink
Change painless scripted field (#21026) (#21046)
Browse files Browse the repository at this point in the history
* Change painless scripted field

* Remove wrong char

* Remove invalid escape chars
  • Loading branch information
nreese authored Jul 20, 2018
1 parent 1267432 commit 54d4c53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/functional/apps/management/_scripted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 54d4c53

Please sign in to comment.