added more tests to the spotlight

pull/5875/head
Martin Schoeler 9 years ago
parent 5cbf63350e
commit 2bc7cc0c95
  1. 37
      tests/end-to-end/ui/04-main-elements-render.js
  2. 46
      tests/end-to-end/ui/09-channel.js
  3. 7
      tests/pageobjects/global.js
  4. 1
      tests/pageobjects/main-content.page.js
  5. 1
      tests/pageobjects/side-nav.page.js

@ -54,6 +54,43 @@ describe('Main Elements Render', function() {
sideNav.channelHoverIcon.isVisible().should.be.true;
});
});
describe('spotlight search render', () => {
it('should show spotlight search bar', () => {
sideNav.spotlightSearch.isVisible().should.be.true;
});
it('should click the spotlight and show the channel list', () => {
sideNav.spotlightSearch.waitForVisible(5000);
sideNav.spotlightSearch.click();
sideNav.spotlightSearchPopUp.waitForVisible(5000);
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
});
it('when the spotlight loses focus the list should disappear', () => {
sideNav.spotlightSearchPopUp.waitForVisible(5000);
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
mainContent.messageInput.click();
sideNav.spotlightSearchPopUp.waitForVisible(5000, true);
sideNav.spotlightSearchPopUp.isVisible().should.be.false;
});
it('should add text to the spotlight and show the channel list', () => {
sideNav.spotlightSearch.waitForVisible(5000);
sideNav.spotlightSearch.setValue('rocket.cat');
sideNav.spotlightSearchPopUp.waitForVisible(5000);
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
});
it('the text on the spotlight and the list should disappear when lost focus', () => {
sideNav.spotlightSearchPopUp.waitForVisible(5000);
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
mainContent.messageInput.click();
sideNav.spotlightSearchPopUp.waitForVisible(5000, true);
sideNav.spotlightSearchPopUp.isVisible().should.be.false;
sideNav.spotlightSearch.getText().should.equal('');
});
});
});
describe('user options', () => {

@ -337,6 +337,45 @@ describe('channel', ()=> {
});
});
describe('channel quit and enter', () => {
it('leave the channel', () => {
let channel = sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName);
channel.click();
channel.moveToObject();
sideNav.channelLeave.waitForVisible(5000);
sideNav.channelLeave.click();
Global.sweetAlert.waitForVisible(5000);
});
it('should show the sweet alert popup', () => {
Global.sweetAlert.waitForVisible(5000);
Global.sweetAlert.isVisible().should.be.true;
Global.sweetAlertConfirm.isVisible().should.be.true;
});
it('should close the popup', () => {
Global.confirmPopup();
});
it('should not show the channel on the list', () => {
sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName).waitForVisible(5000, true);
sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName).isVisible().should.be.false;
});
it('should search and enter the channel with the spotlight', () => {
sideNav.searchChannel('NAME-EDITED-'+publicChannelName);
mainContent.joinChannelBtn.waitForVisible(5000);
mainContent.joinChannelBtn.click();
});
it('should show the channel on the list', () => {
sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName).waitForVisible(10000);
sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName).isVisible().should.be.true;
});
});
describe.skip('User muted', () => {
before(()=> {
flexTab.membersTab.waitForVisible(5000);
@ -356,13 +395,8 @@ describe('channel', ()=> {
flexTab.confirmPopup();
});
});
});
it.skip('leave the channel', () => {
let channel = sideNav.getChannelFromList('NAME-EDITED-'+publicChannelName);
channel.moveToObject();
sideNav.channelLeave.waitForVisible(5000);
sideNav.channelLeave.click();
});
});
});

@ -4,6 +4,13 @@ class Global {
get sweetAlertConfirm() { return browser.element('.sweet-alert .sa-confirm-button-container'); }
get sweetAlertPasswordField() { return browser.element('.sweet-alert [type="password"]'); }
get toastAlert() { return browser.element('.toast'); }
confirmPopup() {
this.sweetAlertConfirm.waitForVisible(5000);
browser.pause(1000);
this.sweetAlertConfirm.click();
this.sweetAlert.waitForVisible(5000, true);
}
}
module.exports = new Global();

@ -64,6 +64,7 @@ class MainContent extends Page {
get messagePopUpItems() { return browser.element('.message-popup-items'); }
get messagePopUpFirstItem() { return browser.element('.popup-item.selected'); }
get mentionAllPopUp() { return browser.element('.popup-item[data-id="all"]'); }
get joinChannelBtn() { return browser.element('.button.join'); }
sendMessage(text) {
this.setTextToInput(text);

@ -35,6 +35,7 @@ class SideNav extends Page {
get avatar() { return browser.element('.account-link:nth-of-type(3)'); }
get preferencesClose() { return browser.element('.side-nav .arrow.close'); }
get spotlightSearch() { return browser.element('.toolbar-search__input'); }
get spotlightSearchPopUp() { return browser.element('.toolbar .message-popup'); }
get channelLeave() { return browser.element('.leave-room'); }
openChannel(channelName) {

Loading…
Cancel
Save