From eedf38895d593a48843fd0890dcbdd644c1e2238 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Mon, 30 May 2016 10:22:29 +0300 Subject: [PATCH] doc for appium-test Former-commit-id: c8d0f590c21797dfed5f7deb74e022c65b3d2a2c --- test/clj/status_im/appium.clj | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/clj/status_im/appium.clj b/test/clj/status_im/appium.clj index 061ed3f4b4..d3a77bc435 100644 --- a/test/clj/status_im/appium.clj +++ b/test/clj/status_im/appium.clj @@ -59,7 +59,25 @@ (defn quit [driver] (.quit driver)) -(defmacro appium-test [name & body] +(defmacro appium-test + "Defines test which will create new appium session and will pass that + session as first argument to each command inside it's body. After execution + of all commands session will be closed. + + For instance, + + (appium-test my-test + (click :button) + (write :input \"oops\")) + + will be expanded to + + (deftest my-test + (let [session (init)] + (click session :button) + (write session :input \"oops\") + (quit session)))" + [name & body] (let [sym (gensym)] `(deftest ~name (let [~sym (init)]