Methods

removeContext

addon/context.js:63-69

Unsets the page’s test context.

Useful in a component test’s afterEach() hook, to make sure the context has been cleared after each test.

Examples

page.removeContext();

Returns PageObject the page object

render

addon/context.js:17-28

Render a component’s template in the context of a test.

Throws an error if a test’s context has not been set on the page.

Returns the page object, which allows for method chaining.

Parameters

  • template Object A compiled component template

Examples

page.setContext(this)
  .render(hbs`{{my-component}}`)
  .clickOnText('Hi!');

Returns PageObject the page object

setContext

addon/context.js:44-50

Sets the page’s test context.

Returns the page object, which allows for method chaining.

Parameters

  • context Object A component integration test’s this context

Examples

page.setContext(this)
  .render(hbs`{{my-component}}`)
  .clickOnText('Hi!');

Returns PageObject the page object