From 67bf9fcbe4101b7526facd4bb7652ac33fef00e1 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Tue, 24 Nov 2020 21:45:21 +0100 Subject: [PATCH 1/2] Unskip functional test --- test/functional/apps/discover/_discover.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index fe5c04c001731..94f75a98ccc0b 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -32,8 +32,7 @@ export default function ({ getService, getPageObjects }) { defaultIndex: 'logstash-*', }; - // Failing: See https://github.com/elastic/kibana/issues/82915 - describe.skip('discover test', function describeIndexTests() { + describe('discover test', function describeIndexTests() { before(async function () { log.debug('load kibana index with default index pattern'); await esArchiver.load('discover'); @@ -315,8 +314,8 @@ export default function ({ getService, getPageObjects }) { const getRequestTimestamp = async () => { const requestStats = await inspector.getTableData(); - const requestTimestamp = requestStats.filter((r) => - r[0].includes('Request timestamp') + const requestTimestamp = requestStats.filter( + (r) => r && r[0] && r[0].includes('Request timestamp') )[0][1]; return requestTimestamp; }; From 96e475ce30bd574ee7e5ec143ef5c3f3c618d5bb Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Thu, 26 Nov 2020 15:51:39 +0100 Subject: [PATCH 2/2] Improve code --- test/functional/apps/discover/_discover.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 94f75a98ccc0b..2270f3c815aaa 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -314,10 +314,13 @@ export default function ({ getService, getPageObjects }) { const getRequestTimestamp = async () => { const requestStats = await inspector.getTableData(); - const requestTimestamp = requestStats.filter( + const requestStatsRow = requestStats.filter( (r) => r && r[0] && r[0].includes('Request timestamp') - )[0][1]; - return requestTimestamp; + ); + if (!requestStatsRow || !requestStatsRow[0] || !requestStatsRow[0][1]) { + return ''; + } + return requestStatsRow[0][1]; }; const requestTimestampBefore = await getRequestTimestamp(); @@ -326,7 +329,7 @@ export default function ({ getService, getPageObjects }) { log.debug( `Timestamp before: ${requestTimestampBefore}, Timestamp after: ${requestTimestampAfter}` ); - return requestTimestampBefore !== requestTimestampAfter; + return requestTimestampAfter && requestTimestampBefore !== requestTimestampAfter; }); });