public class BaseTest {
protected static Playwright playwright;
protected static Browser browser;
protected BrowserContext context;
protected Page page;public void initSuite() {
playwright = Playwright.create();
browser = playwright.chromium().launch();
}
public void initTest() {
context = browser.newContext();
page = context.newPage();
}
public void cleanupTest() {
if (context != null) context.close();
}
public void cleanupSuite() {
if (browser != null) browser.close();
if (playwright != null) playwright.close();
}
}