Skip to content

Commit 9ae97da

Browse files
Reduce flakyness when clicking record
1 parent f58532d commit 9ae97da

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

test-e2e/test-utils.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,19 @@ export async function clickRecordButton(page: Page) {
254254
const selector = '[data-testid="record-btn"]';
255255
await waitForSelector(page, selector);
256256
const start = /Start/.test(await getAttribute(page, selector, "title"));
257-
await clickSelector(page, selector);
258-
259-
await waitForAttribute(
260-
page,
261-
selector,
262-
"title",
263-
start ? /Stop Recording/ : /Start Recording/,
264-
);
257+
await clickSelector(page, selector, {
258+
async retryUntil() {
259+
await page.evaluate(
260+
(s, start) => {
261+
return (start ? /Stop Recording/ : /Start Recording/).test(
262+
document.querySelector(s).title,
263+
);
264+
},
265+
selector,
266+
start,
267+
);
268+
},
269+
});
265270
}
266271

267272
// TODO: This might clash with windowing

0 commit comments

Comments
 (0)