Aura apps

Software developer, London, UK.

Acceptance testing in Ember-CLI, an introduction.

The only form of tests you can’t really live without are acceptance tests, they always ensure that requirements are met, and almost always expose flaws.

Today we will (try to!?) cover the basics of acceptance testing in Ember-CLI Apps, Involving all parts of the stack but the back-end.

For operations that require interaction with the server, we’ll use Pretender + Mirage to mock our back-end on a per-test basis, although it also supports having the same responses for both development and test environments.

We will be testing a form to create homework:

  • Inputs for a title, a description and a year associated to it.
  • On success, transitions to show the homework that was just created.

Let’s start by generating an acceptance test inside a new dummy app:

$ ember g acceptance-test create-homework

And add a new test, checking for the presence of a homework that has inputs for both a title...

Continue reading →