Skip to content
Snippets Groups Projects
Commit f7b6474a authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5798 from RocketChat/increase-tests-stability

Make tests more stable
parents 7b4307fc 0285c322
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ import {username, email, password, adminUsername, adminEmail, adminPassword} fro ...@@ -14,7 +14,7 @@ import {username, email, password, adminUsername, adminEmail, adminPassword} fro
describe('Admin settings', () => { describe('Admin settings', () => {
before(() => { before(() => {
checkIfUserIsAdmin(adminUsername, adminEmail, adminPassword); checkIfUserIsAdmin(adminUsername, adminEmail, adminPassword);
sideNav.getChannelFromList('general').waitForExist(5000); sideNav.getChannelFromList('general').waitForVisible(5000);
sideNav.openChannel('general'); sideNav.openChannel('general');
sideNav.accountBoxUserName.waitForVisible(5000); sideNav.accountBoxUserName.waitForVisible(5000);
sideNav.accountBoxUserName.click(); sideNav.accountBoxUserName.click();
...@@ -192,13 +192,7 @@ describe('Admin settings', () => { ...@@ -192,13 +192,7 @@ describe('Admin settings', () => {
}); });
it('try to use @all and should be warned by rocket.cat ', () => { it('try to use @all and should be warned by rocket.cat ', () => {
mainContent.addTextToInput('@all'); mainContent.tryToMentionAll();
mainContent.mentionAllPopUp.waitForVisible(5000);
mainContent.mentionAllPopUp.click();
mainContent.mentionAllPopUp.waitForVisible(5000, true);
mainContent.sendBtn.click();
mainContent.waitForLastMessageEqualsText('Notify all in this room is not allowed');
mainContent.lastMessage.getText().should.equal('Notify all in this room is not allowed');
}); });
it.skip('should not be able to delete own message ', () => { it.skip('should not be able to delete own message ', () => {
......
...@@ -114,6 +114,17 @@ class MainContent extends Page { ...@@ -114,6 +114,17 @@ class MainContent extends Page {
}, 2000); }, 2000);
} }
tryToMentionAll() {
this.addTextToInput('@all');
this.mentionAllPopUp.waitForVisible(5000);
browser.pause(100);
this.mentionAllPopUp.click();
this.mentionAllPopUp.waitForVisible(5000, true);
this.sendBtn.click();
this.waitForLastMessageEqualsText('Notify all in this room is not allowed');
this.lastMessage.getText().should.equal('Notify all in this room is not allowed');
}
//do one of the message actions, based on the "action" parameter inserted. //do one of the message actions, based on the "action" parameter inserted.
selectAction(action) { selectAction(action) {
switch (action) { switch (action) {
......
...@@ -6,7 +6,7 @@ class SideNav extends Page { ...@@ -6,7 +6,7 @@ class SideNav extends Page {
get channelType() { return browser.element('label[for="channel-type"]'); } get channelType() { return browser.element('label[for="channel-type"]'); }
get channelReadOnly() { return browser.element('label[for="channel-ro"]'); } get channelReadOnly() { return browser.element('label[for="channel-ro"]'); }
get channelName() { return browser.element('#channel-name'); } get channelName() { return browser.element('input#channel-name'); }
get saveChannelBtn() { return browser.element('.save-channel'); } get saveChannelBtn() { return browser.element('.save-channel'); }
get messageInput() { return browser.element('.input-message'); } get messageInput() { return browser.element('.input-message'); }
...@@ -56,8 +56,9 @@ class SideNav extends Page { ...@@ -56,8 +56,9 @@ class SideNav extends Page {
this.newChannelBtn.waitForVisible(10000); this.newChannelBtn.waitForVisible(10000);
this.newChannelBtn.click(); this.newChannelBtn.click();
this.channelName.waitForVisible(10000); this.channelName.waitForVisible(10000);
this.channelName.setValue(''); //workaround for incomplete setvalue bug
this.channelName.addValue(channelName); this.channelName.setValue(channelName);
this.channelName.setValue(channelName);
browser.pause(1000); browser.pause(1000);
this.channelType.waitForVisible(10000); this.channelType.waitForVisible(10000);
if (isPrivate) { if (isPrivate) {
...@@ -93,9 +94,8 @@ class SideNav extends Page { ...@@ -93,9 +94,8 @@ class SideNav extends Page {
this.newDirectMessageBtn.click(); this.newDirectMessageBtn.click();
this.directMessageTarget.waitForVisible(3000); this.directMessageTarget.waitForVisible(3000);
this.directMessageTarget.setValue(user); this.directMessageTarget.setValue(user);
browser.waitForVisible('.-autocomplete-item', 3000); browser.waitForVisible('.-autocomplete-item', 5000);
browser.click('.-autocomplete-item'); browser.click('.-autocomplete-item');
browser.pause(200);
this.saveDirectMessageBtn.click(); this.saveDirectMessageBtn.click();
browser.waitForExist('[title="'+user+'"]', 5000); browser.waitForExist('[title="'+user+'"]', 5000);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment