From cc5f0bd8a94338ab6cce9e85264362225a0630cf Mon Sep 17 00:00:00 2001 From: neptunian Date: Mon, 24 May 2021 16:27:06 -0400 Subject: [PATCH] fix anomaly functional test --- .../test/functional/apps/infra/metrics_anomalies.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/x-pack/test/functional/apps/infra/metrics_anomalies.ts b/x-pack/test/functional/apps/infra/metrics_anomalies.ts index 54aaaae256f36..a3160c023d4a7 100644 --- a/x-pack/test/functional/apps/infra/metrics_anomalies.ts +++ b/x-pack/test/functional/apps/infra/metrics_anomalies.ts @@ -16,7 +16,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const infraSourceConfigurationForm = getService('infraSourceConfigurationForm'); // Failing: See https://github.com/elastic/kibana/issues/100445 - describe.skip('Metrics UI Anomaly Flyout', function () { + describe('Metrics UI Anomaly Flyout', function () { before(async () => { await esArchiver.load('empty_kibana'); }); @@ -62,16 +62,20 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await esArchiver.unload('infra/metrics_anomalies'); }); it('renders the anomaly table with anomalies', async () => { + // default threshold should already be 50 but trying to prevent unknown flakiness by setting it + // https://github.com/elastic/kibana/issues/100445 + await pageObjects.infraHome.goToSettings(); + await pageObjects.infraHome.setAnomaliesThreshold('50'); + await infraSourceConfigurationForm.saveConfiguration(); + await pageObjects.infraHome.goToInventory(); await pageObjects.infraHome.openAnomalyFlyout(); await pageObjects.infraHome.goToAnomaliesTab(); await pageObjects.infraHome.clickHostsAnomaliesDropdown(); await pageObjects.infraHome.setAnomaliesDate('Apr 21, 2021 @ 00:00:00.000'); const hostAnomalies = await pageObjects.infraHome.findAnomalies(); - // expect 2 anomalies with default Anomaly Severity Threshold setting (50) expect(hostAnomalies.length).to.be(2); await pageObjects.infraHome.clickK8sAnomaliesDropdown(); const k8sAnomalies = await pageObjects.infraHome.findAnomalies(); - // expect 3 anomalies with default Anomaly Severity Threshold setting (50) expect(k8sAnomalies.length).to.be(1); await pageObjects.infraHome.closeFlyout(); }); @@ -93,6 +97,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.infraHome.openAnomalyFlyout(); await pageObjects.infraHome.goToAnomaliesTab(); await pageObjects.infraHome.clickHostsAnomaliesDropdown(); + await pageObjects.infraHome.setAnomaliesDate('Apr 21, 2021 @ 00:00:00.000'); const hostAnomalies = await pageObjects.infraHome.findAnomalies(); expect(hostAnomalies.length).to.be(4); await pageObjects.infraHome.clickK8sAnomaliesDropdown();