From dec2688d3f108bfecad72b552f1dbfd1fdfd0f7d Mon Sep 17 00:00:00 2001 From: Artyom Date: Tue, 30 Aug 2016 16:48:43 +0300 Subject: [PATCH] [tests] Test pros/cons hiding with 2 items --- tests/WebSpec.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/WebSpec.hs b/tests/WebSpec.hs index c04f7fa..4f7569a 100644 --- a/tests/WebSpec.hs +++ b/tests/WebSpec.hs @@ -187,17 +187,20 @@ categoryTests = session "categories" $ using Firefox $ do click =<< select (form :// ".cancel") wd "section is shown in an item" $ do createItem "some item" - shouldBeDisplayed =<< select ".item-traits" + createItem "another item" + mapM_ shouldBeDisplayed =<< selectAll ".item-traits" wd "section isn't shown after unchecking the checkbox" $ do form <- openCategoryEditForm click =<< select (form :// HasText "Pros/cons enabled" :// "input") click =<< select (form :// ".save") - waitUntil 2 (expect . not =<< isDisplayed =<< select ".item-traits") + waitUntil 2 $ + expect . not =<< anyM isDisplayed =<< selectAll ".item-traits" wd "section is shown again after checking the checkbox" $ do form <- openCategoryEditForm click =<< select (form :// HasText "Pros/cons enabled" :// "input") click =<< select (form :// ".save") - waitUntil 2 (expect =<< isDisplayed =<< select ".item-traits") + waitUntil 2 $ + expect =<< allM isDisplayed =<< selectAll ".item-traits" -- Ecosystem enabled -- Save works -- Cancel works