The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/tests/pageobjects/side-nav.page.js

177 lines
6.2 KiB

import Page from './Page';
class SideNav extends Page {
// New channel
8 years ago
get channelType() { return browser.element('.create-channel__content .rc-switch__button'); }
8 years ago
get channelReadOnly() { return browser.elements('.create-channel__switches .rc-switch__button').value[1]; }
8 years ago
get channelName() { return browser.element('.create-channel__content input[name="name"]'); }
get saveChannelBtn() { return browser.element('.rc-modal__content [data-button="create"]'); }
// Account box
getPopOverContent() { return browser.element('.rc-popover__content'); }
8 years ago
get accountBoxUserName() { return browser.element('.sidebar__account-username'); }
8 years ago
get accountBoxUserAvatar() { return browser.element('.sidebar__account .avatar-image'); }
8 years ago
get accountMenu() { return browser.element('.sidebar__account'); }
7 years ago
get sidebarHeader() { return browser.element('.sidebar__header'); }
7 years ago
get sidebarUserMenu() { return browser.element('.sidebar__header .avatar'); }
7 years ago
get sidebarMenu() { return browser.element('.sidebar__toolbar-button-icon--menu'); }
8 years ago
get popOverContent() { return browser.element('.rc-popover__content'); }
7 years ago
get statusOnline() { return browser.element('.rc-popover__item--online'); }
7 years ago
get statusAway() { return browser.element('.rc-popover__item--away'); }
7 years ago
get statusBusy() { return browser.element('.rc-popover__item--busy'); }
7 years ago
get statusOffline() { return browser.element('.rc-popover__item--offline'); }
8 years ago
get account() { return browser.element('[data-id="account"][data-type="open"]'); }
8 years ago
get admin() { return browser.element('[data-id="administration"][data-type="open"]'); }
8 years ago
get logout() { return browser.element('[data-id="logout"][data-type="open"]'); }
get sideNavBar() { return browser.element('.sidebar'); }
// Toolbar
7 years ago
get spotlightSearchIcon() { return browser.element('.sidebar__toolbar-button-icon--magnifier'); }
8 years ago
get spotlightSearch() { return browser.element('.toolbar__search input'); }
8 years ago
get spotlightSearchPopUp() { return browser.element('.rooms-list__toolbar-search'); }
get newChannelBtnToolbar() { return browser.element('.sidebar__toolbar-button-icon--edit-rounded'); }
get newChannelBtn() { return browser.element('.rc-popover__icon-element--hashtag'); }
get newDiscussionBtn() { return browser.element('.rc-popover__icon-element--discussion'); }
8 years ago
get newChannelIcon() { return browser.element('.toolbar__icon.toolbar__search-create-channel'); }
// Rooms List
8 years ago
get general() { return this.getChannelFromList('general'); }
get channelLeave() { return browser.element('.leave-room'); }
get channelHoverIcon() { return browser.element('.rooms-list > .wrapper > ul [title="general"] .icon-eye-off'); }
get moreChannels() { return browser.element('.rooms-list .more-channels'); }
// Account
get preferences() { return browser.element('[href="/account/preferences"]'); }
get profile() { return browser.element('[href="/account/profile"]'); }
get avatar() { return browser.element('[href="/changeavatar"]'); }
[NEW] Header Redesign (#7750) * Rc main content header work in progress * header redesign work in progress * Clean up some css and fix burger * Fix reviews * Apply the new header to some admin pages * Start using typography on fonts * add the new header to more pages * add more new headers * Fix admin buttons * add the new header to the account screens and fix some flexs * fix profile header and use new burger * Add favorite star fill * allign preferences contents to center * Put description under the title * fix overflow on channel topic and title * start making the header a component * move channel header template to the new one and fix burger menu * Make the header a modular component * fix some buttons on integrations * add channel icons and fix star fill * fix line height and css lint * add livechat icon * fix part of the tests * fix tests * add a max-width to header * hide room image on channels * Fix reviews and some issues with firefox also remove a console.log() * fix mobile max width * Fix Reviews reduce some elements and try to improve the naming of elements * Fix realNames on Header * [FIX] After deleting the room, cache is not synchronizing * Put delete action on another popover group * check if user can delete * [FIX] Email Subjects not being sent * fix on android * fix for ios * Tab Bar Icons moved to header * remove sidebar header on admin embedded version * fix lint issue * remove console.log * contextual bar header * remove last activity * Update meteor to 1.5.2.2-rc.0 * Fix missing i18n translations * fix header on administration * migration 101 * fix admin view header * remove accountBox from admin menu * add sidebar flex title and icons * smaller accountBox * Fix some tests and skip others skipping due some features that need fixing * Update sidebarItem.html * unify unread and mentions badge * make sidebar item width 100% * fixed tests * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --all-packages * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --release 1.5.2.2 * [FIX] Vairous LDAP issues & add pagination * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * contextual-bar template * fix stylelinty * fix icons
8 years ago
get preferencesClose() { return browser.element('.sidebar-flex__close-button[data-action="close"]'); }
get burgerBtn() { return browser.element('.burger'); }
get sidebarWrap() { return browser.element('.sidebar-wrap'); }
get firstSidebarItem() { return browser.element('.sidebar-item'); }
get firstSidebarItemMenu() { return browser.element('.sidebar-item__menu'); }
get popoverOverlay() { return browser.element('.rc-popover.rc-popover--sidebar-item'); }
// Opens a channel via rooms list
openChannel(channelName) {
browser.waitForVisible(`.sidebar-item__ellipsis=${ channelName }`, 10000);
browser.click(`.sidebar-item__ellipsis=${ channelName }`);
browser.waitForVisible('.js-input-message', 5000);
[NEW] Header Redesign (#7750) * Rc main content header work in progress * header redesign work in progress * Clean up some css and fix burger * Fix reviews * Apply the new header to some admin pages * Start using typography on fonts * add the new header to more pages * add more new headers * Fix admin buttons * add the new header to the account screens and fix some flexs * fix profile header and use new burger * Add favorite star fill * allign preferences contents to center * Put description under the title * fix overflow on channel topic and title * start making the header a component * move channel header template to the new one and fix burger menu * Make the header a modular component * fix some buttons on integrations * add channel icons and fix star fill * fix line height and css lint * add livechat icon * fix part of the tests * fix tests * add a max-width to header * hide room image on channels * Fix reviews and some issues with firefox also remove a console.log() * fix mobile max width * Fix Reviews reduce some elements and try to improve the naming of elements * Fix realNames on Header * [FIX] After deleting the room, cache is not synchronizing * Put delete action on another popover group * check if user can delete * [FIX] Email Subjects not being sent * fix on android * fix for ios * Tab Bar Icons moved to header * remove sidebar header on admin embedded version * fix lint issue * remove console.log * contextual bar header * remove last activity * Update meteor to 1.5.2.2-rc.0 * Fix missing i18n translations * fix header on administration * migration 101 * fix admin view header * remove accountBox from admin menu * add sidebar flex title and icons * smaller accountBox * Fix some tests and skip others skipping due some features that need fixing * Update sidebarItem.html * unify unread and mentions badge * make sidebar item width 100% * fixed tests * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --all-packages * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --release 1.5.2.2 * [FIX] Vairous LDAP issues & add pagination * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * contextual-bar template * fix stylelinty * fix icons
8 years ago
browser.waitForVisible('.rc-header', 5000);
9 years ago
browser.waitUntil(function() {
[NEW] Header Redesign (#7750) * Rc main content header work in progress * header redesign work in progress * Clean up some css and fix burger * Fix reviews * Apply the new header to some admin pages * Start using typography on fonts * add the new header to more pages * add more new headers * Fix admin buttons * add the new header to the account screens and fix some flexs * fix profile header and use new burger * Add favorite star fill * allign preferences contents to center * Put description under the title * fix overflow on channel topic and title * start making the header a component * move channel header template to the new one and fix burger menu * Make the header a modular component * fix some buttons on integrations * add channel icons and fix star fill * fix line height and css lint * add livechat icon * fix part of the tests * fix tests * add a max-width to header * hide room image on channels * Fix reviews and some issues with firefox also remove a console.log() * fix mobile max width * Fix Reviews reduce some elements and try to improve the naming of elements * Fix realNames on Header * [FIX] After deleting the room, cache is not synchronizing * Put delete action on another popover group * check if user can delete * [FIX] Email Subjects not being sent * fix on android * fix for ios * Tab Bar Icons moved to header * remove sidebar header on admin embedded version * fix lint issue * remove console.log * contextual bar header * remove last activity * Update meteor to 1.5.2.2-rc.0 * Fix missing i18n translations * fix header on administration * migration 101 * fix admin view header * remove accountBox from admin menu * add sidebar flex title and icons * smaller accountBox * Fix some tests and skip others skipping due some features that need fixing * Update sidebarItem.html * unify unread and mentions badge * make sidebar item width 100% * fixed tests * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --all-packages * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --release 1.5.2.2 * [FIX] Vairous LDAP issues & add pagination * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * contextual-bar template * fix stylelinty * fix icons
8 years ago
browser.waitForVisible('.rc-header__name', 8000);
return browser.getText('.rc-header__name') === channelName;
}, 10000);
}
// Opens a channel via spotlight search
searchChannel(channelName) {
[NEW] Header Redesign (#7750) * Rc main content header work in progress * header redesign work in progress * Clean up some css and fix burger * Fix reviews * Apply the new header to some admin pages * Start using typography on fonts * add the new header to more pages * add more new headers * Fix admin buttons * add the new header to the account screens and fix some flexs * fix profile header and use new burger * Add favorite star fill * allign preferences contents to center * Put description under the title * fix overflow on channel topic and title * start making the header a component * move channel header template to the new one and fix burger menu * Make the header a modular component * fix some buttons on integrations * add channel icons and fix star fill * fix line height and css lint * add livechat icon * fix part of the tests * fix tests * add a max-width to header * hide room image on channels * Fix reviews and some issues with firefox also remove a console.log() * fix mobile max width * Fix Reviews reduce some elements and try to improve the naming of elements * Fix realNames on Header * [FIX] After deleting the room, cache is not synchronizing * Put delete action on another popover group * check if user can delete * [FIX] Email Subjects not being sent * fix on android * fix for ios * Tab Bar Icons moved to header * remove sidebar header on admin embedded version * fix lint issue * remove console.log * contextual bar header * remove last activity * Update meteor to 1.5.2.2-rc.0 * Fix missing i18n translations * fix header on administration * migration 101 * fix admin view header * remove accountBox from admin menu * add sidebar flex title and icons * smaller accountBox * Fix some tests and skip others skipping due some features that need fixing * Update sidebarItem.html * unify unread and mentions badge * make sidebar item width 100% * fixed tests * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --all-packages * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --release 1.5.2.2 * [FIX] Vairous LDAP issues & add pagination * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * contextual-bar template * fix stylelinty * fix icons
8 years ago
browser.waitForVisible('.rc-header', 15000);
if (browser.isVisible('.rc-header__name')) {
if (channelName === browser.element('.rc-header__name').getText()) {
return;
}
}
this.spotlightSearch.waitForVisible(5000);
this.spotlightSearch.click();
this.spotlightSearch.setValue(channelName);
browser.waitForVisible(`[aria-label='${ channelName }']`, 5000);
browser.click(`[aria-label='${ channelName }']`);
browser.waitForVisible('.rc-header__name', 8000);
browser.waitUntil(function() {
return browser.getText('.rc-header__name') === channelName;
}, 10000);
}
// Gets a channel from the spotlight search
getChannelFromSpotlight(channelName) {
[NEW] Header Redesign (#7750) * Rc main content header work in progress * header redesign work in progress * Clean up some css and fix burger * Fix reviews * Apply the new header to some admin pages * Start using typography on fonts * add the new header to more pages * add more new headers * Fix admin buttons * add the new header to the account screens and fix some flexs * fix profile header and use new burger * Add favorite star fill * allign preferences contents to center * Put description under the title * fix overflow on channel topic and title * start making the header a component * move channel header template to the new one and fix burger menu * Make the header a modular component * fix some buttons on integrations * add channel icons and fix star fill * fix line height and css lint * add livechat icon * fix part of the tests * fix tests * add a max-width to header * hide room image on channels * Fix reviews and some issues with firefox also remove a console.log() * fix mobile max width * Fix Reviews reduce some elements and try to improve the naming of elements * Fix realNames on Header * [FIX] After deleting the room, cache is not synchronizing * Put delete action on another popover group * check if user can delete * [FIX] Email Subjects not being sent * fix on android * fix for ios * Tab Bar Icons moved to header * remove sidebar header on admin embedded version * fix lint issue * remove console.log * contextual bar header * remove last activity * Update meteor to 1.5.2.2-rc.0 * Fix missing i18n translations * fix header on administration * migration 101 * fix admin view header * remove accountBox from admin menu * add sidebar flex title and icons * smaller accountBox * Fix some tests and skip others skipping due some features that need fixing * Update sidebarItem.html * unify unread and mentions badge * make sidebar item width 100% * fixed tests * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --all-packages * LingoHub Update :rocket: Manual push by LingoHub User: Gabriel Engel. Project: Rocket.Chat Made with :heart: by https://lingohub.com * meteor update --release 1.5.2.2 * [FIX] Vairous LDAP issues & add pagination * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * LingoHub Update :rocket: Manual push by LingoHub User: Rodrigo Nascimento. Project: Rocket.Chat Made with :heart: by https://lingohub.com * contextual-bar template * fix stylelinty * fix icons
8 years ago
let currentRoom;
browser.waitForVisible('.rc-header', 15000);
if (browser.isVisible('.rc-header__name')) {
currentRoom = browser.element('.rc-header__name').getText();
}
currentRoom = browser.element('.rc-header__name').getText();
8 years ago
console.log(currentRoom, channelName);
if (currentRoom !== channelName) {
this.spotlightSearch.waitForVisible(5000);
this.spotlightSearch.click();
this.spotlightSearch.setValue(channelName);
8 years ago
browser.waitForVisible(`.sidebar-item__name=${ channelName }`, 5000);
return browser.element(`.sidebar-item__name=${ channelName }`);
}
}
// Gets a channel from the rooms list
getChannelFromList(channelName, reverse) {
if (reverse == null) {
8 years ago
browser.waitForVisible(`.sidebar-item__name=${ channelName }`, 5000);
}
8 years ago
return browser.element(`.sidebar-item__name=${ channelName }`);
}
createChannel(channelName, isPrivate, /* isReadOnly*/) {
this.newChannelBtnToolbar.waitForVisible(10000);
this.newChannelBtnToolbar.click();
this.newChannelBtn.waitForVisible(10000);
this.newChannelBtn.click();
this.channelName.waitForVisible(10000);
// workaround for incomplete setvalue bug
this.channelName.setValue(channelName);
8 years ago
browser.waitUntil(function() {
return browser.isEnabled('.rc-modal__content [data-button="create"]');
8 years ago
}, 5000);
this.channelType.waitForVisible(10000);
if (isPrivate) {
this.channelType.click();
}
8 years ago
// if (isReadOnly) {
// this.channelReadOnly.click();
// }
browser.pause(500);
this.saveChannelBtn.click();
8 years ago
// this.channelType.waitForVisible(5000, true);
browser.pause(500);
}
}
9 years ago
module.exports = new SideNav();