-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Test web applications through a browser. -- -- Haskell bindings to communicate with a Selenium Remote Control server. -- This package makes it possible to use Haskell to write test scripts -- that exercise web applications through a web browser. @package selenium @version 0.2.3 module Test.Selenium.Pretty -- | Join two strings with : (<:>) :: String -> String -> String -- | Join two strings with ? () :: String -> String -> String -- | Join two strings with = (<=>) :: String -> String -> String -- | Join two strings with & (<&>) :: String -> String -> String -- | Haskell data structures describing the commands understood by the -- Selenium web application testing system. module Test.Selenium.Syntax -- | An SCommand: an action or accessor data SCommand SClick :: SCommand SDoubleClick :: SCommand SClickAt :: SCommand SDoubleClickAt :: SCommand SFireEvent :: SCommand SKeyPress :: SCommand SShiftKeyDown :: SCommand SShiftKeyUp :: SCommand SMetaKeyDown :: SCommand SMetaKeyUp :: SCommand SAltKeyDown :: SCommand SAltKeyUp :: SCommand SControlKeyDown :: SCommand SControlKeyUp :: SCommand SKeyDown :: SCommand SKeyUp :: SCommand SMouseOver :: SCommand SMouseOut :: SCommand SMouseDown :: SCommand SMouseDownAt :: SCommand SMouseUp :: SCommand SMouseUpAt :: SCommand SMouseMove :: SCommand SMouseMoveAt :: SCommand SType :: SCommand STypeKeys :: SCommand SSetSpeed :: SCommand SGetSpeed :: SCommand SCheck :: SCommand SUncheck :: SCommand SSelect :: SCommand SAddSelection :: SCommand SRemoveSelection :: SCommand SRemoveAllSelections :: SCommand SSubmit :: SCommand SOpen :: SCommand SOpenWindow :: SCommand SSelectWindow :: SCommand SSelectFrame :: SCommand SFrameMatchesExpression :: SCommand SWindowMatchesExpression :: SCommand SWaitForPopup :: SCommand SCancelNextPrompt :: SCommand SAnswerNextPrompt :: SCommand SGoBack :: SCommand SRefresh :: SCommand SClose :: SCommand SIsAlertPresent :: SCommand SIsPromptPresent :: SCommand SIsConfirmationPresent :: SCommand SGetAlert :: SCommand SGetConfirmation :: SCommand SGetPrompt :: SCommand SGetLocation :: SCommand SGetTitle :: SCommand SGetBodyText :: SCommand SGetValue :: SCommand SGetText :: SCommand SHighlight :: SCommand SEval :: SCommand SIsChecked :: SCommand SGetTable :: SCommand SGetSelectedLabels :: SCommand SGetSelectedLabel :: SCommand SGetSelectedValues :: SCommand SGetSelectedValue :: SCommand SGetSelectedIndexes :: SCommand SGetSelectedIndex :: SCommand SGetSelectedIds :: SCommand SGetSelectedId :: SCommand SIsSomethingSelected :: SCommand SGetSelectOptions :: SCommand SGetAttribute :: SCommand SIsTextPresent :: SCommand SIsElementPresent :: SCommand SIsVisible :: SCommand SIsEditable :: SCommand SGetAllButtons :: SCommand SGetAllLinks :: SCommand SGetAllFields :: SCommand SGetAttrFromAllWindows :: SCommand SSetMouseSpeed :: SCommand SGetMouseSpeed :: SCommand SDragAndDrop :: SCommand SDragAndDropToObject :: SCommand SWindowFocus :: SCommand SWindowMaximize :: SCommand SGetAllWindowIds :: SCommand SGetAllWindowNames :: SCommand SGetAllWindowTitles :: SCommand SGetHTMLSource :: SCommand SSetCursorPosition :: SCommand SGetElementIndex :: SCommand SIsOrdered :: SCommand SGetElementPositionLeft :: SCommand SGetElementPositionTop :: SCommand SGetElementWidth :: SCommand SGetElementHeight :: SCommand SGetCursorPosition :: SCommand SSetContext :: SCommand SGetExpression :: SCommand SWaitForCondition :: SCommand SGetXPathCount :: SCommand SAddLocationStrategy :: SCommand SSetTimeout :: SCommand SWaitForPage :: SCommand SGetCookie :: SCommand SCreateCookie :: SCommand SDeleteCookie :: SCommand STestComplete :: SCommand SNewSession :: SCommand data Locator IdOrName :: String -> Locator Id :: String -> Locator Name :: String -> Locator DOM :: String -> Locator XPath :: String -> Locator Link :: String -> Locator CSS :: String -> Locator data SelectOptionLocator OptionLabel :: String -> SelectOptionLocator OptionValue :: String -> SelectOptionLocator OptionId :: String -> SelectOptionLocator OptionIndex :: Int -> SelectOptionLocator instance Show SelectOptionLocator instance Show Locator instance Show Coordinate instance Show SCommand -- | A Haskell binding the HTTP protocol spoken by the Selenium Remote -- Control server. The Selenium server allows remote clients to control a -- web browser, acting as automated users. module Test.Selenium.Server -- | Browser types data Browser InternetExplorer :: Browser Firefox :: Browser Konqueror :: Browser Opera :: Browser Safari :: Browser -- | An SCommand: an action or accessor data SCommand SClick :: SCommand SDoubleClick :: SCommand SClickAt :: SCommand SDoubleClickAt :: SCommand SFireEvent :: SCommand SKeyPress :: SCommand SShiftKeyDown :: SCommand SShiftKeyUp :: SCommand SMetaKeyDown :: SCommand SMetaKeyUp :: SCommand SAltKeyDown :: SCommand SAltKeyUp :: SCommand SControlKeyDown :: SCommand SControlKeyUp :: SCommand SKeyDown :: SCommand SKeyUp :: SCommand SMouseOver :: SCommand SMouseOut :: SCommand SMouseDown :: SCommand SMouseDownAt :: SCommand SMouseUp :: SCommand SMouseUpAt :: SCommand SMouseMove :: SCommand SMouseMoveAt :: SCommand SType :: SCommand STypeKeys :: SCommand SSetSpeed :: SCommand SGetSpeed :: SCommand SCheck :: SCommand SUncheck :: SCommand SSelect :: SCommand SAddSelection :: SCommand SRemoveSelection :: SCommand SRemoveAllSelections :: SCommand SSubmit :: SCommand SOpen :: SCommand SOpenWindow :: SCommand SSelectWindow :: SCommand SSelectFrame :: SCommand SFrameMatchesExpression :: SCommand SWindowMatchesExpression :: SCommand SWaitForPopup :: SCommand SCancelNextPrompt :: SCommand SAnswerNextPrompt :: SCommand SGoBack :: SCommand SRefresh :: SCommand SClose :: SCommand SIsAlertPresent :: SCommand SIsPromptPresent :: SCommand SIsConfirmationPresent :: SCommand SGetAlert :: SCommand SGetConfirmation :: SCommand SGetPrompt :: SCommand SGetLocation :: SCommand SGetTitle :: SCommand SGetBodyText :: SCommand SGetValue :: SCommand SGetText :: SCommand SHighlight :: SCommand SEval :: SCommand SIsChecked :: SCommand SGetTable :: SCommand SGetSelectedLabels :: SCommand SGetSelectedLabel :: SCommand SGetSelectedValues :: SCommand SGetSelectedValue :: SCommand SGetSelectedIndexes :: SCommand SGetSelectedIndex :: SCommand SGetSelectedIds :: SCommand SGetSelectedId :: SCommand SIsSomethingSelected :: SCommand SGetSelectOptions :: SCommand SGetAttribute :: SCommand SIsTextPresent :: SCommand SIsElementPresent :: SCommand SIsVisible :: SCommand SIsEditable :: SCommand SGetAllButtons :: SCommand SGetAllLinks :: SCommand SGetAllFields :: SCommand SGetAttrFromAllWindows :: SCommand SSetMouseSpeed :: SCommand SGetMouseSpeed :: SCommand SDragAndDrop :: SCommand SDragAndDropToObject :: SCommand SWindowFocus :: SCommand SWindowMaximize :: SCommand SGetAllWindowIds :: SCommand SGetAllWindowNames :: SCommand SGetAllWindowTitles :: SCommand SGetHTMLSource :: SCommand SSetCursorPosition :: SCommand SGetElementIndex :: SCommand SIsOrdered :: SCommand SGetElementPositionLeft :: SCommand SGetElementPositionTop :: SCommand SGetElementWidth :: SCommand SGetElementHeight :: SCommand SGetCursorPosition :: SCommand SSetContext :: SCommand SGetExpression :: SCommand SWaitForCondition :: SCommand SGetXPathCount :: SCommand SAddLocationStrategy :: SCommand SSetTimeout :: SCommand SWaitForPage :: SCommand SGetCookie :: SCommand SCreateCookie :: SCommand SDeleteCookie :: SCommand STestComplete :: SCommand SNewSession :: SCommand data SeleniumRCSession SeleniumRCSession :: HostName -> Int -> Browser -> URI -> Maybe String -> Bool -> SeleniumRCSession -- | The HostName of the Selenium server to connect to selHost :: SeleniumRCSession -> HostName -- | The port of the Selenium server to connect to selPort :: SeleniumRCSession -> Int -- | The type of browser to start and use to run the tests selBrowser :: SeleniumRCSession -> Browser -- | The base URL of the site to be tested selURL :: SeleniumRCSession -> URI -- | A session ID filled in by startSelenium selSessionID :: SeleniumRCSession -> Maybe String -- | Use Network.Browser instead of Network.HTTP if true selUseBrowse :: SeleniumRCSession -> Bool -- | The Selenium Monad, an error-handling read-only state data Selenium a -- | Create an unconnected Selenium session. mkSeleniumRCSession :: HostName -> Browser -> URI -> SeleniumRCSession -- | Connect to the server, and tell it to start a web browser. startSelenium :: Selenium SeleniumRCSession -- | Tell the server that a session is finished. stopSelenium :: Selenium () -- | Start a session, execute some code with the resulting handle, and then -- stop the session. withSelenium :: SeleniumRCSession -> Selenium a -> IO (Either String a) -- | Run a Selenium action inside IO. This is the top-level function you'll -- usually use to run a Selenium command when not using -- withSelenium. runSelenium :: SeleniumRCSession -> Selenium a -> IO (Either String a) -- | Run a Selenium action within the ErrorT monad. Useful for chaining -- together several actions without writing intermediate error handling. runSeleniumReader :: SeleniumRCSession -> Selenium a -> ErrorT String IO a -- | Send a Selenium command to the server with a list of arguments. doCommand :: SCommand -> [String] -> Selenium String -- | Execute a list of Selenium commands paired with arguments, and return -- | a list of results. doCommandList :: [(SCommand, [String])] -> Selenium [String] mkURI :: SeleniumRCSession -> SCommand -> [String] -> Maybe URI open :: String -> Selenium String click :: Locator -> Selenium String clickAndWait :: Locator -> Selenium String check :: Locator -> Selenium String uncheck :: Locator -> Selenium String typeText :: Locator -> String -> Selenium String isTextPresent :: String -> Selenium Bool isElementPresent :: Locator -> Selenium Bool isChecked :: Locator -> Selenium Bool waitForPage :: Integer -> Selenium String waitForCondition :: String -> Integer -> Selenium String keyPress :: Locator -> String -> Selenium String submit :: Locator -> Selenium String selectFrame :: String -> Selenium String mouseDown :: Locator -> Selenium String mouseMove :: Locator -> Selenium String mouseUp :: Locator -> Selenium String dragAndDrop :: Locator -> String -> Selenium String dragAndDropToObject :: Locator -> Locator -> Selenium String getAttribute :: Locator -> Selenium String getBodyText :: Selenium String getAllLinks :: Selenium [String] evalJS :: String -> Selenium String getSelectedIndex :: Locator -> Selenium Integer instance Functor Selenium instance Monad Selenium instance MonadIO Selenium instance MonadReader SeleniumRCSession Selenium instance MonadError String Selenium instance Show SeleniumRCSession instance Show Browser -- | Integration of Selenium and HUnit. Since all HUnit tests must have -- type IO (), this handles threading the Selenium session information -- between tests. module Test.Selenium.HUnit runSeleniumTestsTT :: [(String, Selenium ())] -> Selenium Counts runSeleniumTestsBare :: [(String, Selenium ())] -> Selenium () -- | Utility functions to ease interactive use inside GHCi. module Test.Selenium.Interactive -- | Starts up a session and returns a wrapper function that will run -- commands. Gives common defaults for browser and host. start :: String -> IO (Selenium a -> IO (Either String a)) -- | Stops a session (in the wrapper returned by start) stop :: Selenium () ($$) :: Show t => (Selenium () -> r) -> Selenium t -> r