11# Ember-cli-test-recorder
2- Recording your steps used to interact with an Ember applications
3- to then be added to an integration test. The idea is to save you time writing these
4- tests by hand.
2+ This records the ways you interact with an Ember application, and then generates the code to playback these actions and
3+ test results in an acceptance test. The idea is to save you time writing these tests by hand.
54
65You should only add this component to your app when your app behaves as
7- expected as the mutations will be recorded.
6+ expected (happy flow) as then you will have the tests generated for expected behaviour
87
98###Current UI interactions that are recorded for acceptance tests:
109
1110* Button clicks, they also generate andThen code blocks.
1211* Record any changes to route
13- * Changes in whether items are present in the DOM, only items with ID's are recorded
12+ * Changes in DOM additions/removals , only items with ID's are recorded and that don't have the doNotRecord css class.
1413
1514##Usage
1615
@@ -20,10 +19,9 @@ inside the application.hbs template
2019``` hbs
2120{{test-recorder currentRouteName=currentRouteName}}
2221```
23- If you want a particular node to be tested for being in the active dom then give it an id
24- eg an element of ` <p></p> ` will not be recorded, but ` <p id='foo'></p> ` will have a test generated like:
22+ All elements that match this selector ` [id^=ember]:not(.dont),[data-ember-action] ` are recorded.
23+ If an element doesn't have an id then a dom path selector will be generated to click on this buttonin a test, ie
2524``` js
26-
2725click (" html>body>div>div:eq(0)>button" );
2826andThen (function () {
2927 equal (find (" #foo" ).length , 0 , " foo removed AFTER user [INSERT REASON]" );
@@ -36,10 +34,7 @@ If you don't want an element to be recorded, and any of its children add this cl
3634
3735Avoid making multiple button clicks (or other interactions that cause asynchronous) updates until DOM has
3836finished updating. This will allow code generated by the mutations observer to be placed in the in the
39- generated code.
40-
41- There are currently some hacks as this is designed not to be embedded into your application,
42- ie require code modification.
37+ generated code. This happens outside of the ember run loop.ImpIm
4338
4439
4540## Roadmap
0 commit comments