Open allthesignals opened 7 years ago
Hmm, this is an odd one. setContext
is a method provided by ember-test-helpers
(the version you are using is here), and must be present if the tests are actually running and passing like you mentioned.
Are there any customizations to tests/helpers/module-for-acceptance.js
?
Also, this statement confuses me a bit:
but not in the interactive qunit interface
Can you describe how you are running the tests (what commands) when the do work vs when they do not work?
Hi @rwjblue - thank you for the response. I don't have customizations in my module-for-acceptance
which can be seen below (I think it is just the standard).
"qunit interface" is just the web-based interface you see at http://localhost:7357/
as opposed to the console-based interface (which is also interactive so I can understand the confusion):
The first tab is headless Chrome, the second is web-based.
Tests work when:
Tests do not work when:
ember g acceptance-test test-name
to generate. After doing a git bisect, I pinned the 'presence-of-acceptance-test-breaking-web-based-tester' behavior to one commit that adds ember-browserify
to package.json... that seems strange to me, possibly unrelated. However, after more digging, I found the use of a single addon component (which we built) seems to trigger the global failure. When it's commented out, no global failure, acceptance test passes. I can even re-add ember-browserify.
There are some weird behaviors deep inside that addon we use that I believe are causing this, specifically an error about setting properties on destroyed objects. I'm going to try to solve that issue, but it is confusing how the behavior differs between headless and web-based, and how an addon issue seems to be getting swallowed up.
I'll keep digging, but I think this is something project-specific rather than an issue with ember-cli-qunit
. The branch I'm using is here.
module-for-acceptance.js
import { module } from 'qunit';
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
const { RSVP: { resolve } } = Ember;
export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
if (options.beforeEach) {
return options.beforeEach.apply(this, arguments);
}
},
afterEach() {
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
return resolve(afterEach).then(() => destroyApp(this.application));
}
});
}
Any progress on this issue?
global failure:
This global failure occurs when I have an acceptance test present in my tests directory. NOTE: The tests run fine (including acceptance) in chrome headless browser, but not in the interactive qunit interface. I'm not sure how to approach this...
Here is my package.json:
It seems to be caused by the
visit('/report/demographic');
helper.Here's the full test: