Skip to content

Commit

Permalink
fix: force WebDriver creation if DriverSupplier returns null (#1787) (#…
Browse files Browse the repository at this point in the history
…1788)

Co-authored-by: Marco Collovati <marco@vaadin.com>
  • Loading branch information
vaadin-bot and mcollovati authored Apr 17, 2024
1 parent 57ed5d2 commit 1ea7dd0
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,16 @@ private WebDriver createDriver(ExtensionContext context,

Object testInstance = context.getRequiredTestInstance();

WebDriver webDriver;

// use WebDriver provided by test instance
if (testInstance instanceof DriverSupplier supplier) {
return supplier.createDriver();
webDriver = supplier.createDriver();
if (webDriver != null) {
return webDriver;
}
}

WebDriver webDriver;

Class<?> testClass = context.getRequiredTestClass();
// Always give priority to @RunLocally annotation
if ((getRunLocallyBrowser(testClass) != null)) {
Expand Down

0 comments on commit 1ea7dd0

Please sign in to comment.