Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class PlaywrightExtension implements ParameterResolver {
// There should be at most one instance of PlaywrightRegistry per test run, it keeps
// track of all created Playwright instances and calls `close()` on each of them after
// the tests finished.
static class PlaywrightRegistry implements ExtensionContext.Store.CloseableResource {
static class PlaywrightRegistry implements AutoCloseable {
private final List<Playwright> playwrightList = Collections.synchronizedList(new ArrayList<>());

static synchronized PlaywrightRegistry getOrCreateFor(ExtensionContext extensionContext) {
Expand All @@ -59,7 +59,7 @@ Playwright createPlaywright(Playwright.CreateOptions options) {
// This is a workaround for JUnit's lack of an "AfterTestRun" hook
// This will be called once after all tests have completed.
@Override
public void close() throws Throwable {
public void close() {
for (Playwright playwright : playwrightList) {
playwright.close();
}
Expand Down