Module
Selenium
- Package
- purescript-webdriver
- Repository
- slamdata/purescript-webdriver
#affLocator Source
affLocator :: forall e. (Element -> Aff (selenium :: SELENIUM | e) Element) -> Aff (selenium :: SELENIUM | e) 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
#showLocator Source
showLocator :: Locator -> String
#findElements Source
findElements :: forall f e. Unfoldable f => Driver -> Locator -> Aff (selenium :: SELENIUM | e) (f Element)
Finds elements by locator from document
#findChildren Source
findChildren :: forall f e. Unfoldable f => Element -> Locator -> Aff (selenium :: SELENIUM | e) (f Element)
Same as findElements
but starts searching from custom element
#setFileDetector Source
setFileDetector :: forall e. Driver -> FileDetector -> Aff (selenium :: SELENIUM | e) Unit
#takeScreenshot Source
takeScreenshot :: forall e. Driver -> Aff (selenium :: SELENIUM | e) String
Returns png base64 encoded png image
#getWindowPosition Source
getWindowPosition :: forall e. Window -> Aff (selenium :: SELENIUM | e) Location
#getWindowScroll Source
getWindowScroll :: forall e. Driver -> Aff (selenium :: SELENIUM | e) Location
#getWindowHandle Source
getWindowHandle :: forall e. Driver -> Aff (selenium :: SELENIUM | e) WindowHandle
#getAllWindowHandles Source
getAllWindowHandles :: forall e f. Unfoldable f => Driver -> Aff (selenium :: SELENIUM | e) (f WindowHandle)