Annotation Interface PlaywrightCastMember
Annotation to inject an Actor with the BrowseTheWebWithPlaywright ability into a test.
The actor will be configured with a Playwright browser based on the annotation attributes.
Usage example:
@ExtendWith(SerenityJUnit5Extension.class)
public class MyPlaywrightTest {
@PlaywrightCastMember(name = "Alice")
Actor alice;
@PlaywrightCastMember(browserType = "firefox", headless = false)
Actor bob;
@Test
void should_browse_with_playwright() {
alice.attemptsTo(
Open.url("https://example.com"),
Ensure.that("h1").isVisible()
);
}
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe browser type to use.A description of the actor, which will appear alongside the actor name in reports.booleanWhether to run the browser in headless mode.The name of the actor.
-
Element Details
-
name
String nameThe name of the actor. If not specified, the capitalized field name will be used.- Default:
- ""
-
description
String descriptionA description of the actor, which will appear alongside the actor name in reports.- Default:
- ""
-
browserType
String browserTypeThe browser type to use. Supported values are "chromium", "firefox", and "webkit". Default is "chromium".- Default:
- "chromium"
-
headless
boolean headlessWhether to run the browser in headless mode. Default is true.- Default:
- true
-