feat(junit): make getOrCreate fixture methods public (#1527)

This commit is contained in:
uchagani 2024-03-29 12:21:35 -04:00 коммит произвёл GitHub
Родитель e7653ddde7
Коммит 240f8d0873
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 35 добавлений и 5 удалений

Просмотреть файл

@ -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.
* <strong>NOTE:</strong> 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;

Просмотреть файл

@ -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.
* <strong>NOTE:</strong> 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;

Просмотреть файл

@ -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.
* <strong>NOTE:</strong> 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;

Просмотреть файл

@ -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.
* <strong>NOTE:</strong> 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;

Просмотреть файл

@ -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.
* <strong>NOTE:</strong> 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;