1
0
mirror of synced 2026-08-05 15:06:54 +00:00

chore: Fix typo in PlaywrightRegistry (#1497)

Fix typo in PlaywrightRegistry
This commit is contained in:
uchagani
2024-02-17 11:59:32 -05:00
committed by GitHub
parent e8e076310a
commit 1b2ac3f2c3
@@ -18,18 +18,18 @@ public class PlaywrightExtension implements ParameterResolver {
private static final ThreadLocal<Playwright> threadLocalPlaywright = new ThreadLocal<>();
private static final ExtensionContext.Namespace namespace = ExtensionContext.Namespace.create(PlaywrightExtension.class);
// There should be at most one instance of PlaywrgihtRegistry per test run, it keeps
// 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 PlaywrgihtRegistry implements ExtensionContext.Store.CloseableResource {
static class PlaywrightRegistry implements ExtensionContext.Store.CloseableResource {
private final List<Playwright> playwrightList = Collections.synchronizedList(new ArrayList<>());
static synchronized PlaywrgihtRegistry getOrCreateFor(ExtensionContext extensionContext) {
static synchronized PlaywrightRegistry getOrCreateFor(ExtensionContext extensionContext) {
ExtensionContext.Store rootStore = extensionContext.getRoot().getStore(namespace);
PlaywrgihtRegistry instance = (PlaywrgihtRegistry) rootStore.get(PlaywrgihtRegistry.class);
PlaywrightRegistry instance = (PlaywrightRegistry) rootStore.get(PlaywrightRegistry.class);
if (instance == null) {
instance = new PlaywrgihtRegistry();
rootStore.put(PlaywrgihtRegistry.class, instance);
instance = new PlaywrightRegistry();
rootStore.put(PlaywrightRegistry.class, instance);
}
return instance;
}
@@ -70,7 +70,7 @@ public class PlaywrightExtension implements ParameterResolver {
}
Options options = OptionsExtension.getOptions(extensionContext);
PlaywrgihtRegistry registry = PlaywrgihtRegistry.getOrCreateFor(extensionContext);
PlaywrightRegistry registry = PlaywrightRegistry.getOrCreateFor(extensionContext);
playwright = registry.createPlaywright(options.playwrightCreateOptions);
threadLocalPlaywright.set(playwright);