is there any way i can make tests order dependent so test 2 doesn't start until test one has finished? going to localhost:4200/tests runs them in a non deterministic manner and sometimes it goes in the correct order and works fine but other times it runs them out of order which can cause issues, is there any way to force specific order but keep them in separate test functions, I could always just put everything for that test in one big test function so that the order always works but I feel like they deserve to be broken out into their own functions, any guidance would be appreciated? the example below is just an example test of what I want the order to look like
import Ember from 'ember';
import startApp from '../helpers/start-app';
var application;
module('Acceptance: Login', {
beforeEach: function() {
application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
}
});
test('test 1', function(assert) {
authenticateSession();
andThen(function() {
visit('/patients/1');
});
andThen(function() {
assert.equal(currentRouteName(), 'patients.show.index', "Current route is patients.show.index");
});
});
test('test 2', function(assert) {
authenticateSession();
andThen(function() {
visit('/invoices/1');
});
andThen(function() {
assert.equal(currentRouteName(), 'invoices.show.index', "Current route is invoices.show.index");
});
});
Have you tried using the reorder
config option?
<script>
// after you include QUnit...
QUnit.config.reorder = false;
</script>