mirror of
https://github.com/microsoft/playwright-java.git
synced 2025-09-08 21:01:00 +00:00
chore(test): dont throw in tear down if setup failed (#118)
This commit is contained in:
parent
fa2e0f0237
commit
4b33bd6704
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user