Test-Driven Development with Phoenix (self-published) (free)

Hi there, I’ve now gone through the book (a good read too!) and have started building a new CRUD-type website using the learnings from the book- i.e. TDD :slight_smile:

The thing I keep bumping in to is this: how do the Phoenix generators fit in with the approach advocated for in the book? Just by doing a mix phx.gen.html foo bar one gets a ton of functionality out of the door that is honestly too good to pass by for a simple CRUD app. It doesn’t make much sense starting with the bare bones FeatureCase and going through all the red-green-refactor cycles, because the generator will let you skip on a ton of those, prepare tests for you etc.- stuff that I really don’t want to miss out on because of the speed of development they afford me.

So I guess what I’m trying to say is maybe this: perhaps another section (another chapter? edit an existing chapter?) in the book that would adapt the TDD/BDD process to what the Phoenix generators provide out of the box would really help guide the readers on what e.g. your views on the generators are, or if/how they fit in with your test-first approach etc. I think that not acknowledging the convenience of the generators might lead to missing a chance of getting wider adoption of this technique because it might not be obvious how to merge the two.

Once again, thank you for the book and do not feel obliged to cater to every single wild idea on the internets!

EDIT: Restarted my computer and everything works flawlessly now. In Windows Subsystem for Linux, btw, if it helps anyone. Must have been some issue with the path not getting fully updated. Sorry for taking up space in the thread with this novice stuff :laughing:

Original Post

This book is already teaching me so much about TDD and testing in general, and I’m not even past the setting up part, lol. This is because I am getting the dreaded “invalid session id” error.

Chromdriver version: 88.0.4324.96
Chrome version: 88.0.4324.150

I assume with the major version numbers being the same, this should work. I’ve also incorrectly assumed many things in my life so I’ll be the first to admit ignorance.

I just installed latest version of stable Chrome and followed which version to install from the chromedriver site.

Not sure what I’m doing wrong but I’m really looking forward to working through the rest of this book. It’s clearly a fantastic resource and I’m extremely grateful to you for putting it out for free!

1 Like

I’m just getting into it, but I’m wondering, do the feature tests replace what would be the scaffolded controller tests? They seem to be covering the same thing, hit a route or two and ensure some functionality is correct.

It’s just the “feature” tests are run in a real browser and probably have different (better?) semantic meaning as they likely describe a users flow more accurately.

Hi,

I think it’s related to the fact it is a .sh file. I’ve done some digging here and I get the same error when I try to run the .sh associated with Wallaby but I am able to run chromedriver fine from within iex