From ce8f529f1547255d46e0a971acded667f5dbdeb5 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Tue, 5 Jan 2021 12:50:56 -0800 Subject: [PATCH] Flaky test fix for Actions and Triggers app alerts should delete all selection (#86175) (#87366) * Removed skip test for delete all alerts integration test * fixed typechecks * reduced nuber of selected alert to delete to a single one * fixed due to comments * removed long timing retry * fixed typechecks * fixed failing tests --- .../apps/triggers_actions_ui/alerts_list.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 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 e2c064169dc92..6221c2cc8131e 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 @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { times } from 'lodash'; import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { ObjectRemover } from '../../lib/object_remover'; @@ -323,18 +322,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(isChecked).to.eql('false'); }); - it.skip('should delete all selection', async () => { + it('should delete all selection', async () => { const namePrefix = generateUniqueKey(); - let count = 0; - const createdAlertsFirstPage = await Promise.all( - times(2, () => createAlertManualCleanup({ name: `${namePrefix}-0${count++}` })) - ); + const createdAlert = await createAlertManualCleanup({ 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'); @@ -343,9 +337,9 @@ 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 2 alerts'); + expect(toastTitle).to.eql('Deleted 1 alert'); }); await pageObjects.triggersActionsUI.searchAlerts(namePrefix);