mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
appium-test macro
Former-commit-id: 54ae25dc67ec9ca2d75e87f8b62637c4c8592c43
This commit is contained in:
parent
6823acd171
commit
23b646c213
@ -50,7 +50,7 @@
|
|||||||
(.getText (by-xpath driver xpath)))
|
(.getText (by-xpath driver xpath)))
|
||||||
|
|
||||||
(defn xpath-by-text [text]
|
(defn xpath-by-text [text]
|
||||||
(str ".//*[@text='" text "']" ))
|
(str ".//*[@text='" text "']"))
|
||||||
|
|
||||||
(defn contains-text [driver text]
|
(defn contains-text [driver text]
|
||||||
(is (= 1 (->> (xpath-by-text text)
|
(is (= 1 (->> (xpath-by-text text)
|
||||||
@ -59,3 +59,11 @@
|
|||||||
|
|
||||||
(defn quit [driver]
|
(defn quit [driver]
|
||||||
(.quit driver))
|
(.quit driver))
|
||||||
|
|
||||||
|
(defmacro appium-test [name & body]
|
||||||
|
(let [sym (gensym)]
|
||||||
|
`(deftest ~name
|
||||||
|
(let [~sym (init)]
|
||||||
|
~@(for [[f & rest] body]
|
||||||
|
`(~f ~sym ~@rest))
|
||||||
|
(quit ~sym)))))
|
||||||
|
@ -7,11 +7,9 @@
|
|||||||
" the exclamation mark or hit the icon to open the command "
|
" the exclamation mark or hit the icon to open the command "
|
||||||
"list and choose the !phone command"))
|
"list and choose the !phone command"))
|
||||||
|
|
||||||
(deftest console-test
|
(appium-test console-test
|
||||||
(let [driver (init)]
|
(click :request-keypair-password)
|
||||||
(click driver :request-keypair-password)
|
(write :command-input "123")
|
||||||
(write driver :command-input "123")
|
(click :stage-command)
|
||||||
(click driver :stage-command)
|
(click :send-message)
|
||||||
(click driver :send-message)
|
(contains-text message-text))
|
||||||
(contains-text driver message-text)
|
|
||||||
(quit driver)))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user