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

Add native-events mode #339

Merged
merged 8 commits into from
Nov 15, 2017
Merged

Add native-events mode #339

merged 8 commits into from
Nov 15, 2017

Conversation

ro0gr
Copy link
Collaborator

@ro0gr ro0gr commented Nov 11, 2017

addresses #311

I've rebased commits from #325 for more convenient review and addressed @pzuraq comment.


ember-native-events context allows not to rely on global ember test helpers(click, fillIn,..).

One of the benefits of native-events mode is an ability to test jquery-free applications.
However we still use jquery selectors like :is, :contains etc(#289).
In order to drop dependency on jquery provided by Ember by default we bundle our own jquery version.

To enable native dom helpers in your tests, put this lines into your tests/test-helper.js:

// tests/test-helper.js
...
import { useNativeEvents } from 'ember-cli-page-object/extend';

useNativeEvents(); // this will replace classic contexts with `e-n-d-h`

Tests

I've expanded property tests with [native-dom] mode for both integration and acceptance contexts. It seems a little not optimal however it gives a solid code coverage with a minimal efforts.

todo

@ro0gr
Copy link
Collaborator Author

ro0gr commented Nov 13, 2017

As @pzuraq noticed in #ec-page-object slack channel we still allow to specify jquery selectors in page objects in a native-dom mode:

[7:26 PM] moreso what I mean is here: https://github.com/san650/ember-cli-page-object/pull/339/files#diff-66f0a7ca63b50a6b9973d119ab2570a5R43
[7:26] in theory, a user could pass in a jquery selector
[7:27] which would then be matched correctly, pull the corresponding element out, and apply the native dom helper

That means the current native-dom name is not very precise. We might get a naming collision If we occasionally will decide to provide true native-dom mode w/o jquery on board. So in the last commit I've renamed native-dom to native-events as @magistrula previously suggested.

Also useNativeDOMHelpers renamed to useNativeEvents

@ro0gr ro0gr mentioned this pull request Nov 13, 2017
3 tasks
@san650
Copy link
Owner

san650 commented Nov 14, 2017

@ro0gr can you rebase with master?

@ro0gr
Copy link
Collaborator Author

ro0gr commented Nov 14, 2017

Sure. Will do it today

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 98.063% when pulling fdadc85 on ro0gr:native-dom into 8030784 on san650:master.

@ro0gr
Copy link
Collaborator Author

ro0gr commented Nov 14, 2017

It's finally green 🎉

@san650 san650 merged commit c2b3fc0 into san650:master Nov 15, 2017
@san650
Copy link
Owner

san650 commented Nov 15, 2017

👏 👏 👏 👏 🎉 🍾

@ro0gr ro0gr changed the title Add native-dom mode Add native-events mode Nov 15, 2017
@simonihmig
Copy link
Contributor

@ro0gr Thanks a lot for working on this! Also to all others who helped to get this to land! (@pzuraq @magistrula @san650) This is highly appreciated! 👍 👏

I just wished I could have helped more, but time was too limited. But we do have an app I want to give the alpha version a try, will report back if there are any issues!

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

Successfully merging this pull request may close these issues.

4 participants