Book Image

Learning Yeoman

By : Jonathan Spratley
Book Image

Learning Yeoman

By: Jonathan Spratley

Overview of this book

Table of Contents (17 chapters)
Learning Yeoman
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Modern Workflows for Modern Webapps
Index

Testing


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.

The test helpers

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 complete

  • find(selector, context): This locates an element by selector within the application and/or within the context

  • fillIn(selector, text): This locates an input element by selector, fills with the given text, and returns a promise when complete

  • click(selector): This locates an element by selector, triggers the elements' click event, and returns a promise when complete

  • keyEvent(selector, type, keyCode): This simulates a key event with keyCode on the element found by selector

Setup

Ember comes with support for integration testing and unit testing. Let's configure...