mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Unskip test scripted fields preview (#124358)
* unskip test and change we how assert for expected states * REVERT - added .only for flaky test runner * remove .only Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
815685f264
commit
ee9f01e925
1 changed files with 21 additions and 4 deletions
|
@ -13,8 +13,15 @@ export default function ({ getService, getPageObjects }) {
|
|||
const PageObjects = getPageObjects(['settings']);
|
||||
const SCRIPTED_FIELD_NAME = 'myScriptedField';
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/118981
|
||||
describe.skip('scripted fields preview', () => {
|
||||
const scriptResultToJson = (scriptResult) => {
|
||||
try {
|
||||
return JSON.parse(scriptResult);
|
||||
} catch (e) {
|
||||
expect().fail(`Could JSON.parse script result: "${scriptResult}"`);
|
||||
}
|
||||
};
|
||||
|
||||
describe('scripted fields preview', () => {
|
||||
before(async function () {
|
||||
await browser.setWindowSize(1200, 800);
|
||||
await PageObjects.settings.navigateTo();
|
||||
|
@ -46,7 +53,15 @@ export default function ({ getService, getPageObjects }) {
|
|||
const scriptResults = await PageObjects.settings.executeScriptedField(
|
||||
`doc['bytes'].value * 2`
|
||||
);
|
||||
expect(scriptResults.replace(/\s/g, '')).to.contain('"myScriptedField":[6196');
|
||||
const [
|
||||
{
|
||||
_id,
|
||||
[SCRIPTED_FIELD_NAME]: { [0]: scriptedField },
|
||||
},
|
||||
] = scriptResultToJson(scriptResults);
|
||||
expect(_id).to.be.a('string');
|
||||
expect(scriptedField).to.be.a('number');
|
||||
expect(scriptedField).to.match(/[0-9]+/);
|
||||
});
|
||||
|
||||
it('should display additional fields', async function () {
|
||||
|
@ -54,7 +69,9 @@ export default function ({ getService, getPageObjects }) {
|
|||
`doc['bytes'].value * 2`,
|
||||
['bytes']
|
||||
);
|
||||
expect(scriptResults.replace(/\s/g, '')).to.contain('"bytes":3098');
|
||||
const [{ _id, bytes }] = scriptResultToJson(scriptResults);
|
||||
expect(_id).to.be.a('string');
|
||||
expect(bytes).to.be.a('number');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue