Module

Elmish.Test.Discover

Package
purescript-elmish-testing-library
Repository
collegevine/purescript-elmish-testing-library

#childAt Source

childAt :: forall m. Testable m => Int -> m Element

Within the current-context element, finds a child element at the given index. Crashes if the is no child with the given index.

#children Source

children :: forall m. Testable m => m (Array Element)

Returns all immediate child elements of the current-context element.

find "div" >> children >>= traverse_ \child ->
  tag <- tagName
  when (tag == "BUTTON")
    click

#find Source

find :: forall m. Testable m => String -> m Element

Finds exactly one element by CSS selector. If the selector matches zero elements or more than one, this function will throw an exception.

find "button" >> click

#findAll Source

findAll :: forall m. Testable m => String -> m (Array Element)

Finds zero or more elements by CSS selector.

findAll "button" >>= traverse_ \b -> click $$ b

divs <- find "div" length divs shouldEqual 10

#findFirst Source

findFirst :: forall m. Testable m => String -> m Element

Finds the first element out of possibly many matching the given selector. If there are no elements matching the selector, throws an exception.

#findNth Source

findNth :: forall m. Testable m => Int -> String -> m Element

Finds the n-th (zero-based) element out of possibly many matching the given selector. If there are no elements matching the selector, throws an exception.