Skip to content
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

Merged
merged 5 commits into from
Oct 8, 2020
Merged

add macro with-screenshots #343

merged 5 commits into from
Oct 8, 2020

Conversation

Uunnamed
Copy link
Contributor

@Uunnamed Uunnamed commented Oct 8, 2020

#fixies #44

@@ -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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошо, несколько моментов

  1. переименовать folder в directory, потому что первое скорее принято в винде.
  2. синтаксис make-screenshot-file запутан, лучше записать ее через обычную (fn []).

(defmacro with-screenshots
"Makes a screenshot after each form"
[driver dir & body]
(let [make-screenshot-file# (fn [dir]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше назвать функцию make-file-path, потому что она не создает файл на диске, а только строит путь. Второй момент -- можно убрать входящий параметр, потому что все равно функция замкнута на dir.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И еще -- можно добавить в имя файла тип драйвера, например chrome-11112222333.png

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И добавить в readme пример в секцию о скриншотах.

@Uunnamed Uunnamed merged commit 6374811 into master Oct 8, 2020
@Uunnamed Uunnamed deleted the add-macro-with-screenshot branch October 8, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants