Module

Selenium

Package
purescript-webdriver
Repository
slamdata/purescript-webdriver

#wait Source

wait :: Aff Boolean -> Milliseconds -> Driver -> Aff Unit

Wait until first argument returns 'true'. If it returns false an error will be raised

#quit Source

quit :: Driver -> Aff Unit

Finalizer

#affLocator Source

affLocator :: (Element -> Aff Element) -> Aff Locator

Build locator from asynchronous function returning element. I.e. this locator will find first visible element with .common-element class

affLocator \el → do
  commonElements ← byCss ".common-element" >>= findElements el
  flagedElements ← traverse (\el → Tuple el <$> isVisible el) commonElements
  maybe err pure $ foldl foldFn Nothing flagedElements
  where
  err = throwError $ error "all common elements are not visible"
  foldFn Nothing (Tuple el true) = Just el
  foldFn a _ = a

#findElement Source

findElement :: Driver -> Locator -> Aff (Maybe Element)

Tries to find an element starting from document; will return Nothing if there is no element can be found by locator

#loseElement Source

loseElement :: Driver -> Locator -> Aff Unit

Tries to find element and throws an error if it succeeds.

#findElements Source

findElements :: forall f. Unfoldable f => Driver -> Locator -> Aff (f Element)

Finds elements by locator from document

#findChild Source

findChild :: Element -> Locator -> Aff (Maybe Element)

Same as findElement but starts searching from custom element

#findChildren Source

findChildren :: forall f. Unfoldable f => Element -> Locator -> Aff (f Element)

Same a findElements but starts searching from custom element

#navigateBack Source

#navigateForward Source

#navigateTo Source

#executeStr Source

executeStr :: Driver -> String -> Aff Foreign

Executes javascript script from String argument.

#getAttribute Source

getAttribute :: Element -> String -> Aff (Maybe String)

Tries to find an element starting from document; will return Nothing if there is no element can be found by locator

#clearEl Source

clearEl :: Element -> Aff Unit

Clear value of element, if it has no value will do nothing. If value is weakly referenced by virtual-dom (purescript-halogen) will not work -- to clear such inputs one should use direct signal from Selenium.ActionSequence

#takeScreenshot Source

takeScreenshot :: Driver -> Aff String

Returns png base64 encoded png image

#saveScreenshot Source

saveScreenshot :: String -> Driver -> Aff Unit

Saves screenshot to path

#setWindowSize Source

#getWindowSize Source

#maximizeWindow Source

#setWindowPosition Source

#getAllWindowHandles Source