elixir-wallaby/wallaby

Debug output

phortx opened this issue · 5 comments

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.16.2 (compiled with Erlang/OTP 24)

Operating system

MacOS

Browser

Chrome

Driver

chromedriver

Correct Configuration

  • I confirm that I have Wallaby configured correctly.

Current behavior

Since I have tests using wallaby, there is some debug output like this, when running the tests.

"phx-F9XMz2hbhdWo3wah mount:  - " Object
"phx-F9XMz2hbhdWo3wah socket: disconnect for page nav - " undefined
"phx-F9XMz2hbhdWo3wah destroyed: the child has been removed from the parent - " undefined
" destroyed: the child has been removed from the parent - " undefined
" destroyed: the child has been removed from the parent - " undefined

Expected behavior

Wallaby should not print any debug output :)

Test Code & HTML

Not sure by now, seems like this happens when a redirect or page change happens (maybe with LiveView?)

Demonstration Project

No response

This is the liveview js debug output, you should turn this off if you don't want it printing during test output.

Aaah good point! Thank you very much.

I couldn't find how to disable these debug messages. Do you have a hint for me?

They are explicitly enabled in your app.js file.

I generally have them off by default and then turn them on when i think I need them, but I'm sure you can get fancier to get them enabled in dev and disabled in test

Thanks for your advice,

I only found this line which seems to be related to that output, but it's already commented out:

// >> liveSocket.enableDebug()

🤔

I know, this is not a wallaby issue, so I really appreciate your help 😄

I've added

liveSocket.disableDebug();

to the app.js. Now the debug output is gone. Thank you very much for your help, Mitchell :)