Class Checkbox
java.lang.Object
net.serenitybdd.screenplay.playwright.ui.Checkbox
Factory for locating checkbox elements using Playwright selectors.
Uses Playwright's role selectors for accessibility-aware checkbox location.
Sample usage:
Target termsCheckbox = Checkbox.withLabel("I agree to the terms");
Target rememberMe = Checkbox.withNameOrId("remember-me");
Target optionA = Checkbox.withValue("option-a");
-
Method Summary
Modifier and TypeMethodDescriptionstatic TargetLocate a checkbox using a custom Playwright selector.static TargetLocate a checkbox by its label text (case-insensitive).static TargetwithNameOrId(String name) Locate a checkbox by its name attribute, id, or data-test attribute.static TargetLocate a checkbox by its value attribute.
-
Method Details
-
withLabel
Locate a checkbox by its label text (case-insensitive). Uses Playwright's role selector for semantic checkbox matching.- Parameters:
label- The checkbox's label or accessible name- Returns:
- A Target for the checkbox element
-
withNameOrId
Locate a checkbox by its name attribute, id, or data-test attribute.- Parameters:
name- The name, id, or data-test value- Returns:
- A Target for the checkbox element
-
withValue
Locate a checkbox by its value attribute.- Parameters:
value- The value attribute- Returns:
- A Target for the checkbox element
-
locatedBy
Locate a checkbox using a custom Playwright selector.- Parameters:
selector- A valid Playwright selector- Returns:
- A Target for the checkbox element
-