-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
You cannot use the same root element (#ember-testing) multiple times in an Ember.Application #168
Comments
I think I'm seeing this too, it just started recently but I am getting this error all over the place. |
Hitting this too. Tried switching versions but couldn't get rid of the errors ;( Just noticed Phantom 2.0 is out... could that help? |
@elidupuis I've been using Phantom 2.0 and I'm still seeing the problems. |
Same issue. Does anyone have a solution for this already? |
@alvinvogelzang I downgraded to 0.3.13 and the errors went away (make sure to clear tmp/node_modules and install again) |
Still having this issue on Ember 1.13.4. Anyone able to solve this or do we need to stay on Ember 1.13.3 for now? Edit: Just for more info the Ember-QUnit version I am using is 0.4.1 |
I also have this issue. I made a fresh install with: bower.json:
package.json:
And I always get "Assertion Failed: You cannot use the same root element (#ember-testing) multiple times in an Ember.Application". I have exactly one integration test (apart from the jshint-tests):
|
@mydea I think the issue here is you are mixing the component integration test format with the acceptance test format. Does this work if you remove |
Same issue. My tests were fine with ember 1.12 and ember-qunit 0.4.1. But when i upgrade to ember 1.13.10, my test cases can not run anymore. Do we have any solution? I have tried to downgrade to 0.3.1 but that can not help me. |
Can someone please provide a reproduction so that we have a chance of tracking this down? |
@QVongoc Is it possible that there are some dependencies missing in index.html for tests? Like analytics or bugtracking stuff or anything you are loading to app/index.html? |
@rwjblue It looks like this is caused by async stuff in my initializers. I'm experimenting with this addon: https://github.com/minutebase/ember-inject-script. I think it might be race condition – test finish and then promise in initializer is resolved. Another error which I had sometimes is |
Last I looked, ember-qunit doesn't actually do anything with promises returned from setup/teardown hooks. That may explain your race. You can use |
FWIW these symptoms exactly match those that I experienced when initially upgrading ember from 1.12 to 1.13. My issue stemmed from having You may want to convert your component integration tests to the new style. This means changing things like test("this thing works!", function () {
var component = this.subject();
this.render();
equal(component.$('span.something').text(), 'some kinda text');
}) to something more like test("this thing works!", function () {
this.render(hbs`{{my-component}}`)
equal(this.$('span.something').text(), 'some kinda text');
}) To avoid having to do this for all your tests at once, and especially to avoid having to do this for tests that might be difficult to convert, you could try checking out emberjs/ember-test-helpers#115 which adds support for |
For those who want to try out
|
I was having this issue when using phantomjs 1.9 but not when using phantomjs 2.0. I added a polyfill for bind that doesnt exist in phantomjs 1.9 and that resolved my issue. |
Any news on this? |
niccholasjstock (https://github.com/rwjblue/ember-qunit/issues/168#issuecomment-158085991) is right. Faced same issue running phantomjs 1.9.8. After update to 2.1.1 tests passes again. |
Another way to hit this that just bit me: I had a typo in one acceptance test that I had converted from an initial pass at it as a component test. This made all tests in the affected module hang after running otherwise more or less successfully, blowing up the rest of the test suite. Specifically, I was inadvertently using QUnit BAD
GOOD
Incredibly obvious in hindsight, but this was a big test with lots going on and hopefully my pain will help avoid someone else's... |
I get this on phantomjs 1.9.8 when using When I tried upgrading from phantomjs 1.9.8 to 2.1.1, I instead got this problem:
|
closing due to inactivity |
To future visitor who land here from Google: this is an old thread with out-of-date advice. For example, in modern Ember you're supposed to use There are several reasons you might see "you cannot use the same root element" errors, mostly around broken tests leaving part of an application around to conflict with the next test. |
@ef4 are you aware of any blogs/docs (codemods?) etc further detailing causes with ember 3? FWIW I'm bumping from ember 2.18. |
Thanks @jelhan that's already set, I'll keep hunting. |
Ah ha thanks, Still the same num of test failing, but at least I can see for sure now that they are unhandled promise rejections. |
We started getting this on the build server after 0.3.2 was published. Traced it back to ember-qunit and a downgrade to 0.3.1 which got our tests running successfully again. Here is the log
I'm not familiar enough with the changes in 0.3.2 to pinpoint the issue. I see some stuff was added for Glimmer (we're on Ember 1.11.3)
The text was updated successfully, but these errors were encountered: