Skip to content

Instantly share code, notes, and snippets.

@RadekMolenda
Created January 29, 2016 11:22
Show Gist options
  • Save RadekMolenda/4c27c65c422c6f00b2ca to your computer and use it in GitHub Desktop.
Save RadekMolenda/4c27c65c422c6f00b2ca to your computer and use it in GitHub Desktop.
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