Created
January 29, 2016 11:22
-
-
Save RadekMolenda/4c27c65c422c6f00b2ca to your computer and use it in GitHub Desktop.
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
defmodule Swarmsimulatorelixir do | |
use Hound.Helpers | |
def start do | |
Hound.start_session | |
end | |
end | |
defmodule Commander do | |
use Hound.Helpers | |
def start_link(session) do | |
navigate_to("https://swarmsim.github.io/") | |
Task.start_link(fn -> loop(session) end) | |
end | |
defp loop(session) do | |
receive do | |
{:screenshot, path} -> | |
in_browser_session session, fn -> | |
take_screenshot(path) | |
end | |
loop(session) | |
{:stop} -> | |
Hound.end_session | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment