stevegrossi
Wallaby Acceptance tests pass individually, fail when run together
I’m using Wallaby (0.17.0) for acceptance tests with phantomjs (2.1.1), and the latest Elixir (1.4.5) and Erlang (20). I’ve written a few acceptance tests, each of which passes when run individually, but when I run them together (via mix test test/acceptance) they fail because things that should be on the page aren’t. It’s as if all the tests are running in the same browser, even though Wallaby should “manage multiple browsers for you.”
I believe I’ve set everything up according to the setup section of the README, although I’m not running the tests with async: true because my app uses sockets and Phoenix.Ecto.SQL.Sandbox doesn’t play well with async. To be clear, the tests also fail with async: true, I just also get DBConnection.OwnershipErrors in each when attempting to connect to the socket.
Is there anything else necessary to ensure each test is run in its own phantomjs browser, or to clear out sessions between test runs?
Most Liked
stevegrossi
I believe this may be a bug with Wallaby. When I IO.puts both the session.id and result of execute_script("return localStorage.getItem('token')" at the start of each test, it’s clear that each test is run in a differens phantomjs session (the ids differ) but that the token I’m setting with localStorage.setItem is persisting across sessions.
I’ve reproduced this behavior in a minimal sample app: GitHub - stevegrossi/wallaby_test: A test of how Wallaby handles localstorage across sessions · GitHub and have submitted an issue to Wallaby: localStorage persisting across sessions · Issue #274 · elixir-wallaby/wallaby · GitHub
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








