Skip to content

Commit

Permalink
116 tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
igrishaev committed Feb 26, 2018
1 parent 51cc935 commit be4d4de
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
13 changes: 13 additions & 0 deletions resources/html/test.html
Expand Up @@ -195,6 +195,19 @@ <h3>Find text with quote</h3>
</div>
</div>

<div id="wc3-barks">
<p>
<span class="crypt-lord">
From the depths I've come!
</span>
</p>
<p>
<span class="pit-lord">
I've come from the darkness of the pit!
</span>
</p>
</div>

<h3 id="document-end">Document end</h3>

</body>
Expand Down
13 changes: 12 additions & 1 deletion test/etaoin/api_test.clj
Expand Up @@ -540,6 +540,17 @@
(is (= (-> files rest count)
2))))))))

(deftest find-quotes-in-text
(deftest test-find-quotes-in-text
(doto *driver*
(-> (has-text? "'quote") is)))

(deftest test-has-text
(testing "gloval"
(is (has-text? *driver* "From the depths I've come!"))
(is (has-text? *driver* "I've come from the dark")))
(testing "relative"
(is (has-text? *driver* [:wc3-barks {:tag :p} {:tag :span}] "ths I've come!")))
(testing "short path"
(is (has-text? *driver* [:wc3-barks {:tag :span}] "ths I've")))
(testing "wrong path"
(is (not (has-text? *driver* [:wc3-barks {:tag :p} :pit-lord] "ths I've come!")))))

0 comments on commit be4d4de

Please sign in to comment.