From 7bbd2314d2eae1d4072676dd9e3b9fe7d75bd3b6 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Fri, 19 Jan 2018 11:15:11 +0100 Subject: [PATCH] Fix e2e test hooks that made e2e tests flaky --- test/e2e/step_definitions/hooks.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/e2e/step_definitions/hooks.js b/test/e2e/step_definitions/hooks.js index 0fd0d04395b..ae5b0b5f0e8 100644 --- a/test/e2e/step_definitions/hooks.js +++ b/test/e2e/step_definitions/hooks.js @@ -37,6 +37,10 @@ function takeScreenshot(screnarioSlug, callback) { } defineSupportCode(({ Before, After, registerListener }) => { + Before('@pending', (scenario, callback) => { + callback(null, 'pending'); + }); + Before((scenario, callback) => { browser.ignoreSynchronization = true; browser.driver.manage().window() @@ -44,12 +48,7 @@ defineSupportCode(({ Before, After, registerListener }) => { browser.get(browser.params.baseURL); localStorage.clear(); localStorage.setItem('showNetwork', 'true'); - browser.get(browser.params.baseURL); - callback(); - }); - - Before('@pending', (scenario, callback) => { - callback(null, 'pending'); + browser.get(browser.params.baseURL).then(callback); }); After((scenario, callback) => {