From 2e5c2e623368a0a4e64680b88e298a385b5cce1c Mon Sep 17 00:00:00 2001 From: Craig Nishina Date: Thu, 24 Jan 2019 16:58:30 -0800 Subject: [PATCH] chore(jasmine): prevent random execution order in jasmine 3 (#5126) --- lib/frameworks/jasmine.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/frameworks/jasmine.js b/lib/frameworks/jasmine.js index beac77520..821c12028 100644 --- a/lib/frameworks/jasmine.js +++ b/lib/frameworks/jasmine.js @@ -69,6 +69,12 @@ exports.run = async function(runner, specs) { const reporter = new RunnerReporter(runner); jasmine.getEnv().addReporter(reporter); + // Jasmine 3 allows for tests to be in random order by default. This does not + // work well with e2e tests where the browser state is determined by the + // order of the tests. Setting to false will prevent random execution. + // See https://jasmine.github.io/api/3.3/Env.html + jasmine.getEnv().randomizeTests(false); + // Add hooks for afterEach require('./setupAfterEach').setup(runner, specs);