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,9 +87,11 @@ public class TestBase {
@AfterAll
static void closeBrowser() {
if (browser != null) {
browser.close();
browser = null;
}
}
@BeforeAll
static void startServer() throws IOException {
@ -99,17 +101,23 @@ public class TestBase {
@AfterAll
static void stopServer() throws IOException {
if (server != null) {
server.stop();
server = null;
}
if (httpsServer != null) {
httpsServer.stop();
httpsServer = null;
}
}
@AfterAll
static void closePlaywright() throws Exception {
if (playwright != null) {
playwright.close();
playwright = null;
}
}
BrowserContext createContext() {
return browser.newContext();