Created
February 17, 2016 17:14
-
-
Save retro/60ab804165cd3c891782 to your computer and use it in GitHub Desktop.
This file contains 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
(deftest trying-to-click-non-existing-element [] | |
(syn-run! | |
(<! (s/click! ".non-existing-element")) ;; Waits for the element to appear on the page up to 6 seconds | |
(is false "This should never run"))) ;; will never run, and test will cleanly exit | |
(deftest typing [] | |
(let [[container cleanup] (container!) | |
bootstrap #(el! "input" container)] | |
(.setTimeout js/window bootstrap 2000) ;; Add the element to page after two seconds | |
(syn-run! | |
(<! (s/type! "input" "testing")) ;; Wait until the element is on the page and type into it | |
(is (= (dommy/value (sel1 "input")) "testing"))))) ;; Check the value of the element and assert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment