Test#registerAsyncHelper()

registerAsyncHelper (name, helperMethod) public Defined in packages/ember-testing/lib/test/helpers.js:43 Available since 1.2.0 registerAsyncHelper is used to register an async test helper that will be injected when App.injectTestHelpers is called. The helper method will always be called with the current Application as the first parameter. For example: Ember.Test.registerAsyncHelper('boot', function(app) { Ember.run(app, app.advanceReadiness); }); The advantage of an async helper is that

Test#registerHelper()

registerHelper (name, helperMethod, options) public Defined in packages/ember-testing/lib/test/helpers.js:5 registerHelper is used to register a test helper that will be injected when App.injectTestHelpers is called. The helper method will always be called with the current Application as the first parameter. For example: Ember.Test.registerHelper('boot', function(app) { Ember.run(app, app.advanceReadiness); }); This helper can later be called without arguments because it will be called w

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#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#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#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#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

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#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