luciole/cypress
Functions
pub fn contain(selector: String) -> Chainable(a)
Get the DOM element containing at least the text.
Yields the new DOM element found.
pub fn document() -> Chainable(a)
Get the windows.document object.
Yields the windows.document object.
pub fn exec(command: String) -> Chainable(a)
Execute a system command.
Yields an object with the following properties:
code
stdout
stderr
pub fn get(selector: String) -> Chainable(a)
Get one or more DOM elements by selector.
Yields the new DOM element(s) found.
A selector can be one of or a combination of :
- ID selector :
#elementId
- Class Selectors:
.elementClass
- Tag Selectors:
div
,span
- Attribute Selectors:
[type="text"]
,[href="/home"]
- Data Attribute Selectors:
[data-cy="button-confirm"]
- Combinator Selectors:
div > p
,div + p
,div ~ p
- XPath Selectors:
//div[@id='elementId']
pub fn visit(url: String) -> Chainable(Nil)
Visit a remote URL.
Yields the window object after the page finishes loading. Unsafe to chain further commands that rely on the yielded window.
pub fn wrap(subject: a) -> Chainable(a)
pub fn wrap_resolve(subject: Promise(a)) -> Chainable(a)
Resolve the promise and wrap it into a Chainable.
Yields the resolved value of the promise.