Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Page objects in integration tests for components #96

Closed
jeradg opened this issue Jan 5, 2016 · 3 comments
Closed

Feature: Page objects in integration tests for components #96

jeradg opened this issue Jan 5, 2016 · 3 comments

Comments

@jeradg
Copy link
Contributor

jeradg commented Jan 5, 2016

This addon is great in acceptance tests, so I thought I would try using page objects to DRY up my integration tests for Ember components. This seemed like it might be straightforward, since pages are structured based on components anyway, and almost all of the page-object methods would be useful in component tests (except visitable()).

This doesn't currently work, however, because ember-cli-page-object uses the global find() to query selectors, which is only available in acceptance tests. (There may be other issues as well, but this one blocked me from looking any further.)

To fix this in integration tests, I suspect that the page object would just need access to this.$() instead of find(). I'm happy to try this out and (hopefully) submit a PR with page objects that can be configured to work in integration tests.

Just wanted to be sure that this isn't already a feature-in-progress, or that this use case hasn't been ruled out for some reason.

@jeradg
Copy link
Contributor Author

jeradg commented Jan 5, 2016

Just took another look at the codebase and noticed that there are a number of global acceptance test helpers in use. (click(), etc.) These would have to be replaced with their integration counterparts as well, but that should be equally doable.

@csantero
Copy link
Contributor

csantero commented Jan 5, 2016

@jeradg See the discussion in #79. At the moment the workaround is to start the app for each component integration test.

@jeradg
Copy link
Contributor Author

jeradg commented Jan 6, 2016

OK, thanks. I'll restrict page objects to my acceptance tests for now.

@jeradg jeradg closed this as completed Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants