2

I am developing an application based on Elixir and Phoenix which also uses the Wallaby application for HTTP based testing in a headless Chrome browser.

Now recently I receive a rather unwieldy error message when executing my ExUnit tests:

** (MatchError) no match of right hand side value:
    {:error, {:wallaby, {:bad_return, 
      {{Wallaby, :start, [:normal, []]},
      {:EXIT,
        {%Protocol.UndefinedError{description: "", protocol: Enumerable, value: nil},
        [{Enumerable, :impl_for!, 1, [file: '/root/deb/elixir_1.8.0-1/lib/elixir/lib/enum.ex', line: 1]},
         {Enumerable, :slice, 1, [file: '/root/deb/elixir_1.8.0-1/lib/elixir/lib/enum.ex', line: 193]},
         {Enum, :backwards_compatible_slice, 1, [file: 'lib/enum.ex', line: 2871]},
         {Enum, :slice_any, 3, [file: 'lib/enum.ex', line: 3075]},
         {Enum, :at, 3, [file: 'lib/enum.ex', line: 381]},
         {Wallaby.Experimental.Chrome, :validate, 0, [file: 'lib/wallaby/experimental/chrome.ex', line: 36]},
         {Wallaby, :start, 2, [file: 'lib/wallaby.ex', line: 27]},
         {:application_master, :start_it_old, 4, [file: 'application_master.erl', line: 277]}]}}}}}}

test/test_helper.exs:4: (file)
(elixir) lib/code.ex:767: Code.require_file/2
(elixir) lib/enum.ex:769: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:769: Enum.each/2

I am running a Debian GNU/Linux 9 "Stretch" and installed Elixir as a .deb package with version 1.8.0-1 from binaries.erlang-solutions.com. Wallaby is locked to {:wallaby, "~> 0.21.0"}.

Ideas on how to fix this would be greatly appreciated.

aef
  • 4,498
  • 7
  • 26
  • 44
  • 1
    `v0.21.0` which is the latest of _Wallaby_ has different code in [`chrome.ex:36`](https://github.com/keathley/wallaby/blob/v0.21.0/lib/wallaby/experimental/chrome.ex#L36). Start with updating _Wallaby_. – Aleksei Matiushkin Jan 23 '19 at 10:07
  • Sadly, I'm already running `{:wallaby, "~> 0.21.0"}`. – aef Jan 23 '19 at 12:52
  • Ah, indeed, I misread the code. Then the only option would be to clone, debug, fix, and provide a PR. Or roll back to Elixir 1.7 :) – Aleksei Matiushkin Jan 23 '19 at 13:01
  • I now downgraded Elixir and found out that the error still persists in Elixir 1.7.4. So it is not as formerly suspected a problem with Elixir 1.8. – aef Jan 23 '19 at 13:31

1 Answers1

2

The problem is caused by Wallaby 0.21.0 not being able to handle a ChromeDriver version higher than 2.x, but ChromeDriver versions as high as 71.x are already around.

This has been fixed by this pull request, which has been merged into Wallaby master but doesn't seem to be released yet.

Lbrink
  • 36
  • 2