)      !"#$%&'(None+24=K A typeclass of things which can be converted to a list of capabilities. It has two uses. First, it allows you to create a datatype of grouped capabilities in addition to your actual capabilities. These psudo-caps can be passed to usingW to convert them to a list of your actual capabilities. Secondly, it allows the word using to be used with  8 so that the session description reads like a sentance. session "for the home page" $ using Firefox $ do it "loads the page" $ runWD $ do ... it "scrolls the carosel" $ runWD $ do ... session "for the users page" $ using [Firefox, Chrome] $ do ... A webdriver example.The webdriver action of type   ()7 should interact with the webpage using commands from Test.WebDriver.Commands (which is re-exported from this module) and then use the <#g:2 expectations> in this module. It is possible to split up the spec of a single page into multiple examples where later examples start with the web browser state from the end of the previous example. This is helpful to keep each individual example small and allows the entire spec to be described at the beginning with pending examples.EThe way this works is that you combine examples into a session using   or !. A webdriver session is then threaded through all examples in a session so that a later example in the session can rely on the webbrowser state as set up by the previous example. The type system enforces that every webdriver example must be located within a call to   or ! . Indeed, a   produces a  ( multi)! which can only be converted to  using   or !. The reason for the F constructor is so that a pending example can be specified with type  ( multi)5 so it can compose with the other webdriver examples. The type multil is used when testing multiple sessions at once (e.g. to test multiple interacting users), otherwise it is (). Values of this type are used to determine which browser session the example should be executed against. A new session is created every time a new value of type multig is seen. Note that the type system enforces that every example within the session has the same type multi.+Internal state for webdriver test sessions.)3The state passed between examples inside the mvars.*The already created sessions+)True if the previous example had an error,.True if the previous example was aborted with "-Create a new sessionProvides information about the browser capabilities used for testing. If you want more control over capabilities, you should hide h and then make an enumeration of all the webdriver capabilities you will be testing with. For example, data TestCaps = Firefox | FirefoxWithoutJavascript | Chrome | IE8 | IE9 deriving (Show, Eq, Bounded, Enum)TestCaps" must then be made an instance of TestCapabilities. Also, instances of Using should be created.The capabilities to pass to ..3Webdriver expectations consist of a set of browser /" to use and the actual test as a  [ monad. The browser capabilities are specified by an enumeration which is an instance of . The BrowserDefaultsb enumeration provides items that represent the default set of capabilities for each browser (see 0).To obtain more control over the capabilities (e.g. to test multiple versions of IE or to test Firefrox without javascript), you should 4import Test.Hspec.WebDriver hiding (BrowserDefaults)? and then create your own enumeration which is an instance of  and  .A shorthand for constructing a   from a webdriver action when you are only testing a single browser session at once. See the XKCD example at the top of the page.Create a webdriver example, specifying which of the multiple sessions the example should be executed against. I suggest you create an enumeration for multi, for example: data TestUser = Gandolf | Bilbo | Legolas deriving (Show, Eq, Enum, Bounded) runUser :: TestUser -> WD () -> WDExample TestUser runUser = runWDWith spec :: Spec spec = session "tests some page" $ using Firefox $ do it "does something with Gandolf" $ runUser Gandolf $ do openPage ... it "does something with Bilbo" $ runUser Bilbo $ do openPage ... it "goes back to the Gandolf session" $ runUser Gandolf $ do e <- findElem .... ...In the above code, two sessions are created and the examples will go back and forth between the two sessions. Note that a session for Legolas will only be created the first time he shows up in a call to runUser, which might be never. To share information between the sessions (e.g. some data that Gandolf creates that Bilbo should expect), the best way I have found is to use IORefs created with G, and then use implicit parameters to pass the IORefs between examples.A pending example.!A pending example with a message. A version of 1 which lifts an IO () to a webdriver example (so it can be composed with other webdriver examples). In the case of multiple sessions, it doesn't really matter which session the expectation is executed against, so a default value is used. In the case of single sessions, the type is  WdExample (). }Combine the examples nested inside this call into a webdriver session or multiple sessions. For each of the capabilities in the list, the examples are executed one at a time in depth-first order and so later examples can rely on the browser state created by earlier examples. These passes through the examples are independent for different capabilities. Note that when using , the examples within a single pass still execute serially. Different passes through the examples will be executed in parallel. The sessions are managed as follows:In the simplest case when multi is (), before the first example is executed a new webdriver session with the given capabilities is created. The examples are then executed in depth-first order, and the session is then closed when either an exception occurs or the examples complete. (The session can be left open with ").LMore generally, as the examples are executed, each time a new value of type multi is seen, a new webdriver session with the capabilities is automatically created. Later examples will continue with the session matching their value of multi.WThis function uses the default webdriver host (127.0.0.1), port (4444), and basepath (/wd/hub).!A variation of  ^ which allows you to specify the webdriver configuration. Note that the capabilities in the 2G will be ignored, instead the capabilities will come from the list of .".Abort the session without closing the session. Normally,  L will automatically close the session either when the tests complete without error or when any of the tests within the session throws an error. When developing the test suite, this can be annoying since closing the session causes the browser window to close. Therefore, while developing the test suite, you can insert a call to ". This will immedietly halt the session (all later tests will fail) but will not close the session so that the browser window stays open.#3 lifted into the   monad.$5Asserts that the given element matches the given tag.%2Asserts that the given element has the given text.&9Asserts that the given elemnt has the attribute given by (attr name, value).'4Asserts that the action returns the expected result.(,Asserts that the action throws an exception.4Create a WdTestSession.5TConvert a single test item to a generic item by providing it with the WdTestSession.6tConvert a spec tree of test items to a spec tree of generic items by creating a single session for the entire tree.7+Traverse a spec allowing the type to change8KProcess the items in a depth-first walk, passing in the item counter value.69: ;<=)>*+,- !"#$%&'(4567?8@ABCDE FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~.  !"#$%&'()  !" #$%&'( !9:  ;<=)>*+,- !"#$%&'(4567?8@ABCDE      !"#$%&'()*+,-./0123456789:9;(<=>?,@ABCDEEFG2HIJKLMN7O7P7Q7R7S7T7U7V7W7X7Y7Z7[7\7]7^7_7`7a7b7c7d7e7f7g7h7i7j7k7l7m7n7o7p7q7r7s7t7u7v7w7x7y7z7{7|7}7~777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777779999999999hspec-webdriver-1.0.3Test.Hspec.WebDriver hspec-2.2.0 Test.Hspecspecifycontexthspec-core-2.2.0Test.Hspec.Core.Spec.MonadSpecWithSpecrunIOTest.Hspec.Core.SpecdescribeitparallelTest.Hspec.Core.Runnerhspecwebdriver-0.6.2.1Test.WebDriver.MonadWDUsing UsingListusing WdExample WdPending WdTestSessionTestCapabilitiesnewCapsBrowserDefaultsAndroidIPadIPhoneOperaIEChromeFirefoxrunWD runWDWithpending pendingWithexamplesession sessionWithinspectSessionshouldBe shouldBeTagshouldHaveTextshouldHaveAttr shouldReturn shouldThrow SessionState stSessionMapstPrevHadError stPrevAbortedstCreateSessionTest.WebDriver.Commands createSessionTest.WebDriver.Capabilities Capabilities defaultCapsTest.WebDriver.ConfigWDConfighspec-expectations-0.7.2Test.Hspec.ExpectationscreateTestSession procSpecItemprocTestSession traverseTreemapWithCounter AbortSession wdTestOpen wdTestClose traverseSpec countItems$fExampleWdExample$fExceptionAbortSession $fUsing[]$fUsingBrowserDefaults!$fTestCapabilitiesBrowserDefaultsgetApplicationCacheStatus getLogTypesgetLogs serverStatus deleteKeysetKeygetKey deleteAllKeys getAllKeys storageSizeuploadZipEntry uploadRawFile uploadFile setLocation getLocationtouchFlickFrom touchFlicktouchLongClicktouchDoubleClicktouchScrollFrom touchScroll touchMovetouchUp touchDown touchClick doubleClickmouseUp mouseDown withMouseDown clickWith moveToFrom moveToCentermoveTo dismissAlert acceptAlert replyToAlert getAlertTextsetOrientationgetOrientation<==>elemSizeelemPoscssPropattr isDisplayed isEnabled isSelected clearInputtagName sendRawKeyssendKeysgetTextsubmitclickelemInfo findElemsFrom findElemFrom activeElem findElemsfindElemgetTitle getSourcedeleteVisibleCookiesdeleteCookieByName deleteCookie setCookiecookiesmkCookie setWindowPos getWindowPos setWindowSize getWindowSizemaximize closeWindow focusWindowwindowsgetCurrentWindow focusFrame deactivateIME activateIMEcheckIMEActiveactiveIMEEngineavailableIMEEnginesscreenshotBase64 screenshotasyncJS executeJSrefreshbackforwardopenPage getCurrentURLsetPageLoadTimeoutsetScriptTimeoutsetImplicitWait closeSessiongetCapssessionsJSArg WithIndexWithName WithElement DefaultFrame FrameSelector cookExpiry cookSecure cookDomaincookPath cookValuecookNameCookieByIdByNameByClassByTag ByLinkTextByPartialLinkTextByCSSByXPathSelector LandscapePortrait Orientation LeftButton MiddleButton RightButton MouseButton LocalStorageSessionStorageWebStorageTypelogMsglogLevellogTimeLogEntryLogTypeUncachedIdleChecking Downloading UpdateReadyObsoleteApplicationCacheStatus Test.WebDriver.Commands.Internal currentWindowElement WindowHandleLogOff LogSevere LogWarningLogInfo LogConfigLogFineLogFiner LogFinestLogAllLogLevel