appium-test macro

Former-commit-id: 54ae25dc67
This commit is contained in:
Roman Volosovskyi 2016-05-26 17:00:42 +03:00
parent 6823acd171
commit 23b646c213
2 changed files with 15 additions and 9 deletions

View File

@ -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)))))

View File

@ -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)))