Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Flaky test fix for Actions and Triggers app alerts should delete all selection (#86175) #87366

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');

Expand All @@ -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);
Expand Down