From 179b5c39ede1aca52ab51f5a0dce7675b3ab45bb Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Wed, 16 Dec 2020 11:24:46 -0800 Subject: [PATCH 1/7] Removed skip test for delete all alerts integration test --- .../apps/triggers_actions_ui/alerts_list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index 16b338c893736..f7281a1d93a46 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -349,7 +349,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await deleteAlerts([createdAlert.id]); }); - it.skip('should delete all selection', async () => { + it('should delete all selection', async () => { const namePrefix = generateUniqueKey(); let count = 0; const createdAlertsFirstPage = await Promise.all( From a87464fa51baf65cd99489ede549c5aaf68e394a Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Thu, 17 Dec 2020 11:18:10 -0800 Subject: [PATCH 2/7] fixed typechecks --- .../apps/triggers_actions_ui/details.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts index fdcb456493dab..c9eebe0172874 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts @@ -208,6 +208,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const headingText = await pageObjects.alertDetailsUI.getHeadingText(); expect(headingText).to.be(updatedAlertName); + await alerting.alerts.deleteAlert(alert.id); }); it('should reset alert when canceling an edit', async () => { @@ -255,6 +256,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const nameInputAfterCancel = await testSubjects.find('alertNameInput'); const textAfterCancel = await nameInputAfterCancel.getAttribute('value'); expect(textAfterCancel).to.eql(alert.name); + await alerting.alerts.deleteAlert(alert.id); }); }); @@ -284,6 +286,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.alertDetailsUI.clickViewInApp(); expect(await pageObjects.alertDetailsUI.getNoOpAppTitle()).to.be(`View Alert ${alert.id}`); + await alerting.alerts.deleteAlert(alert.id); }); it('renders a disabled alert details view in app button', async () => { @@ -304,6 +307,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(alert.name); expect(await pageObjects.alertDetailsUI.isViewInAppDisabled()).to.be(true); + await alerting.alerts.deleteAlert(alert.id); }); }); @@ -369,6 +373,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); + after(async () => await alerting.alerts.deleteAlert(alert.id)); + it('renders the active alert instances', async () => { // refresh to ensure Api call and UI are looking at freshest output await browser.refresh(); @@ -606,6 +612,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(alert.name); }); + after(async () => await alerting.alerts.deleteAlert(alert.id)); + const PAGE_SIZE = 10; it('renders the first page', async () => { // Verify content From f20031185d8dcd9f04fd595be68705cd71ab6d70 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Thu, 17 Dec 2020 12:27:07 -0800 Subject: [PATCH 3/7] reduced nuber of selected alert to delete to a single one --- .../apps/triggers_actions_ui/alerts_list.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index f7281a1d93a46..8e0d65241d426 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -353,7 +353,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const namePrefix = generateUniqueKey(); let count = 0; const createdAlertsFirstPage = await Promise.all( - times(2, () => createAlert({ name: `${namePrefix}-0${count++}` })) + times(1, () => createAlert({ name: `${namePrefix}-0${count++}` })) ); await refreshAlertsList(); await pageObjects.triggersActionsUI.searchAlerts(namePrefix); @@ -371,7 +371,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await retry.tryForTime(30000, async () => { const toastTitle = await pageObjects.common.closeToast(); - expect(toastTitle).to.eql('Deleted 2 alerts'); + expect(toastTitle).to.eql('Deleted 1 alert'); }); await pageObjects.triggersActionsUI.searchAlerts(namePrefix); From 08a37edb9ba33f63ecb435ecfc742505ff736440 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Mon, 21 Dec 2020 09:02:22 -0800 Subject: [PATCH 4/7] fixed due to comments --- .../apps/triggers_actions_ui/alerts_list.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index 8e0d65241d426..457986875821d 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -351,16 +351,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('should delete all selection', async () => { const namePrefix = generateUniqueKey(); - let count = 0; - const createdAlertsFirstPage = await Promise.all( - times(1, () => createAlert({ name: `${namePrefix}-0${count++}` })) - ); + const createdAlert = await createAlert({ name: `${namePrefix}-1` }); await refreshAlertsList(); await pageObjects.triggersActionsUI.searchAlerts(namePrefix); - for (const createdAlert of createdAlertsFirstPage) { - await testSubjects.click(`checkboxSelectRow-${createdAlert.id}`); - } + await testSubjects.click(`checkboxSelectRow-${createdAlert.id}`); await testSubjects.click('bulkAction'); From fc4fc5b199cef9049cfb4a02eb165f8e3b57bca8 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Mon, 21 Dec 2020 09:04:33 -0800 Subject: [PATCH 5/7] removed long timing retry --- .../apps/triggers_actions_ui/alerts_list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index 457986875821d..fe40b35993148 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -364,7 +364,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('deleteIdsConfirmation > confirmModalConfirmButton'); await testSubjects.missingOrFail('deleteIdsConfirmation'); - await retry.tryForTime(30000, async () => { + await retry.try(async () => { const toastTitle = await pageObjects.common.closeToast(); expect(toastTitle).to.eql('Deleted 1 alert'); }); From 69d397cddc9e7afb9424b28365ad3c56d6c51333 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Mon, 21 Dec 2020 09:55:21 -0800 Subject: [PATCH 6/7] fixed typechecks --- .../apps/triggers_actions_ui/alerts_list.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index fe40b35993148..e69fadc67c25f 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -5,7 +5,6 @@ */ import uuid from 'uuid'; -import { times } from 'lodash'; import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; From ba86af616406e5d4096c4dca9d5e87482cd3b3f5 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Mon, 4 Jan 2021 19:04:47 -0800 Subject: [PATCH 7/7] fixed failing tests --- .../apps/triggers_actions_ui/details.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts index c9fb82e1ccf8c..14bb35ee539fe 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts @@ -269,7 +269,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const headingText = await pageObjects.alertDetailsUI.getHeadingText(); expect(headingText).to.be(updatedAlertName); - await alerting.alerts.deleteAlert(alert.id); }); it('should reset alert when canceling an edit', async () => { @@ -301,7 +300,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const nameInputAfterCancel = await testSubjects.find('alertNameInput'); const textAfterCancel = await nameInputAfterCancel.getAttribute('value'); expect(textAfterCancel).to.eql(updatedAlertName); - await alerting.alerts.deleteAlert(alert.id); }); }); @@ -337,7 +335,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.alertDetailsUI.clickViewInApp(); expect(await pageObjects.alertDetailsUI.getNoOpAppTitle()).to.be(`View Alert ${alert.id}`); - await alerting.alerts.deleteAlert(alert.id); }); it('renders a disabled alert details view in app button', async () => { @@ -356,7 +353,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(alert.name); expect(await pageObjects.alertDetailsUI.isViewInAppDisabled()).to.be(true); - await alerting.alerts.deleteAlert(alert.id); }); }); @@ -598,8 +594,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(alert.name); }); - after(async () => await alerting.alerts.deleteAlert(alert.id)); - after(async () => { await objectRemover.removeAll(); });