From b230c523520ecd230567c6cb87ee457189045e22 Mon Sep 17 00:00:00 2001 From: Anan Zhuang Date: Wed, 15 Nov 2023 05:33:00 +0000 Subject: [PATCH] e Signed-off-by: Anan Zhuang --- test/functional/apps/management/_scripted_fields.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index 82b69c626340..aa9db7023f98 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -181,16 +181,15 @@ export default function ({ getService, getPageObjects }) { //add a test to sort numeric scripted field it('should sort scripted field value in Discover', async function () { + await testSubjects.click('dataGridHeaderCell-@timestamp'); + await PageObjects.discover.clickTableHeaderListItem('@timestamp', 'Sort A-Z'); + await PageObjects.header.waitUntilLoadingHasFinished(); await testSubjects.click(`dataGridHeaderCell-${scriptedPainlessFieldName}`); await PageObjects.discover.clickTableHeaderListItem(scriptedPainlessFieldName, 'Sort A-Z'); await PageObjects.header.waitUntilLoadingHasFinished(); - //await pause(10000); - //await testSubjects.click('dataGridHeaderCell-@timestamp'); - //await PageObjects.discover.clickTableHeaderListItem('@timestamp', 'Sort A-Z'); - //await PageObjects.header.waitUntilLoadingHasFinished(); const sortedDataByTimeField = await PageObjects.discover.getDataGridTableValues(); - expect(sortedDataByTimeField[0][0]).contain('Sep 17, 2015 @ 10:53:14.181'); - expect(sortedDataByTimeField[0][1]).contain('-1'); + expect(sortedDataByTimeField[0][0]).contain('Sep 17, 2015 @ 06:32:29.479'); + expect(sortedDataByTimeField[0][1]).contain('20'); // click the column sorting button to remove painless field sort // should sort only by time field