Skip to content

Commit

Permalink
feat(junit): make getOrCreate fixture methods public (#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
uchagani committed Mar 29, 2024
1 parent e7653dd commit 240f8d0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
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;
Expand Down

0 comments on commit 240f8d0

Please sign in to comment.