1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-23 21:02:13 +03:00

[tests] Deleting a category

This commit is contained in:
Artyom 2016-08-30 18:06:06 +03:00
parent a86a8d7680
commit 14d61485a0

View File

@ -222,9 +222,27 @@ categoryTests = session "categories" $ using Firefox $ do
click =<< select (form :// ".save") click =<< select (form :// ".save")
waitUntil 2 $ waitUntil 2 $
expect =<< allM isDisplayed =<< selectAll ".item-ecosystem" expect =<< allM isDisplayed =<< selectAll ".item-ecosystem"
-- Save works describe "deleting a category" $ do
-- Cancel works wd "dismissing the alert doesn't do anything" $ do
-- Deleting a category works click =<< select (".category h2" :// ByLinkText "delete")
dismissAlert
catURL <- getCurrentURL
openGuidePage "/"
e <- select (ByLinkText "Cat 2")
changesURL $ click e
do u <- getCurrentURL
u `shouldBe` catURL
wd "accepting the alert deletes the category" $ do
catURL <- getCurrentURL
changesURL $ do
click =<< select (".category h2" :// ByLinkText "delete")
acceptAlert
url <- getCurrentRelativeURL
uriPath url `shouldBe` "/haskell"
checkNotPresent (ByLinkText "Cat 2")
openPage catURL
body <- select "body"
body `shouldHaveText` "Something went wrong"
-- Feed button works -- Feed button works
-- Description editing works -- Description editing works