-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Webdriver actions to assist with testing a webpage which uses Angular.Js -- -- For end to end testing of web applications from Haskell, the -- webdriver package is a great tool but does not provide specific -- commands to make testing a webpage using AngularJS easier. The -- protractor project provides Angular-specific webdriver commands -- but the test code must be written in javascript. This package fills -- the gap by reusing some of the protractor code to allow end to end -- tests of Angular applications to be written in Haskell. @package webdriver-angular @version 0.1.7 -- | This module exposes webdriver actions that can be used to -- interact with a page which uses AngularJs. This provides -- similar functionality as protractor and in fact we share some -- code with protractor. module Test.WebDriver.Commands.Angular -- | Wait until Angular has finished rendering before continuing. -- False indicates the timeout was hit (see -- setScriptTimeout) and we stopped waiting and True -- means that angular has finished rendering. waitForAngular :: (MonadIO wd, WebDriver wd) => Text -> wd Bool -- | Exceptions of this type will be thrown when an element is unable to be -- located. data NgException NgException :: String -> NgException data NgSelector -- | Argument is the binding, e.g. {{dog.name}} ByBinding :: Text -> NgSelector -- | Argument is the model name. Searches for elements with the -- ng-model="name" attribute. ByModel :: Text -> NgSelector -- | Argument is a model name. Searches for selected options within a -- select element matching the modelname. That is, the -- <option:checked> elements within a <select -- ng-model="name" ... >. BySelectedOption :: Text -> NgSelector -- | Find a single element from the document matching the given Angular -- selector. If zero or more than one element is returned, an exception -- of type NgException is thrown. findNg :: (MonadIO wd, WebDriver wd) => NgSelector -> wd Element -- | Find elements from the document matching the given Angular selector. findNgs :: WebDriver wd => NgSelector -> wd [Element] -- | Find a single element from within the given element which matches the -- given Angular selector. If zero or more than one element is returned, -- an exception of type NgException is thrown. findNgFrom :: (MonadIO wd, WebDriver wd) => Element -> NgSelector -> wd Element -- | Find elements from within the given element which match the given -- Angular selector. findNgsFrom :: WebDriver wd => Element -> NgSelector -> wd [Element] data NgRepeater -- | All the rows matching the repeater (e.g. 'dog in dogs') ByRows :: Text -> NgRepeater -- | A single row specified by the text of the repeater (e.g. 'dog in -- dogs') and the row index ByRow :: Text -> Int -> NgRepeater -- | A single column matching the text of the repeater (e.g. 'dog in dogs') -- and the column binding (e.g '{{dog.name}}'). ByColumn :: Text -> Text -> NgRepeater -- | A single row and column, given (repeater, row index, column binding). ByRowAndCol :: Text -> Int -> Text -> NgRepeater -- | Finds elements from the document which match the NgRepeater. -- -- Note that when using ng-repeat-start and ng-repeat-end and looking up -- using ByRows, all elements are returned in one big list, not -- grouped by each instance of ng-repeat-start. findRepeaters :: WebDriver wd => NgRepeater -> wd [Element] -- | A variant on findRepeaters which throws an exception if the -- return value from findRepeaters does not have length exactly -- one. findRepeater :: (MonadIO wd, WebDriver wd) => NgRepeater -> wd Element -- | A variant of findRepater which allows searching only the -- given element. findRepeaterFrom :: (MonadIO wd, WebDriver wd) => Element -> NgRepeater -> wd Element -- | A variant of findRepaters which allows searching only the -- given element. findRepeatersFrom :: WebDriver wd => Element -> NgRepeater -> wd [Element] -- | Evaluate an angular expression, using the scope attached to the given -- element. ngEvaluate :: (WebDriver wd, FromJSON a) => Element -> Text -> wd a -- | Return the current absolute url according to Angular (using -- $location.absUrl()). getLocationAbsUrl :: WebDriver wd => Text -> wd Text -- | Browse to another page using in-page navigation (via -- $location.url). setNgLocation :: (MonadIO wd, WebDriver wd) => Text -> Text -> wd () instance Typeable NgException instance Show NgException instance Eq NgException instance Show NgSelector instance Eq NgSelector instance Show NgRepeater instance Eq NgRepeater instance Exception NgException