-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 pauseTest test helper #9383
Conversation
👍 |
This is cool. I always forget the syntax for doing this, so it will be great to have a helper! Maybe the docs should have the "why" also. e.g. "This test helper is useful for when debugging a test as it allows you to inspect the state of your application while the test is paused." |
👍 This adds API so I think it will need to be feature flagged before we can merge... |
honestly, i would love to just fast forward this into beta. It should be 2 seconds for the rest of core to vet, if there are actual concerns we can do flags and a full cycle. |
8ae2fde
to
3b4fb99
Compare
@lukemelia Added the 'why' documentation, thanks! |
|
||
click('.btn'); | ||
|
||
The test will pause before clicking the button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be put out of the code sample, maybe Example (the test will pause before clicking the button):
?
Awesome 👍 |
I wonder if it might be useful to have the possibility to continue the tests? Maybe something like: function pauseTest() {
Test.adapter.asyncStart();
return new Ember.RSVP.Promise(function(resolve) {
debugger
}, 'TestAdapter paused promise');
} If the web inspector is open, a |
@pangratz if you engage a debugger it will also make it impossible to use the dev tools to inspect the DOM and interact with the app. |
@stefanpenner hmm, right... |
What about something along the lines: function pauseTest() {
Test.adapter.asyncStart();
return new Ember.RSVP.Promise(function(resolve) {
window.continueTest = function() {
Test.adapter.asyncEnd();
resolve();
}
}, 'TestAdapter paused promise');
} |
@stefanpenner - The last beta of 1.8 has shipped. I am not comfortable adding any new API surface at the end of a cycle that is not clearly solving a blocking issue. Please realize that this is not a reflection on this code in any way (I agree with it and would like to have this also), it is a point of process and fundamentals to me. IMHO, new API gets a feature flag (which we can in turn immediately enable for 1.9.0-beta.1 this weekend). |
also a +1 to rob's thoughts. also, i have wanted this feature forever but didn't realize that this would be the implementation. i love it |
3b4fb99
to
f6f50ff
Compare
f6f50ff
to
ed84274
Compare
Added a feature flag. Let me know if I missed anything. |
@kategengler - Thank you! |
👍 for enabling in 1.9.0-beta.1. Anyone have objections? |
👍 |
❤️ much nicer than putting debuggers around and plays well with andThen |
Adds a helper to pause a test.