Skip to content

Commit 972ab82

Browse files
Adam RaineDevtools-frontend LUCI CQ
authored andcommitted
[Lighthouse] Prevent flake when switching to Lighthouse tab in tests
Bug: 388183157 Change-Id: I997a4c35821bbe003fffebee3774ad96909c7e6f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6147555 Commit-Queue: Connor Clark <[email protected]> Reviewed-by: Connor Clark <[email protected]> Auto-Submit: Adam Raine <[email protected]>
1 parent 3f3b139 commit 972ab82

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/e2e/helpers/lighthouse-helpers.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@ export async function navigateToLighthouseTab(path?: string): Promise<ElementHan
2727
lighthouseTabButton = await waitForElementWithTextContent('Lighthouse');
2828
}
2929

30-
await lighthouseTabButton.click();
31-
await waitFor('.view-container > .lighthouse');
30+
// TODO(b/388183157): Investigate why a single click doesn't open the tab properly sometimes
31+
const interval = setInterval(() => {
32+
void lighthouseTabButton.click();
33+
}, 500);
34+
35+
try {
36+
await waitFor('.view-container > .lighthouse');
37+
} finally {
38+
clearInterval(interval);
39+
}
3240

3341
const {target, frontend} = getBrowserAndPages();
3442
if (path) {

test/e2e/lighthouse/navigation_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ describe('Navigation', function() {
6666
console.error(consoleLog.join('\n'));
6767
}
6868
});
69-
// Flaky
70-
it.skip('[crbug.com/388183157] successfully returns a Lighthouse report', async () => {
69+
70+
it('successfully returns a Lighthouse report', async () => {
7171
await navigateToLighthouseTab('lighthouse/hello.html');
7272
await registerServiceWorker();
7373

0 commit comments

Comments
 (0)