wallaby icon indicating copy to clipboard operation
wallaby copied to clipboard

Feature: Allow flag for disabling sandbox

Open Zurga opened this issue 7 months ago • 4 comments

Sometimes the Ecto.Adapters.SQL.Sandbox is not a good fit when testing. If Postgres triggers are setup, the sandbox will not trigger them because the transaction is not comitted. For that reason it might be good to be able to disable the sandbox on a Case basis.

This PR adds a :sandbox opt to use Wallaby.Feature allowing the caller to disable the sandbox, even if they have the module loaded.

Zurga avatar May 02 '25 10:05 Zurga

If you don't want to automatically checkout the ecto repos, you might be better off just importing Wallaby.Feature instead of "use" it.

That would require starting the session manually, however

mhanberg avatar May 02 '25 12:05 mhanberg

Yes, I saw this in the tests but then I also lose out on the automatic screenshot on failure, capabilities and other nice stuff use Wallaby.Feature provides

Op vr 2 mei 2025 2:42 p.m. schreef Mitchell Hanberg < @.***>:

mhanberg left a comment (elixir-wallaby/wallaby#810) https://github.com/elixir-wallaby/wallaby/pull/810#issuecomment-2847115524

If you don't want to automatically checkout the ecto repos, you might be better off just importing Wallaby.Feature instead of "use" it.

That would require starting the session manually, however

— Reply to this email directly, view it on GitHub https://github.com/elixir-wallaby/wallaby/pull/810#issuecomment-2847115524, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBBRQXQTZ3JXW47MIU5JJT24NR3VAVCNFSM6AAAAAB4JWBITWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNBXGEYTKNJSGQ . You are receiving this because you authored the thread.Message ID: @.***>

Zurga avatar May 02 '25 13:05 Zurga

You still get automatic screenshots if you use the feature macro, which you get by importing Wallaby.Feature

mhanberg avatar May 02 '25 13:05 mhanberg

Ah yes you are correct! If you are not inclined to merge this PR, feel free to close it

Zurga avatar May 02 '25 13:05 Zurga