Methods

removeContext

test-support/page-object/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

test-support/page-object/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

test-support/page-object/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