Testing an Ember application is easy. Ember includes several helpers to aid with integration testing; these helpers are aware of asynchronous behavior in the application and make it extremely easy to write tests.
Ember provides some useful helper methods for integration testing, which are as follows:
visit(url)
: This visits the given route (url
) and returns a promise that is resolved when all async behavior is completefind(selector, context)
: This locates an element byselector
within the application and/or within the contextfillIn(selector, text)
: This locates an input element byselector
, fills with the given text, and returns a promise when completeclick(selector)
: This locates an element byselector
, triggers the elements'click
event, and returns a promise when completekeyEvent(selector, type, keyCode)
: This simulates a key event withkeyCode
on the element found byselector