Skip to content

Commit

Permalink
Merge pull request #9146 from RocketChat/fix-test-without-oplog
Browse files Browse the repository at this point in the history
Fix test without oplog by waiting a successful login on changing users
  • Loading branch information
rodrigok committed Dec 18, 2017
1 parent 54aab29 commit 55504c4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/chimp-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/data/checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
}
Expand Down
7 changes: 7 additions & 0 deletions tests/pageobjects/login.page.js
Original file line number Diff line number Diff line change
@@ -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'); }
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 55504c4

Please sign in to comment.