diff --git a/playwright/src/main/java/com/microsoft/playwright/junit/impl/APIRequestContextExtension.java b/playwright/src/main/java/com/microsoft/playwright/junit/impl/APIRequestContextExtension.java index ca34a005..86d8a162 100644 --- a/playwright/src/main/java/com/microsoft/playwright/junit/impl/APIRequestContextExtension.java +++ b/playwright/src/main/java/com/microsoft/playwright/junit/impl/APIRequestContextExtension.java @@ -48,7 +48,13 @@ public class APIRequestContextExtension implements ParameterResolver, BeforeEach return getOrCreateAPIRequestContext(extensionContext); } - static APIRequestContext getOrCreateAPIRequestContext(ExtensionContext extensionContext) { + /** + * Returns the APIRequestContext that belongs to the current test. Will be created if it doesn't already exist. + * NOTE: this method is subject to change. + * @param extensionContext the context in which the current test or container is being executed. + * @return The APIRequestContext that belongs to the current test. + */ + public static APIRequestContext getOrCreateAPIRequestContext(ExtensionContext extensionContext) { APIRequestContext apiRequestContext = threadLocalAPIRequestContext.get(); if (apiRequestContext != null) { return apiRequestContext; diff --git a/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserContextExtension.java b/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserContextExtension.java index 12347d82..169f07a3 100644 --- a/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserContextExtension.java +++ b/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserContextExtension.java @@ -48,7 +48,13 @@ public class BrowserContextExtension implements ParameterResolver, AfterEachCall return getOrCreateBrowserContext(extensionContext); } - static BrowserContext getOrCreateBrowserContext(ExtensionContext extensionContext) { + /** + * Returns the BrowserContext that belongs to the current test. Will be created if it doesn't already exist. + * NOTE: this method is subject to change. + * @param extensionContext the context in which the current test or container is being executed. + * @return The BrowserContext that belongs to the current test. + */ + public static BrowserContext getOrCreateBrowserContext(ExtensionContext extensionContext) { BrowserContext browserContext = threadLocalBrowserContext.get(); if (browserContext != null) { return browserContext; diff --git a/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserExtension.java b/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserExtension.java index 11328452..5150924e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserExtension.java +++ b/playwright/src/main/java/com/microsoft/playwright/junit/impl/BrowserExtension.java @@ -47,7 +47,13 @@ public class BrowserExtension implements ParameterResolver, AfterAllCallback { return getOrCreateBrowser(extensionContext); } - static Browser getOrCreateBrowser(ExtensionContext extensionContext) { + /** + * Returns the Browser that belongs to the current test. Will be created if it doesn't already exist. + * NOTE: this method is subject to change. + * @param extensionContext the context in which the current test or container is being executed. + * @return The Browser that belongs to the current test. + */ + public static Browser getOrCreateBrowser(ExtensionContext extensionContext) { Browser browser = threadLocalBrowser.get(); if (browser != null) { return browser; diff --git a/playwright/src/main/java/com/microsoft/playwright/junit/impl/PageExtension.java b/playwright/src/main/java/com/microsoft/playwright/junit/impl/PageExtension.java index 4d6d16ee..c10b8aab 100644 --- a/playwright/src/main/java/com/microsoft/playwright/junit/impl/PageExtension.java +++ b/playwright/src/main/java/com/microsoft/playwright/junit/impl/PageExtension.java @@ -45,7 +45,13 @@ public class PageExtension implements ParameterResolver, AfterEachCallback { return getOrCreatePage(extensionContext); } - static Page getOrCreatePage(ExtensionContext extensionContext) { + /** + * Returns the Page that belongs to the current test. Will be created if it doesn't already exist. + * NOTE: this method is subject to change. + * @param extensionContext the context in which the current test or container is being executed. + * @return The Page that belongs to the current test. + */ + public static Page getOrCreatePage(ExtensionContext extensionContext) { Page page = threadLocalPage.get(); if (page != null) { return page; diff --git a/playwright/src/main/java/com/microsoft/playwright/junit/impl/PlaywrightExtension.java b/playwright/src/main/java/com/microsoft/playwright/junit/impl/PlaywrightExtension.java index 4178d098..5a60068e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/junit/impl/PlaywrightExtension.java +++ b/playwright/src/main/java/com/microsoft/playwright/junit/impl/PlaywrightExtension.java @@ -79,7 +79,13 @@ public class PlaywrightExtension implements ParameterResolver { return getOrCreatePlaywright(extensionContext); } - static Playwright getOrCreatePlaywright(ExtensionContext extensionContext) { + /** + * Returns the Playwright that belongs to the current test. Will be created if it doesn't already exist. + * NOTE: this method is subject to change. + * @param extensionContext the context in which the current test or container is being executed. + * @return The Playwright that belongs to the current test. + */ + public static Playwright getOrCreatePlaywright(ExtensionContext extensionContext) { Playwright playwright = threadLocalPlaywright.get(); if (playwright != null) { return playwright;