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 pauseTest test helper #9383

Merged
merged 1 commit into from
Oct 25, 2014
Merged

Conversation

kategengler
Copy link
Member

Adds a helper to pause a test.

@stefanpenner
Copy link
Member

👍

@lukemelia
Copy link
Member

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."

@rwjblue
Copy link
Member

rwjblue commented Oct 23, 2014

👍

This adds API so I think it will need to be feature flagged before we can merge...

@stefanpenner
Copy link
Member

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.

@kategengler
Copy link
Member Author

@lukemelia Added the 'why' documentation, thanks!


click('.btn');

The test will pause before clicking the button.
Copy link
Member

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):?

@pangratz
Copy link
Member

Awesome 👍

@pangratz
Copy link
Member

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 resolve() would continue the tests after inspecting/modifying the state ...

@stefanpenner
Copy link
Member

@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.

@pangratz
Copy link
Member

@stefanpenner hmm, right...

@pangratz
Copy link
Member

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');
}

@rwjblue
Copy link
Member

rwjblue commented Oct 23, 2014

@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).

@fivetanley
Copy link
Member

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

@kategengler
Copy link
Member Author

Added a feature flag. Let me know if I missed anything.

@rwjblue
Copy link
Member

rwjblue commented Oct 25, 2014

@kategengler - Thank you!

rwjblue added a commit that referenced this pull request Oct 25, 2014
@rwjblue rwjblue merged commit d33364b into emberjs:master Oct 25, 2014
@rwjblue
Copy link
Member

rwjblue commented Oct 28, 2014

👍 for enabling in 1.9.0-beta.1. Anyone have objections?

@stefanpenner
Copy link
Member

👍

@igorT
Copy link
Member

igorT commented Oct 28, 2014

❤️ much nicer than putting debuggers around and plays well with andThen

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.

None yet

7 participants