Skip to content

Commit ddaf71f

Browse files
committed
fix hello.js for windows
1 parent 3fef427 commit ddaf71f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/pit/its/hello.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,20 @@ const { log, args, createPage, closePage, takeScreenshot, waitForServerReady, di
3030

3131
// Click the button
3232
await page.locator('vaadin-button').click();
33-
await takeScreenshot(page, arg, __filename, 'button-clicked');
3433

3534
// Look for the text, sometimes rendered in an alert, sometimes in the dom
3635
let m;
3736
try {
3837
m = await page.getByRole('alert').nth(1).innerText({timeout: 500});
3938
} catch (e) {
4039
log(`Not Found ${text} in an 'alert' role`);
41-
m = await page.locator(`text=/${text}/`).first().innerText({timeout: 5000});
40+
try {
41+
m = await page.locator(`text=/${text}/`).first().innerText({timeout: 500});
42+
} catch (error) {
43+
log(`Not Found ${text} in an 'text=/${text}/' locator`);
44+
}
4245
}
46+
await takeScreenshot(page, arg, __filename, 'button-clicked');
4347
if (!new RegExp(text).test(m)) {
4448
throw new Error(`${text} text not found in ${m}`);
4549
}

0 commit comments

Comments
 (0)