Closed pshoukry closed 1 year ago
Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Elixir 1.14.3 (compiled with Erlang/OTP 25)
Windows with WSL2
Chrome
Setup Wallaby following default steps
Create a session with mobile configuration (to test specific behavior on mobile )
@mobile [ capabilities: %{ chromeOptions: %{ args: [ "--no-sandbox", "--disable-gpu", "--headless", "--fullscreen" ], mobileEmulation: %{ deviceName: "iPhone 12 Pro" } } } ]
Use the session in a test with DB access
@sessions [@mobile, @small_screen, @default] feature "Users sees sidenav", %{sessions: [m, sm, desktop]} do user = AccountsFixtures.valid_user_attributes() m |> sign_up(user.username, user.email, user.password) |> assert_has(@sidenav)
Run the tests to see the error
** (DBConnection.OwnershipError) cannot find ownership process for #PID<0.1414.0>.
When using ownership, you must manage connections in one of the four ways:
Tests run properly which is what happens when you use normal useragent without the mobile capabilities.
The bug is definitely related to the way wallaby uses user_agent to track every session.
@mobile [ capabilities: %{ chromeOptions: %{ args: [ "--no-sandbox", "--disable-gpu", "--headless", "--fullscreen" ], mobileEmulation: %{ deviceName: "iPhone 12 Pro" } } } ] @small_screen [ capabilities: %{ chromeOptions: %{ args: [ "--window-size=640,640", "--no-sandbox", "--disable-gpu", "--headless", "--fullscreen" ] } } ] @default [] @sessions [@mobile, @small_screen, @default] feature "Users sees sidenav", %{sessions: [m, sm, desktop]} do user = AccountsFixtures.valid_user_attributes() m |> sign_up(user.username, user.email, user.password) |> assert_has(@sidenav)
No response
Opted to manipulate window size using wallaby instead of manipulating the browser capabilities.
Elixir and Erlang/OTP versions
Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Elixir 1.14.3 (compiled with Erlang/OTP 25)
Operating system
Windows with WSL2
Browser
Chrome
Driver
Chrome
Correct Configuration
Current behavior
Setup Wallaby following default steps
Create a session with mobile configuration (to test specific behavior on mobile )
Use the session in a test with DB access
Run the tests to see the error
When using ownership, you must manage connections in one of the four ways:
Expected behavior
Tests run properly which is what happens when you use normal useragent without the mobile capabilities.
The bug is definitely related to the way wallaby uses user_agent to track every session.
Test Code & HTML
Demonstration Project
No response