elixir-wallaby / wallaby

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

Confirm Wallaby works on Windows computers #594

Open mhanberg opened 3 years ago

mhanberg commented 3 years ago

Related to #593

Problem

It seems that the usage of a bash script might cause Wallaby to not work on Windows machines.

(Potential) Solution

CallumVass commented 3 years ago

Looks like this was brought up a few years ago, with a different .sh file: https://github.com/elixir-wallaby/wallaby/issues/102

spapas commented 2 years ago

Hello friends, any news on this issue? I can confirm that wallaby works on WSL but I don't wanna use it. I prefer to use good ol cmd line.... Thank you!

CallumVass commented 2 years ago

Sorry, I resorted to using it via WSL which resolved the issue for me.

nuno84 commented 2 years ago

Hi, Can you comment on this?

Checkout this post: [https://elixirforum.com/t/port-open-eacces-on-windows/5442/5]

The actual code throws an error here:

  @spec open_chromedriver_port(String.t(), port_number) :: port
  defp open_chromedriver_port(chromedriver_path, port_number) when is_binary(chromedriver_path) do
    Port.open(
      {:spawn_executable, to_charlist(wrapper_script())},
      port_opts(chromedriver_path, port_number)
    )
  end

So this is the error: Port.open({:spawn_executable, 'c:/Users/Asus/Documents/myproject/_build/dev/lib/wallaby/priv/run_command.sh'},[:binary, :stream, :use_stdio, :stderr_to_stdout, :exit_status, {:args, ["chromedriver", "--log-level=OFF", "--port=27349"]}]) ** (ErlangError) Erlang error: :eacces

According to the forum post above I tried: Port.open({:spawn_executable, 'c:/windows/system32/cmd.exe'},[:binary, :stream, :hide, :use_stdio, :stderr_to_stdout, :exit_status, {:args, ["/c", "chromedriver", "--log-level=OFF", "--port=27349"]}])

It doesn't throw the eacces error anymore. Can this be a solution? It would be great to solve this on windows. I assume that both Erlang and Elixir had big troubles to make it work on windows also and this issue can be overcome. Thank you

nuno84 commented 2 years ago

Sorry, I resorted to using it via WSL which resolved the issue for me.

Hi @CallumVass . I installed WSL (Debian) but can you guide me on how to use WSL to run Wallaby? Using windows on Web Development is always a major challenge ;) Thank you very much