From 6aa5c623005f2937c00a308c16767bd188fa7879 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Tue, 31 Jan 2023 09:07:53 +0100 Subject: [PATCH] Reduce flakiness for a memory test Bug: none Change-Id: Ie4eea3486927552617e36ec355a77bfc37989f9f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4207828 Commit-Queue: Alex Rudenko Reviewed-by: Wolfgang Beyer --- test/e2e/memory/memory_test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/e2e/memory/memory_test.ts b/test/e2e/memory/memory_test.ts index 30c5c775b0..ce0ad1e32a 100644 --- a/test/e2e/memory/memory_test.ts +++ b/test/e2e/memory/memory_test.ts @@ -133,10 +133,14 @@ describe('The Memory Panel', async function() { await setSearchFilter('Pending activities'); // Here and below we have to wait until the elements are actually created // and visible. - const pendingActivitiesSpan = await waitFor('//span[text()="Pending activities"]', undefined, undefined, 'xpath'); - const pendingActiviesRow = await $('ancestor-or-self::tr', pendingActivitiesSpan, 'xpath'); await waitForFunction(async () => { - await clickElement(pendingActivitiesSpan); + const pendingActivitiesSpan = await waitFor('//span[text()="Pending activities"]', undefined, undefined, 'xpath'); + const pendingActiviesRow = await waitFor('ancestor-or-self::tr', pendingActivitiesSpan, undefined, 'xpath'); + try { + await clickElement(pendingActivitiesSpan); + } catch { + return false; + } const res = await pendingActiviesRow.evaluate(x => x.classList.toString()); return res.includes('selected'); });