I'm trying to catch a Heisenbug.
I'm updating our project from Ember CLI 0.2.0 and Ember 1.10.0 to Ember CLI 0.2.3 and Ember 1.11.1. This has been a pretty pain-free process, but I have exactly one test which now fails in Safari (7.1.5) only. It passes in PhantomJS, Chrome and Firefox.
Annoyingly, the test only fails when the test run is initiated by Testem (that is, when a change in the code triggers an auto-update test run). If I initiate tests from inside the Qunit web interface, it passes. Both of these things are true regardless of the test grouping. The feature being tested works just fine when run manually in the browser.
It's an integration test and verifies that when a value is changed in an input, the input updates with the value returned from the server. In the tests, the "server" is a Pretender instance. Here's what the test itself looks like:
test('Editing allocation cell', function() {
visit('/district/periods');
andThen( function () {
fillIn(SELECTORS.definitionRowInput(1,0), '100');
});
andThen( function () {
triggerEvent(SELECTORS.definitionRowInput(1,0), 'focusout');
// This is not always creating a POST event in Safari, even though it works there
});
andThen(function() {
equal($(SELECTORS.definitionRowInput(1,0)).val(), '90', 'The updated input takes the return value from the server (even if it is different from input)');
equal($(SELECTORS.gradeTotal(2)).text(), '120', 'Grade total updates with the new sum');
});
});
Note the second andThen() block: by sending focusout to the control, we should be prompting code in the backing component to update the data back to the server. The other browsers do this - I put a console.log() in the Pretender responder to verify it - but Safari doesn't. I'm guessing it's not responding properly to the focusout event.
Considering that this test passes in a branch which only differs by the Ember CLI update... what's likely to have changed to make this break?
Aucun commentaire:
Enregistrer un commentaire