Wallaby visit("/") produces empty screenshot

Hi all.
I am brand-new on wallaby.

It looked very nice to me, so I added it to my Phoenix-application, which uses Ecto.
I am using the chrome-driver.

I was able to create a feature test, which seems to start correctly. I see the chrome-icon inside my dock blink shortly.
The test without assertion passed.

But when I tried to find a css element, it told me, there was none visible.

** (Wallaby.QueryError) Expected to find 1, visible element that matched the css 'h1' but 0, visible elements were found.
     
     code: |> find(Query.css("h1", text: "Welcome"))
     stacktrace:
       (wallaby 0.29.1) lib/wallaby/browser.ex:956: Wallaby.Browser.find/2
       test/anamnesis_content_viewer/integration/index_page_test.exs:15: (test)

I used the take_snapshot function.
It showed a white, empty image.

I changed to a different route via visit().
But all routes returned the same empty snapshot image.

How can I find out, what’s going wrong.

I think, maybe I missed something when adding wallaby to my project.
Or could it be?: My Phoenix-App is running on port 4000. Do I have to specify the port somewhere?

here is my test

feature("foo", %{session: session}) do
    session
    |> visit("/")
    |> take_screenshot()
    |> find(Query.css("h1", text: "Welcome"))
  end

@mhanberg : do you have an idea?

Thanks for your answer, HeIko

I found the error.

My base_url was β€œhttp://localhost:4000”.
But it has to be "http://localhost:4002.

After correcting it, everything worked perfectly.
Thanks to Mitchell Hanberg for his help.

1 Like