san650 / ember-cli-page-object

This ember-cli addon eases the construction of page objects on your acceptance and integration tests
http://ember-cli-page-object.js.org/
MIT License
275 stars 90 forks source link

Is there a way to get the full scope of a page object? #473

Closed NullVoxPopuli closed 4 years ago

NullVoxPopuli commented 4 years ago

Been thinking about what "integration" with qunit-dom would look like, and I think maybe something like:

assert.dom(page.something.nested.scope).hasText('something');

is nice, but for scope, I know I'm just accessing the property on page.something.nested.

It'd be nice if there was a way to also get the scope of the hierarchy. like,

'[data-test-root] [data-test-something] [data-test-nested] [data-test-the-scope]'
ro0gr commented 4 years ago

There is a buildSelector exported from the root of "ember-cli-page-object" module. But it produces a JQuery selector, which I believe makes it unusable in "qunit-dom" once you use it with collections for example.

ro0gr commented 4 years ago

At the moment buildSelector is not included in the types(sorry for inconvenience), cause I believe we should discourage users from using it. I think in most(all) cases having an element should cover user needs.

However, seems like people still need it to adjust integrations with external libs, so I don't think we should deprecate(which was my original intention) it soon. So, in case you find it useful to have typings for this, I'd gladly accept a PR!

NullVoxPopuli commented 4 years ago

closing, because ember-cli-page-object uses jQuery, and jQuery selectors aren't valid selectors to browsers.