Skip to content

Commit

Permalink
fix message popup test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vickyokrm committed Mar 1, 2019
1 parent 1786102 commit caed703
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions tests/end-to-end/ui/14-message-popup.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { adminEmail, adminPassword } from '../../data/user.js';

/* eslint-env mocha */
import {
api,
request,
getCredentials,
credentials,
} from '../../data/api-data.js';
import loginPage from '../../pageobjects/login.page';
import sideNav from '../../pageobjects/side-nav.page';
import mainContent from '../../pageobjects/main-content.page';

import { username, password, email } from '../../data/user.js';
import { checkIfUserIsValid } from '../../data/checks';

const users = new Array(10).fill(null)
.map(() => `${ Date.now() }.${ Math.random().toString(36).slice(2) }`)
.map((uniqueId, i) => ({
Expand Down Expand Up @@ -64,22 +65,16 @@ const createTestUser = async({ email, name, username, password, isMentionable })
describe('[Message Popup]', () => {
describe('test user mentions in message popup', () => {
before(() => {
browser.executeAsync((done) => {
const user = Meteor.user();
if (!user) {
return done();
}
Meteor.logout(done);
});

browser.call(async() => {
for (const user of users) {
await createTestUser(user);
}
});

loginPage.open();
loginPage.login({ email: adminEmail, password: adminPassword });
checkIfUserIsValid(username, email, password);

sideNav.openChannel('general');

sideNav.general.waitForVisible(5000);
sideNav.general.click();
Expand Down

0 comments on commit caed703

Please sign in to comment.