Skip to content

Instantly share code, notes, and snippets.

@denisshevchenko
Last active November 4, 2015 18:34
Show Gist options
  • Save denisshevchenko/f98cf9a0b3c86b72e1f8 to your computer and use it in GitHub Desktop.
Save denisshevchenko/f98cf9a0b3c86b72e1f8 to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Test.Hspec.WebDriver
import qualified Data.Text as T
checkCorrectnessOf :: Element -> WD ()
checkCorrectnessOf email = do
emailText <- getText email
email `shouldBeTag` "a"
email `shouldHaveAttr` ("href", "mailto:" `T.append` emailText)
main :: IO ()
main = hspec $
describe "zalora.sg tests" $
session "check contact page" $ using Firefox $
it "checks existence and correctness of emails" $ runWD $ do
openPage "http://www.zalora.sg/contact/"
allEmails <- findElems $ ByPartialLinkText "sg.zalora.com"
_ <- mapM checkCorrectnessOf allEmails
return ()
-- it "something else..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment