chore(test): dont throw in tear down if setup failed (#118)

This commit is contained in:
Yury Semikhatsky 2020-12-14 11:50:12 -08:00 committed by GitHub
parent fa2e0f0237
commit 4b33bd6704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,8 +87,10 @@ public class TestBase {
@AfterAll @AfterAll
static void closeBrowser() { static void closeBrowser() {
browser.close(); if (browser != null) {
browser = null; browser.close();
browser = null;
}
} }
@BeforeAll @BeforeAll
@ -99,16 +101,22 @@ public class TestBase {
@AfterAll @AfterAll
static void stopServer() throws IOException { static void stopServer() throws IOException {
server.stop(); if (server != null) {
server = null; server.stop();
httpsServer.stop(); server = null;
httpsServer = null; }
if (httpsServer != null) {
httpsServer.stop();
httpsServer = null;
}
} }
@AfterAll @AfterAll
static void closePlaywright() throws Exception { static void closePlaywright() throws Exception {
playwright.close(); if (playwright != null) {
playwright = null; playwright.close();
playwright = null;
}
} }
BrowserContext createContext() { BrowserContext createContext() {