Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Commit f6f527e

Browse files
committed
Null checks are needed after all, there's no need to close WebDriver when the test hasn't created it
1 parent a860154 commit f6f527e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bb-junit5/src/main/java/com/cognifide/qa/bb/junit5/selenium/WebdriverCloseExtension.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public void beforeTestExecution(ExtensionContext context) {
5151
*/
5252
@Override
5353
public void afterTestExecution(ExtensionContext context) {
54-
webDriver.quit();
54+
if (webDriver != null) {
55+
webDriver.quit();
56+
}
5557
}
5658

5759
/**

0 commit comments

Comments
 (0)