-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add macro with-screenshots #343
Conversation
src/etaoin/api.clj
Outdated
@@ -2972,6 +2972,18 @@ | |||
(b64-to-file b64str file) | |||
(util/error "Empty screenshot, query: %s" q)))) | |||
|
|||
(defmacro with-screenshots | |||
"Make screenshot after each form" | |||
[driver folder & body] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошо, несколько моментов
- переименовать folder в directory, потому что первое скорее принято в винде.
- синтаксис
make-screenshot-file
запутан, лучше записать ее через обычную(fn [])
.
src/etaoin/api.clj
Outdated
(defmacro with-screenshots | ||
"Makes a screenshot after each form" | ||
[driver dir & body] | ||
(let [make-screenshot-file# (fn [dir] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше назвать функцию make-file-path
, потому что она не создает файл на диске, а только строит путь. Второй момент -- можно убрать входящий параметр, потому что все равно функция замкнута на dir
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И еще -- можно добавить в имя файла тип драйвера, например chrome-11112222333.png
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И добавить в readme пример в секцию о скриншотах.
#fixies #44