elixir-wallaby/wallaby

refute_has always times out after >60000ms

manoadamro opened this issue · 0 comments

This has been brought over from a post on the slack channel here.

Issue

using refute_has causes test to fail due to a timeout.
timeout is set to 60000ms

Details

Erlang/OTP 24 [erts-12.1.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]
Elixir 1.12.3 (compiled with Erlang/OTP 24)
OS: MacOS 11.6.1 (20G224)
Webdriver (selenium, chromedriver, geckodriver, etc): ChromeDriver 96.0.4664.45
Browser (Chrome, Firefox, Safari, etc): Chrome
Local or CI: Both

Test Code & HTML

  def login(session, email, password) do
    session
    |> assert_has(Query.css("#login-form"))
    |> fill_in(Query.css("#username-input"), with: email)
    |> fill_in(Query.css("#password-input"), with: password)
    |> click(Query.css("#login-submit"))
  end

  def successful_login(session, email, password) do
    session
    |> login(email, password)
    |> assert_has(Query.css(".page-index"))
  end

  feature "Settings page not visable to assignees", %{session: session} do
    session
    |> visit(@path)
    |> successful_login(@assignee.email, @assignee.password)
    |> refute_has(Query.css(".nav-menu-item", text: "SETTINGS"))
  end

Testing manually in firefox after running mix phx.server shows that these elements definitely don't exist and I can't think of a reason why it would take 60000ms to check.

of 18 tests in this file, 3 fail and always on refute_has with a 60000ms timeout:

     ** (ExUnit.TimeoutError) feature timed out after 60000ms. You can change the timeout:

In the mean time, I will also try to reproduce a minimal expample in a public repo