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.

See Cypress Documentation - contains.

pub fn document() -> Chainable(a)

Get the windows.document object.

Yields the windows.document object.

See Cypress Documentation - contains.

pub fn exec(command: String) -> Chainable(a)

Execute a system command.

Yields an object with the following properties:

  • code
  • stdout
  • stderr

See Cypress Documentation - exec.

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']

See Cypress Documentation - get.

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.

See Cypress Documentation - visit.

pub fn wrap(subject: a) -> Chainable(a)

Wrap an object into a Chainable.

Yields the subject it was given.

See Cypress Documentation - wrap.

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.

See Cypress Documentation - wrap.

Search Document