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 <alexrudenko@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
This commit is contained in:
Alex Rudenko
2023-01-31 08:49:32 +00:00
committed by Devtools-frontend LUCI CQ
parent 14e8b46d06
commit 6aa5c62300
+7 -3
View File
@@ -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');
});