Class BrowseTheWebWithPlaywright
java.lang.Object
net.serenitybdd.screenplay.playwright.abilities.BrowseTheWebWithPlaywright
- All Implemented Interfaces:
Ability,RefersToActor
public class BrowseTheWebWithPlaywright extends java.lang.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, java.lang.String browserType) -
Method Summary
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(java.lang.String browserType)BrowseTheWebWithPlaywrightwithHeadlessMode(java.lang.Boolean headless)static BrowseTheWebWithPlaywrightwithOptions(com.microsoft.playwright.BrowserType.LaunchOptions options)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
BrowseTheWebWithPlaywright
-
BrowseTheWebWithPlaywright
protected BrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables, com.microsoft.playwright.BrowserType.LaunchOptions options) -
BrowseTheWebWithPlaywright
protected BrowseTheWebWithPlaywright(EnvironmentVariables environmentVariables, com.microsoft.playwright.BrowserType.LaunchOptions options, java.lang.String browserType)
-
-
Method Details
-
as
-
getBrowser
public com.microsoft.playwright.Browser getBrowser() -
getCurrentPage
public com.microsoft.playwright.Page getCurrentPage() -
asActor
- Specified by:
asActorin interfaceRefersToActor
-
beginPerformance
-
endPerformance
-
perform
-
prepareQuestion
-
testFinishes
Shut down the Playwright instance and browser cleanly at the end of a Screenplay test. -
usingTheDefaultConfiguration
Create a new Playwright ability using default configuration values. -
withOptions
public static BrowseTheWebWithPlaywright withOptions(com.microsoft.playwright.BrowserType.LaunchOptions options) -
withBrowserType
-
withHeadlessMode
-