coen.bakker
I have recently started using TDD for Phoenix/LiveView. I read the tddphoenix.com course and really liked this approach to building features. Following the example on tddphoenix.com, I have been using Wallaby for my feature tests.
However, when I look around in open source LiveView projects, I see that they don’t use feature tests. At least the open source projects that I have looked into. I feel like I’m missing something here. I have a ton of feature tests already. Could that be a bad thing?
If you’re also using TDD, when would you recommend using a feature testing package, like Wallaby? What are the arguments for and against? If you are using TDD, but not feature tests, how are you approaching TDD in your projects?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sodapopcan
I have not read the book you referenced (though I’d like to!) so I have no frame of reference there.
I do write feature tests (or e2e’s as I call 'em) and while I am a big fan of top-down (which is sounds like your are doing) I draw the line at starting with them because they are too heavy. The primary point of going top down for me is to inform what I need to build (as well as not to have to write tests afterwards which is never fun), and starting with LiveView and controller tests takes care of this just fine (while also providing good regression coverage!) I write feature specs afterwards to cover things that can’t be covered by the other methods (mostly JS stuff) as well as providing “smoke tests.” And sometimes user journey-type stuff, though I’ve been doing some of that in LiveView tests lately! I don’t like having lots of features specs since they are slow and, even though they are much faster in Elixir world, I like to keep them sparse and only test the happy paths.
In a world where feature specs ran as quickly as LiveView tests, they very well may be the only tests I would write
That’s not totally true, but sort of.
mhanberg
Current maintainer of Wallaby here
If your LiveViews aren’t using any JS hooks, then using LiveViewTest is a reasonable first stop when testing a LiveView. I almost think of it as unit testing your LiveView.
I think some differences to note when making a decision:
I think they both have their place, but in generally you might have more LiveViewTest than Wallaby tests, as they are cheaper to run.
I have plans (I am currently very busy with #elixir-tools, but some day hopefully) to implement a LiveViewTest driver for Wallaby, so that you can write LiveViewTest with the Wallaby API: LiveViewTest Driver · Issue #729 · elixir-wallaby/wallaby · GitHub
sodapopcan