Component class abstract

Represents a reusable UI component within a web page, forming part of the Page Object Pattern.

Encapsulates a specific UI component, providing scoped selectors and ergonomic helpers for interacting with elements inside the component's root.

Constructors

Component(Browser browser, String selector)
Creates a new component with the given browser and root selector.

Properties

browser Browser
The browser instance for interacting with the page.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selector String
The CSS selector that identifies this component's root element in the DOM.
final

Methods

assertHas(String subSelector) Future<void>
Convenience: asserts a descendant exists within this component.
assertHasNot(String subSelector) Future<void>
Convenience: asserts a descendant does not exist within this component.
assertNotPresent() Future<void>
Asserts that the component's root element is not present.
assertPresent() Future<void>
Asserts that the component's root element is present.
click(String subSelector) Future<void>
Clicks a descendant element inside this component.
exists(String subSelector) Future<bool>
Returns whether a descendant element exists within this component.
find(String subSelector) Future
Finds a descendant element inside this component using subSelector.
findElement() Future
Finds the root DOM element for this component using its selector.
isPresent() Future<bool>
Returns whether this component's root element exists in the DOM.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scope(String subSelector) String
Returns a selector scoped within this component's root.
text(String subSelector) Future<String>
Reads text content of a descendant element inside this component.
toString() String
A string representation of this object.
inherited
type(String subSelector, String value) Future<void>
Types into a descendant element inside this component.
within<T>(FutureOr<T> action(String s(String subSelector))) Future<T>
Runs multiple actions with a scoping helper for this component.

Operators

operator ==(Object other) bool
The equality operator.
inherited