From 2e5f9a3e6764958ec0efdf8743c436efcde1e003 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 15 Dec 2017 12:22:49 -0200 Subject: [PATCH] Fix test without oplog by waiting a successful login on changing users --- .meteor/versions | 1 + tests/chimp-config.js | 2 +- tests/data/checks.js | 4 ++-- tests/pageobjects/login.page.js | 7 +++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.meteor/versions b/.meteor/versions index 56325d854e47..e05002989288 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -64,6 +64,7 @@ jquery@1.11.10 kadira:blaze-layout@2.3.0 kadira:flow-router@2.12.1 keepnox:perfect-scrollbar@0.6.8 +kenton:accounts-sandstorm@0.7.0 konecty:change-case@2.3.0 konecty:delayed-task@1.0.0 konecty:mongo-counter@0.0.5_3 diff --git a/tests/chimp-config.js b/tests/chimp-config.js index 5e01594a635f..d03dcfc8273a 100644 --- a/tests/chimp-config.js +++ b/tests/chimp-config.js @@ -27,7 +27,7 @@ module.exports = { // chai: false, screenshotsOnError: true, screenshotsPath: '.screenshots', - captureAllStepScreenshots: true, + captureAllStepScreenshots: false, saveScreenshotsToDisk: true, // // Note: With a large viewport size and captureAllStepScreenshots enabled, // // you may run out of memory. Use browser.setViewportSize to make the diff --git a/tests/data/checks.js b/tests/data/checks.js index 0122d9948338..b187bc273880 100644 --- a/tests/data/checks.js +++ b/tests/data/checks.js @@ -44,7 +44,7 @@ export function checkIfUserIsValid(username, email, password) { sideNav.logout.click(); loginPage.open(); - loginPage.login({email, password}); + loginPage.loginSucceded({email, password}); mainContent.mainContent.waitForExist(5000); } else { console.log(' User already logged'); @@ -77,7 +77,7 @@ export function checkIfUserIsAdmin(username, email, password) { sideNav.logout.click(); loginPage.open(); - loginPage.login({email, password}); + loginPage.loginSucceded({email, password}); } else { console.log(' User already logged'); } diff --git a/tests/pageobjects/login.page.js b/tests/pageobjects/login.page.js index e0150d40a15a..318970150b14 100644 --- a/tests/pageobjects/login.page.js +++ b/tests/pageobjects/login.page.js @@ -1,4 +1,5 @@ import Page from './Page'; +import mainContent from './main-content.page'; class LoginPage extends Page { get registerButton() { return browser.element('button.register'); } @@ -66,6 +67,12 @@ class LoginPage extends Page { this.submit(); } + loginSucceded({email, password}) { + this.login({email, password}); + + mainContent.mainContent.waitForVisible(5000); + } + submit() { this.submitButton.waitForVisible(5000); this.submitButton.click();