1
0
mirror of synced 2026-05-22 18:53:15 +00:00

feat: enable loading alternative driver via system properties (#873)

This commit is contained in:
Alex (Huy Tran)
2022-03-31 04:42:18 +11:00
committed by GitHub
parent 1deccbb55d
commit 43d12a7662
2 changed files with 23 additions and 1 deletions
@@ -98,7 +98,9 @@ public abstract class Driver {
return new PreinstalledDriver(Paths.get(pathFromProperty));
}
Class<?> jarDriver = Class.forName("com.microsoft.playwright.impl.DriverJar");
String driverImpl =
System.getProperty("playwright.driver.impl", "com.microsoft.playwright.impl.DriverJar");
Class<?> jarDriver = Class.forName(driverImpl);
return (Driver) jarDriver.getDeclaredConstructor().newInstance();
}