Class BrowseTheWebWithPlaywright
- java.lang.Object
-
- net.serenitybdd.screenplay.playwright.abilities.BrowseTheWebWithPlaywright
-
- All Implemented Interfaces:
Ability,RefersToActor
public class BrowseTheWebWithPlaywright extends Object implements Ability, RefersToActor
This ability wraps the Playwright Browser object. The following options can be used to configure the Chrome instance: - webdriver.chrome.binary: path to the chrome binary -
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables)protectedBrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables, com.microsoft.playwright.BrowserType.LaunchOptions options)protectedBrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables, com.microsoft.playwright.BrowserType.LaunchOptions options, String browserType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BrowseTheWebWithPlaywrightas(Actor actor)<T extends Ability>
TasActor(Actor actor)voidbeginPerformance(ActorBeginsPerformanceEvent performanceEvent)voidendPerformance(ActorEndsPerformanceEvent performanceEvent)com.microsoft.playwright.BrowsergetBrowser()com.microsoft.playwright.PagegetCurrentPage()voidperform(ActorPerforms performAction)voidprepareQuestion(ActorAsksQuestion questionEvent)voidtestFinishes(TestLifecycleEvents.TestFinished testFinished)Shut down the Playwright instance and browser cleanly at the end of a Screenplay test.static BrowseTheWebWithPlaywrightusingTheDefaultConfiguration()Create a new Playwright ability using default configuration values.BrowseTheWebWithPlaywrightwithBrowserType(String browserType)BrowseTheWebWithPlaywrightwithHeadlessMode(Boolean headless)static BrowseTheWebWithPlaywrightwithOptions(com.microsoft.playwright.BrowserType.LaunchOptions options)
-
-
-
Constructor Detail
-
BrowseTheWebWithPlaywright
protected BrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables)
-
BrowseTheWebWithPlaywright
protected BrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables, com.microsoft.playwright.BrowserType.LaunchOptions options)
-
BrowseTheWebWithPlaywright
protected BrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables, com.microsoft.playwright.BrowserType.LaunchOptions options, String browserType)
-
-
Method Detail
-
as
public static BrowseTheWebWithPlaywright as(Actor actor)
-
getBrowser
public com.microsoft.playwright.Browser getBrowser()
-
getCurrentPage
public com.microsoft.playwright.Page getCurrentPage()
-
asActor
public <T extends Ability> T asActor(Actor actor)
- Specified by:
asActorin interfaceRefersToActor
-
beginPerformance
public void beginPerformance(ActorBeginsPerformanceEvent performanceEvent)
-
endPerformance
public void endPerformance(ActorEndsPerformanceEvent performanceEvent)
-
perform
public void perform(ActorPerforms performAction)
-
prepareQuestion
public void prepareQuestion(ActorAsksQuestion questionEvent)
-
testFinishes
public void testFinishes(TestLifecycleEvents.TestFinished testFinished)
Shut down the Playwright instance and browser cleanly at the end of a Screenplay test.
-
usingTheDefaultConfiguration
public static BrowseTheWebWithPlaywright usingTheDefaultConfiguration()
Create a new Playwright ability using default configuration values.
-
withOptions
public static BrowseTheWebWithPlaywright withOptions(com.microsoft.playwright.BrowserType.LaunchOptions options)
-
withBrowserType
public BrowseTheWebWithPlaywright withBrowserType(String browserType)
-
withHeadlessMode
public BrowseTheWebWithPlaywright withHeadlessMode(Boolean headless)
-
-