Skip to content

Instantly share code, notes, and snippets.

@orikremer
Created November 30, 2015 17:02
Show Gist options
  • Save orikremer/0a3a2bcd4b9ef72f231a to your computer and use it in GitHub Desktop.
Save orikremer/0a3a2bcd4b9ef72f231a to your computer and use it in GitHub Desktop.
defmodule ConcurrentSessionsTest do
use ExUnit.Case
use Hound.Helpers
defmodule Tester do
def test do
Hound.start_session
url = "http://localhost:9090/page1.html"
navigate_to(url)
url == current_url
end
end
test "should be able to run multiple sessions concurrently" do
1..11
|> Enum.map(fn(_) -> Task.async(fn -> Tester.test end) end)
|> Enum.map(fn(task) -> Task.await(task, 60000) end)
|> Enum.each(fn(e) -> assert e end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment