Created
July 28, 2016 22:05
-
-
Save jonpitch/fd8e3e8152652291f0b064a76303e3de to your computer and use it in GitHub Desktop.
write better ember tests - ember page object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// page.js | |
import PageObject, { | |
text, | |
isVisible | |
} from 'frontend/tests/page-object'; | |
export default PageObject.create({ | |
// some button | |
button: { | |
scope: '#some-button-id', | |
isVisible: isVisible() | |
}, | |
// some p tag | |
description: { | |
scope: 'p', | |
text: text() | |
} | |
}); | |
// the test | |
import page from 'app/tests/pages/something'; | |
test('here is a test using ember-cli-page-object', function(assert) { | |
this.render(hbs`{{my-component}}`); | |
assert.ok(page.button.isVisible, 'I see the button'); | |
assert.equal(page.description.text, 'Some text', 'The text is shown correctly'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment