Last active
October 23, 2017 18:37
-
-
Save pragtobgists/b9b1ec129d19a734d50f619933400cf5 to your computer and use it in GitHub Desktop.
Benchee Hound
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ATTENTION: gotta start phantomjs via `phantomjs --wd` first.. | |
Application.ensure_all_started(:hound) | |
{:ok, server} = SimpleServer.start | |
Application.put_env(:hound, :app_host, "http://localhost") | |
Application.put_env(:hound, :app_port, SimpleServer.port(server)) | |
use Hound.Helpers | |
Benchee.run(%{ | |
"fill_in text_field" => fn -> | |
fill_field({:name, "user[name]"}, "Chris") | |
end, | |
"visit forms" => fn -> | |
navigate_to("#{server.base_url}/forms.html") | |
end, | |
"find by css #id" => fn -> | |
find_element(:id, "button-no-type-id") | |
end | |
}, | |
time: 18, | |
formatters: [ | |
Benchee.Formatters.HTML, | |
Benchee.Formatters.Console | |
], | |
html: [file: "benchmarks/html/hound.html"], | |
before_scenario: fn(input) -> | |
Hound.start_session() | |
navigate_to("#{server.base_url}/forms.html") | |
input | |
end, | |
after_scenario: fn(_return) -> | |
Hound.end_session | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment