Test#promise()

promise (resolver, label) public Defined in packages/ember-testing/lib/test/promise.js:21 This returns a thenable tailored for testing. It catches failed onSuccess callbacks and invokes the Ember.Test.adapter.exception callback in the last chained then. This method should be returned by async helpers such as wait. Parameters: resolver Function The function used to resolve the promise. label String An optional string for identifying the promise.

Test#pauseTest()

pauseTestObjectpublic Defined in packages/ember-testing/lib/helpers/pause_test.js:6 Available since 1.9.0 Pauses the current test - this is useful for debugging while testing or for test-driving. It allows you to inspect the state of your application at any point. Example (The test will pause before clicking the button): javascript visit('/') return pauseTest(); click('.btn'); Returns: Object A promise that will never resolve

Test#originalMethods

originalMethods{Object}private Defined in packages/ember-testing/lib/ext/application.js:29 Available since 1.3.0 This property will contain the original methods that were registered on the helperContainer before injectTestHelpers is called. When removeTestHelpers is called, these methods are restored to the helperContainer. Default: {}

Test#onInjectHelpers()

onInjectHelpers (callback) public Defined in packages/ember-testing/lib/test/on_inject_helpers.js:3 Used to register callbacks to be fired whenever App.injectTestHelpers is called. The callback will receive the current application as an argument. Example: Ember.Test.onInjectHelpers(function() { Ember.$(document).ajaxSend(function() { Test.pendingRequests++; }); Ember.$(document).ajaxComplete(function() { Test.pendingRequests--; }); }); Parameters: callback Function Th

Test#keyEvent()

keyEvent (selector, type, keyCode) RSVP.Promisepublic Defined in packages/ember-testing/lib/helpers.js:64 Available since 1.5.0 Simulates a key event, e.g. keypress, keydown, keyup with the desired keyCode Example: keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() { // assert something }); Parameters: selector String jQuery selector for finding element on the DOM type String the type of key event, e.g. `keypress`, `keydown`, `keyup` keyCode Number the keyCode

Test#injectTestHelpers()

injectTestHelperspublic Defined in packages/ember-testing/lib/ext/application.js:96 This injects the test helpers into the helperContainer object. If an object is provided it will be used as the helperContainer. If helperContainer is not set it will default to window. If a function of the same name has already been defined it will be cached (so that it can be reset if the helper is removed with unregisterHelper or removeTestHelpers). Any callbacks registered with onInjectHelpers will be cal

Test#helperContainer

helperContainer{Object} The object to be used for test helpers.private Defined in packages/ember-testing/lib/ext/application.js:84 Available since 1.2.0 This will be used as the container to inject the test helpers into. By default the helpers are injected into window. Default: window

Test#findWithAssert()

findWithAssert (selector) Objectpublic Defined in packages/ember-testing/lib/helpers.js:122 Like find, but throws an error if the element selector returns no results. Example: var $el = findWithAssert('.doesnt-exist'); // throws error Parameters: selector String jQuery selector string for finding an element within the DOM Returns: Object jQuery object representing the results of the query

Test#find()

find (selector) Objectpublic Defined in packages/ember-testing/lib/helpers.js:105 Finds an element in the context of the app's container element. A simple alias for app.$(selector). Example: var $el = find('.my-selector'); Parameters: selector String jQuery string selector for element lookup Returns: Object jQuery object representing the results of the query

Test#fillIn()

fillIn (selector, text) RSVP.Promisepublic Defined in packages/ember-testing/lib/helpers.js:85 Fills in an input element with some text. Example: fillIn('#email', 'you@example.com').then(function() { // assert something }); Parameters: selector String jQuery selector finding an input element on the DOM to fill text with text String text to place inside the input element Returns: RSVP.Promise