elixir-wallaby / wallaby

Concurrent browser tests for your Elixir web apps.
https://twitter.com/elixir_wallaby
MIT License
1.68k stars 198 forks source link

js_errors: false config is being ignored #746

Open rails4sandeep opened 1 year ago

rails4sandeep commented 1 year ago

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns] [dtrace]

Elixir 1.15.4 (compiled with Erlang/OTP 26)

Operating system

Mac OSX Ventura 13.3.1

Browser

Chrome

Driver

Chromedriver

Correct Configuration

Current behavior

Config:

import Config

config :wallaby,
  js_errors: false
  driver: Wallaby.Chrome

import_config "#{config_env()}.exs"

Sample Test:

Application.ensure_all_started(:wallaby)

defmodule UitestsTest do
  use Wallaby.DSL
  use ExUnit.Case
  doctest Uitests

  test "greets the world" do
    assert Uitests.hello() == :world
  end

  test "hello wallaby" do
    {:ok, session} = Wallaby.start_session()

    session
    |> visit("our_website_url")
    |> page_title()
    |> IO.inspect()

   Wallaby.end_session(session)
  end
end

Test fails with error

** (Wallaby.JSError) There was an uncaught JavaScript error:

Expected behavior

As per the other issues and documentation, this should make wallaby ignore the js errors?

Test Code & HTML

stacktrace: (wallaby 0.30.6) lib/wallaby/chrome/logger.ex:8: Wallaby.Chrome.Logger.parse_log/1 (elixir 1.15.4) lib/enum.ex:984: Enum."-each/2-lists^foreach/1-0-"/2 (wallaby 0.30.6) lib/wallaby/driver/log_checker.ex:12: Wallaby.Driver.LogChecker.check_logs!/2 (wallaby 0.30.6) lib/wallaby/browser.ex:1269: Wallaby.Browser.visit/2 test/uitests_test.exs:16: (test)

Demonstration Project

No response