test "admin log in is required", %{session: session, conn: conn} do
session
|> visit(Routes.admin_user_path(conn, :index))
|> assert_has_flash(text: "You must log in", level: :warning)
|> assert_has_current_path(Routes.admin_auth_path(conn, :log_in))
end
Elixir and Erlang/OTP versions
Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Elixir 1.10.0 (compiled with Erlang/OTP 22)
Operating system
Debian
Browser
Chrome
Driver
chromedriver 114
Correct Configuration
Current behavior
I am using {:wallaby, "~> 0.23", only: [:test]} config :wallaby, max_wait_time: if(ms = System.get_env("WALLABY_MAX_WAIT_TIME"), do: String.to_integer(ms), else: 5000), screenshot_on_failure: false, driver: Wallaby.Experimental.Chrome, chrome: [headless: System.get_env("WALLABY_DISABLE_HEADLESS_CHROME") != "true"]
The ExUnit tests are failing with the following error
%Wallaby.Session{driver: Wallaby.Experimental.Chrome, id: "123213asdasd213", screenshots: [], server: Wallaby.Experimental.Chrome.Chromedriver, session_url:
defp cast_as_element(parent, -%{"ELEMENT" => id}-) defp cast_as_element(parent, -%{"element-213123-11e4-eqwe1235466c213cf" => id}-)
Expected behavior
The ExUnit test must pass
Test Code & HTML
test "admin log in is required", %{session: session, conn: conn} do session |> visit(Routes.admin_user_path(conn, :index)) |> assert_has_flash(text: "You must log in", level: :warning) |> assert_has_current_path(Routes.admin_auth_path(conn, :log_in)) end
Demonstration Project
No response