It was an annoying problem for several days. When I start trying to write acceptance tests for my Ember application, when I use the function visit(), the URL changes in the address bar of the browser, so when I change a bit of code and liveReload happens, it goes from my test page to any page that I said visit her in tests.
To troubleshoot, I'd ember newcreated a new application / home route and template and created an acceptance test for it, and it went fine without changing the URL in the address bar. I compared the code in tests/helpersand it is the same as tests/index.html.
I searched everything without meeting an answer. It was hard enough for me to check, but such problems are just tangential, but very annoying. If someone tells me why this is happening, I would be very grateful for the correction.
As an example, here is my one acceptance test. It passes, but the URL does change:
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from 'star/tests/helpers/start-app';
var application;
module('Acceptance: AddMilestone', {
beforeEach: function() {
application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
}
});
test('Adding milestones', function(assert)
visit('/projects/1234567/details');
andThen(function() {
assert.equal(currentPath(), 'project.details');
});
});
source
share