From 8ced30dcdba455936cb8bdfc3a4125228ee141da Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Thu, 2 Nov 2023 20:01:15 +0200 Subject: [PATCH] [Cases] Fix filtering e2e flaky tests (#170383) --- x-pack/test/functional/services/cases/list.ts | 7 ++++--- .../functional_with_es_ssl/apps/cases/group2/list_view.ts | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/x-pack/test/functional/services/cases/list.ts b/x-pack/test/functional/services/cases/list.ts index e1b4e45724283..a83b11da78b78 100644 --- a/x-pack/test/functional/services/cases/list.ts +++ b/x-pack/test/functional/services/cases/list.ts @@ -5,7 +5,6 @@ * 2.0. */ -import expect from '@kbn/expect'; import { CaseSeverityWithAll } from '@kbn/cases-plugin/common/ui'; import { CaseSeverity, CaseStatuses } from '@kbn/cases-plugin/common/types/domain'; import { WebElementWrapper } from '../../../../../test/functional/services/lib/web_element_wrapper'; @@ -85,10 +84,12 @@ export function CasesTableServiceProvider( }, async validateCasesTableHasNthRows(nrRows: number) { - await retry.tryForTime(3000, async () => { + await retry.waitFor(`the cases table to have ${nrRows} cases`, async () => { const rows = await find.allByCssSelector('[data-test-subj*="cases-table-row-"'); - expect(rows.length).equal(nrRows); + return rows.length === nrRows; }); + + await header.waitUntilLoadingHasFinished(); }, async waitForCasesToBeListed() { diff --git a/x-pack/test/functional_with_es_ssl/apps/cases/group2/list_view.ts b/x-pack/test/functional_with_es_ssl/apps/cases/group2/list_view.ts index e9daffe92c586..51a37c1eaccd9 100644 --- a/x-pack/test/functional_with_es_ssl/apps/cases/group2/list_view.ts +++ b/x-pack/test/functional_with_es_ssl/apps/cases/group2/list_view.ts @@ -279,8 +279,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/152925 - describe.skip('filtering', () => { + describe('filtering', () => { const caseTitle = 'matchme'; const caseIds: string[] = []; @@ -459,8 +458,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => { await testSubjects.existOrFail(`case-table-column-severity-${CaseSeverity.MEDIUM}`); }); - // FLAKY: https://github.com/elastic/kibana/issues/152928 - describe.skip('assignees filtering', () => { + describe('assignees filtering', () => { it('filters cases by the first cases all user assignee', async () => { await cases.casesTable.filterByAssignee('all'); await cases.casesTable.validateCasesTableHasNthRows(1);