Skip to content

Commit 0debbb0

Browse files
authored
Add post-quit sleep for Safari (#220)
Hopefully this improves stability.
1 parent 33b49cf commit 0debbb0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/run-browser.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ import os from "os";
3333

3434
import {logInfo, logError, printHelp, runTest} from "./helper.mjs";
3535

36+
37+
function sleep(ms) {
38+
return new Promise(resolve => setTimeout(resolve, ms));
39+
}
40+
3641
const optionDefinitions = [
3742
{ name: "browser", type: String, description: "Set the browser to test, choices are [safari, firefox, chrome, edge]. By default the $BROWSER env variable is used." },
3843
{ name: "port", type: Number, defaultValue: 8010, description: "Set the test-server port, The default value is 8010." },
@@ -135,6 +140,8 @@ async function testEnd2End(params) {
135140
throw e;
136141
} finally {
137142
await driver.quit();
143+
if (BROWSER === "safari")
144+
await sleep(1000);
138145
if (!success) {
139146
await printLogs(sessionId);
140147
}

0 commit comments

Comments
 (0)