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

Should `server` field in a session returned by Wallaby.Chrome.start_session contain a PID? #658

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hello!

I noticed that the Wallaby.Session type dictates that the :server field should be a pid or :none:

https://github.com/elixir-wallaby/wallaby/blob/881b716e59033587aa6e652202f7a1e5fe9b16e4/lib/wallaby/session.ex#L10

but in Wallaby.Chrome the value assigned to that field seems to be a module name:

https://github.com/elixir-wallaby/wallaby/blob/5557024105f9311659cb3d07a378475a9f6cf25f/lib/wallaby/chrome.ex#L231

Should that be a call to self() instead of the module name? Or am I misunderstanding something?

The reason this came up is because I am writing a feature test with multiple sessions for a LiveView component and I'm using the process ids to identify different users but am unable to find a way of getting each session's process id.

I appreciate your help, thank you!