1
0
mirror of synced 2026-08-31 19:55:37 +00:00

feat: custom temp dir for driver via playwright.driver.tmpdir property (#763)

This commit is contained in:
Yury Semikhatsky
2022-01-06 14:36:39 -08:00
committed by GitHub
parent e926c1ae82
commit b09b9aecfb
3 changed files with 32 additions and 11 deletions
@@ -54,15 +54,15 @@ public abstract class Driver {
throw new RuntimeException("Failed to create driver", exception);
}
}
String name = instance.cliFileName();
return instance.driverDir().resolve(name);
return instance.driverPath();
}
protected abstract void initialize(Map<String, String> env) throws Exception;
protected String cliFileName() {
return System.getProperty("os.name").toLowerCase().contains("windows") ?
public Path driverPath() {
String cliFileName = System.getProperty("os.name").toLowerCase().contains("windows") ?
"playwright.cmd" : "playwright.sh";
return driverDir().resolve(cliFileName);
}
private static Driver createDriver() throws Exception {