Last active
November 4, 2015 18:34
-
-
Save denisshevchenko/f98cf9a0b3c86b72e1f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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