Skip to content
Snippets Groups Projects
Commit 023dcf2b authored by Martin Schoeler's avatar Martin Schoeler
Browse files

try to make tests more stable

parent 63f076bd
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
describe('Admin settings', () => {
before(() => {
checkIfUserIsAdmin(adminUsername, adminEmail, adminPassword);
sideNav.getChannelFromList('general').waitForExist(5000);
sideNav.getChannelFromList('general').waitForVisible(5000);
sideNav.openChannel('general');
sideNav.accountBoxUserName.waitForVisible(5000);
sideNav.accountBoxUserName.click();
......@@ -192,13 +192,7 @@ describe('Admin settings', () => {
});
it('try to use @all and should be warned by rocket.cat ', () => {
mainContent.addTextToInput('@all');
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');
mainContent.tryToMentionAll();
});
it.skip('should not be able to delete own message ', () => {
......
......@@ -114,6 +114,17 @@ class MainContent extends Page {
}, 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.
selectAction(action) {
switch (action) {
......
......@@ -6,7 +6,7 @@ class SideNav extends Page {
get channelType() { return browser.element('label[for="channel-type"]'); }
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 messageInput() { return browser.element('.input-message'); }
......@@ -56,8 +56,9 @@ class SideNav extends Page {
this.newChannelBtn.waitForVisible(10000);
this.newChannelBtn.click();
this.channelName.waitForVisible(10000);
this.channelName.setValue('');
this.channelName.addValue(channelName);
//workaround for incomplete setvalue bug
this.channelName.setValue(channelName);
this.channelName.setValue(channelName);
browser.pause(1000);
this.channelType.waitForVisible(10000);
if (isPrivate) {
......@@ -93,9 +94,8 @@ class SideNav extends Page {
this.newDirectMessageBtn.click();
this.directMessageTarget.waitForVisible(3000);
this.directMessageTarget.setValue(user);
browser.waitForVisible('.-autocomplete-item', 3000);
browser.waitForVisible('.-autocomplete-item', 5000);
browser.click('.-autocomplete-item');
browser.pause(200);
this.saveDirectMessageBtn.click();
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