Merge remote-tracking branch 'origin/color-variables' into color-variables

pull/7748/head
Guilherme Gazzo 8 years ago
commit 7200238a99
  1. 2
      packages/rocketchat-livechat/client/views/sideNav/livechatFlex.html
  2. 1
      packages/rocketchat-theme/client/imports/components/main-content.css
  3. 1
      packages/rocketchat-theme/client/imports/components/sidebar.css
  4. 9
      packages/rocketchat-theme/client/imports/general/base_old.css
  5. 2
      packages/rocketchat-ui-account/client/accountFlex.html
  6. 8
      packages/rocketchat-ui-account/client/accountProfile.html
  7. 2
      packages/rocketchat-ui-account/client/accountProfile.js
  8. 4
      packages/rocketchat-ui-admin/client/adminFlex.html
  9. 10
      packages/rocketchat-ui-message/client/messageBox.html
  10. 4
      packages/rocketchat-ui-message/client/messageBox.js
  11. 10
      packages/rocketchat-ui-sidenav/client/accountBox.html
  12. 2
      packages/rocketchat-ui-sidenav/client/sidebarItem.html
  13. 6
      packages/rocketchat-ui-sidenav/client/toolbar.html
  14. 2
      packages/rocketchat-ui/client/components/selectDropdown.html
  15. 4
      packages/rocketchat-ui/client/lib/menu.js
  16. 8
      packages/rocketchat-ui/client/views/app/createChannel.html
  17. 2
      packages/rocketchat-ui/client/views/app/fullModal.html
  18. 55
      tests/end-to-end/ui/04-main-elements-render.js
  19. 2
      tests/end-to-end/ui/06-messaging.js
  20. 4
      tests/end-to-end/ui/08-resolutions.js
  21. 7
      tests/end-to-end/ui/09-channel.js
  22. 16
      tests/end-to-end/ui/10-user-preferences.js
  23. 2
      tests/end-to-end/ui/12-settings.js
  24. 16
      tests/pageobjects/administration.page.js
  25. 9
      tests/pageobjects/main-content.page.js
  26. 9
      tests/pageobjects/preferences-main-content.page.js
  27. 77
      tests/pageobjects/side-nav.page.js

@ -4,7 +4,7 @@
{{> accountBox lighten=true }}
<button class="sidebar-flex__back-button sidebar-flex-content-active" data-action="back">
<svg class="sidebar-flex__back-icon">
<use href="#icon-arrow-back"></use>
<use xlink:href="#icon-arrow-back"></use>
</svg>
<span>Back to chat</span>
</button>

@ -2,6 +2,7 @@
flex: 1 1 100%;
z-index: 0 !important;
position: relative;
height: 100%;
}
@media (width <= 780px) {

@ -18,6 +18,7 @@
z-index: 2;
position: relative;
transition: transform 0.3s;
height: 100%;
&--flex {
position: absolute;

@ -1559,13 +1559,6 @@
/* MAIN CONTENT + MAIN PAGES */
.rc-old.main-content {
/* top: 0;
bottom: 0;
left: var(--rooms-box-width);
right: 0;
width: auto;
height: auto; */
&.main-modal {
left: 0;
margin-right: 0;
@ -2934,7 +2927,7 @@ body:not(.is-cordova) {
position: relative;
display: none;
width: var(--flex-tab-width);
height: calc(100% - 61px);
height: calc(100vh - 61px);
overflow-x: visible;
& .control {

@ -4,7 +4,7 @@
{{> accountBox lighten=true }}
<button class="sidebar-flex__back-button sidebar-flex-content-active" data-action="back">
<svg class="sidebar-flex__back-icon">
<use href="#icon-arrow-back"></use>
<use xlink:href="#icon-arrow-back"></use>
</svg>
<span>Back to chat</span>
</button>

@ -6,7 +6,7 @@
{{#if service}}
<div class="rc-select-avatar__upload-label avatar">
<svg class="rc-select-avatar__upload-icon">
<use href="#icon-{{name.toLowerCase}}"></use>
<use xlink:href="#icon-{{name.toLowerCase}}"></use>
</svg>
</div>
{{/if}}
@ -45,7 +45,7 @@
<div class="rc-select-avatar__list-item rc-tooltip js-select-avatar-upload" aria-label="upload file">
<label class="rc-select-avatar__upload-label avatar" for="upload-avatar">
<svg class="rc-select-avatar__upload-icon">
<use href="#icon-upload"></use>
<use xlink:href="#icon-upload"></use>
</svg>
</label>
<input type="file" name="" value="" id="upload-avatar" style="display:none;">
@ -77,7 +77,7 @@
<div class="rc-input__wrapper">
<div class="rc-input__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--at">
<use href="#icon-at"></use>
<use xlink:href="#icon-at"></use>
</svg>
</div>
<input type="text" class="rc-input__element" name="username" id="username" value="{{username}}" {{ifThenElse canChange '' 'disabled'}}>
@ -90,7 +90,7 @@
<div class="rc-input__error">
<div class="rc-input__error-icon">
<svg class="rc-input__error-icon-svg rc-input__error-icon--warning">
<use href="#icon-warning"></use>
<use xlink:href="#icon-warning"></use>
</svg>
</div>
<div class="rc-input__error-message">{{_ "Username_already_exist"}}</div>

@ -7,7 +7,7 @@ const validateUsername = (username) => {
const validateName = (name) => name.length;
const filterNames = (old) => {
const reg = new RegExp(`^${ RocketChat.settings.get('UTF8_Names_Validation') }$`);
return [...old.replace(' ', '').toLocaleLowerCase()].filter(f => reg.test(f)).splice(0, 25).join('');
return [...old.replace(' ', '').toLocaleLowerCase()].filter(f => reg.test(f)).join('');
};
const filterEmail = (old) => {
return old.replace(' ', '');

@ -4,7 +4,7 @@
{{> accountBox lighten=true }}
<button class="sidebar-flex__back-button sidebar-flex-content-active" data-action="back">
<svg class="sidebar-flex__back-icon">
<use href="#icon-arrow-back"></use>
<use xlink:href="#icon-arrow-back"></use>
</svg>
<span>Back to chat</span>
</button>
@ -40,7 +40,7 @@
<div class="rc-input__wrapper">
<div class="rc-input__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--magnifier">
<use href="#icon-magnifier"></use>
<use xlink:href="#icon-magnifier"></use>
</svg>
</div>
<input type="text" class="rc-input__element rc-input__element--small" name="settings-search" placeholder="{{_ 'Search'}}">

@ -24,14 +24,14 @@
<div class="rc-message-box__container">
<div class="rc-message-box__icon emoji-picker-icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--smile">
<use href="#icon-smile"></use>
<use xlink:href="#icon-smile"></use>
</svg>
</div>
<textarea autofocus dir="auto" name="msg" maxlength="{{maxMessageLength}}" placeholder="{{_ 'Message'}}" rows="1" class="rc-message-box__textarea js-input-message autogrow-short"></textarea>
{{# if sendIcon}}
<div class="rc-message-box__icon js-send">
<svg class="rc-input__icon-svg rc-input__icon-svg--smile">
<use href="#icon-send"></use>
<use xlink:href="#icon-send"></use>
</svg>
</div>
{{else}}
@ -50,7 +50,7 @@
<span class="rc-popover__icon">
{{#if icon}}
<svg class="rc-popover__icon-element rc-popover__icon-element--{{icon}}">
<use href="#icon-{{icon}}"></use>
<use xlink:href="#icon-{{icon}}"></use>
</svg>
{{/if}}
</span>
@ -66,7 +66,7 @@
</div>
<div class="rc-message-box__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--plus">
<use href="#icon-plus"></use>
<use xlink:href="#icon-plus"></use>
</svg>
</div></label>
{{/if}}
@ -96,7 +96,7 @@
{{#each mdButtons}}
<button class="rc-message-box__toolbar-markdown-item rc-tooltip js-md" aria-label={{_ label}}>
<svg class="rc-message-box__toolbar-markdown-icon rc-message-box__toolbar-markdown-icon--{{label}}">
<use href="#icon-md-{{label}}"></use>
<use xlink:href="#icon-md-{{label}}"></use>
</svg>
</button>
{{/each}}

@ -1,11 +1,11 @@
/* globals fileUpload AudioRecorder KonchatNotification chatMessages */
/* globals fileUpload KonchatNotification chatMessages */
import toastr from 'toastr';
import mime from 'mime-type/with-db';
import moment from 'moment';
import {VRecDialog} from 'meteor/rocketchat:ui-vrecord';
//import {VRecDialog} from 'meteor/rocketchat:ui-vrecord';
function katexSyntax() {
if (RocketChat.katex.katex_enabled()) {

@ -38,7 +38,7 @@
{{#if icon}}
<span class="rc-popover__icon">
<svg class="rc-popover__icon-element rc-popover__icon-element--{{icon}}">
<use href="#icon-{{icon}}"></use>
<use xlink:href="#icon-{{icon}}"></use>
</svg>
</span>
{{/if}}
@ -49,7 +49,7 @@
<li class="rc-popover__item" data-action="open" data-open="administration">
<span class="rc-popover__icon">
<svg class="rc-popover__icon-element rc-popover__icon-element--customize">
<use href="#icon-customize"></use>
<use xlink:href="#icon-customize"></use>
</svg>
</span>
<span class="rc-popover__item-text">{{_ "Administration"}}</span>
@ -58,7 +58,7 @@
<li class="rc-popover__item" data-action="open" data-open="account">
<span class="rc-popover__icon">
<svg class="rc-popover__icon-element rc-popover__icon-element--user">
<use href="#icon-user"></use>
<use xlink:href="#icon-user"></use>
</svg>
</span>
<span class="rc-popover__item-text">{{_ "My_Account"}}</span>
@ -66,7 +66,7 @@
<li class="rc-popover__item" data-action="open" data-open="logout">
<span class="rc-popover__icon">
<svg class="rc-popover__icon-element rc-popover__icon-element--sign-out">
<use href="#icon-sign-out"></use>
<use xlink:href="#icon-sign-out"></use>
</svg>
</span>
<span class="rc-popover__item-text">{{_ "Logout"}}</span>
@ -79,7 +79,7 @@
<div class="sidebar__account-status-bullet {{bullet}}" title="{{visualStatus}}"></div>
<div class="sidebar__account-username">{{visualStatus}}</div>
<svg class="sidebar__account-arrow">
<use href="#icon-arrow-down"></use>
<use xlink:href="#icon-arrow-down"></use>
</svg>
</div>
</div>

@ -7,7 +7,7 @@
<div class="sidebar-item__picture">
{{#if icon}}
<svg class="sidebar-item__icon sidebar-item__icon--{{icon}}">
<use href="#icon-{{icon}}"></use>
<use xlink:href="#icon-{{icon}}"></use>
</svg>
{{else}}
{{#if avatar}}

@ -7,13 +7,13 @@
<div class="rc-input__wrapper">
<div class="rc-input__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--magnifier">
<use href="#icon-magnifier"></use>
<use xlink:href="#icon-magnifier"></use>
</svg>
</div>
<input type="text" class="rc-input__element rc-input__element--small" placeholder="{{getPlaceholder}}">
<div class="rc-input__icon rc-input__icon--right">
<svg class="rc-input__icon-svg rc-input__icon-svg--cross">
<use href="#icon-cross"></use>
<use xlink:href="#icon-cross"></use>
</svg>
</div>
</div>
@ -23,7 +23,7 @@
{{#if canCreate}}
<button class="rc-button rc-button--square rc-tooltip" aria-label="{{ _ 'Create_A_New_Channel' }}">
<svg class="toolbar__icon toolbar__search-create-channel">
<use href="#icon-plus"></use>
<use xlink:href="#icon-plus"></use>
</svg>
</button>
{{/if}}

@ -5,7 +5,7 @@
<div class="rc-input__wrapper">
<div class="rc-input__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--at">
<use href="#icon-at"></use>
<use xlink:href="#icon-at"></use>
</svg>
</div>
{{ selectedUsers }}

@ -3,10 +3,10 @@ const sideNavW = 280;
const map = (x, in_min, in_max, out_min, out_max) => (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
window.addEventListener('resize', _.debounce((() => {
let lastState = window.matchMedia('(min-width: 700px)').matches ? 'mini' : 'large';
let lastState = window.matchMedia('(min-width: 780px)').matches ? 'mini' : 'large';
RocketChat.emit('grid', lastState);
return () => {
const futureState = window.matchMedia('(min-width: 700px)').matches ? 'mini' : 'large';
const futureState = window.matchMedia('(min-width: 780px)').matches ? 'mini' : 'large';
if (lastState !== futureState) {
lastState = futureState;
RocketChat.emit('grid', lastState);

@ -38,7 +38,7 @@
<div class="rc-input__wrapper">
<div class="rc-input__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--{{iconType}}">
<use href="#icon-{{iconType}}"></use>
<use xlink:href="#icon-{{iconType}}"></use>
</svg>
</div>
<input name="name" type="text" class="rc-input__element" placeholder="Type channel name" autofocus>
@ -49,7 +49,7 @@
<div class="rc-input__error">
<div class="rc-input__error-icon">
<svg class="rc-input__error-icon-svg rc-input__error-icon--warning">
<use href="#icon-warning"></use>
<use xlink:href="#icon-warning"></use>
</svg>
</div>
<div class="rc-input__error-message">{{_ "Channel_already_exist_static"}}</div>
@ -62,7 +62,7 @@
<div class="rc-input__wrapper">
<div class="rc-input__icon">
<svg class="rc-input__icon-svg rc-input__icon-svg--at">
<use href="#icon-at"></use>
<use xlink:href="#icon-at"></use>
</svg>
</div>
<div class="rc-tags">
@ -96,7 +96,7 @@
</span>
<span class="rc-tags__tag-username">{{username}}</span>
<svg class="rc-tags__tag-icon">
<use href="#icon-cross"></use>
<use xlink:href="#icon-cross"></use>
</svg>
</span>
</template>

@ -4,7 +4,7 @@
<button class="full-modal__back-button sidebar-content">
<span class="full-modal__back-text">{{_ "Cancel"}}</span>
<svg class="full-modal__back-icon">
<use href="#icon-cross"></use>
<use xlink:href="#icon-cross"></use>
</svg>
</button>
{{> Template.dynamic template=template}}

@ -35,10 +35,6 @@ describe('[Main Elements Render]', function() {
sideNav.newChannelIcon.isVisible().should.be.true;
});
it('it should show the "More Channels" button', () => {
sideNav.moreChannels.isVisible().should.be.true;
});
it('it should show "general" channel', () => {
sideNav.general.isVisible().should.be.true;
});
@ -60,10 +56,11 @@ describe('[Main Elements Render]', function() {
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
});
it('it should remove the list when the spotlight loses focus', () => {
it.skip('it should remove the list when the spotlight loses focus', () => {
sideNav.spotlightSearchPopUp.waitForVisible(5000);
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
mainContent.messageInput.click();
mainContent.lastMessage.click();
sideNav.spotlightSearchPopUp.waitForVisible(5000, true);
sideNav.spotlightSearchPopUp.isVisible().should.be.false;
});
@ -75,7 +72,7 @@ describe('[Main Elements Render]', function() {
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
});
it('it should remove the text on the spotlight and the list when lost focus', () => {
it.skip('it should remove the text on the spotlight and the list when lost focus', () => {
sideNav.spotlightSearchPopUp.waitForVisible(5000);
sideNav.spotlightSearchPopUp.isVisible().should.be.true;
mainContent.messageInput.click();
@ -89,16 +86,12 @@ describe('[Main Elements Render]', function() {
describe('[User Options]', () => {
describe('render:', () => {
before(() => {
sideNav.accountBoxUserName.click();
sideNav.userOptions.waitForVisible(5000);
sideNav.accountStatus.click();
sideNav.popOverContent.waitForVisible(5000);
});
after(() => {
sideNav.accountBoxUserName.click();
});
it('it should show user options', () => {
sideNav.userOptions.isVisible().should.be.true;
sideNav.accountStatus.click();
});
it('it should show online button', () => {
@ -143,7 +136,7 @@ describe('[Main Elements Render]', function() {
mainContent.emptyFavoriteStar.isVisible().should.be.true;
});
it('it shouldclicks the star', () => {
it('it should click the star', () => {
mainContent.emptyFavoriteStar.click();
});
@ -159,46 +152,24 @@ describe('[Main Elements Render]', function() {
mainContent.messageInput.isVisible().should.be.true;
});
it('it should show the file attachment button', () => {
mainContent.fileAttachmentBtn.isVisible().should.be.true;
it('it should show the message box actions button', () => {
mainContent.messageBoxActions.isVisible().should.be.true;
});
it('it should show the audio recording button', () => {
//issues with the new message box action button and the no animations on tests
it.skip('it should show the audio recording button', () => {
mainContent.recordBtn.isVisible().should.be.true;
});
it('it should show the video call button', () => {
it.skip('it should show the video call button', () => {
mainContent.videoCamBtn.isVisible().should.be.true;
});
it('it should not show the send button', () => {
mainContent.sendBtn.isVisible().should.be.false;
});
it('it should show the emoji button', () => {
mainContent.emojiBtn.isVisible().should.be.true;
});
it('it should add some text to the input', () => {
mainContent.addTextToInput('Some Text');
});
it('it should show the send button', () => {
mainContent.sendBtn.isVisible().should.be.true;
});
it('it should not show the file attachment button', () => {
mainContent.fileAttachmentBtn.isVisible().should.be.false;
});
it('it should not show the audio recording button', () => {
mainContent.recordBtn.isVisible().should.be.false;
});
it('it should not show the video call button', () => {
mainContent.videoCamBtn.isVisible().should.be.false;
});
it('it should show the last message', () => {
mainContent.lastMessage.isVisible().should.be.true;
});

@ -39,7 +39,7 @@ function messagingTest() {
}
});
describe('fileUpload:', ()=> {
describe.skip('fileUpload:', ()=> {
after(() => {
});
it('it should send a attachment', () => {

@ -8,7 +8,9 @@ import sideNav from '../../pageobjects/side-nav.page';
import {username, email, password} from '../../data/user.js';
import {checkIfUserIsValid} from '../../data/checks';
describe('[Resolution]', ()=> {
//skipping this since the main content its not moved anymore, instead there is a overlay of the side nav over the main content
describe.skip('[Resolution]', ()=> {
describe('[Mobile Render]', ()=> {
before(()=> {
checkIfUserIsValid(username, email, password);

@ -19,13 +19,11 @@ describe('[Channel]', ()=> {
setPublicChannelCreated(true);
console.log('public channel not found, creating one...');
}
sideNav.openChannel('general');
});
describe('[Search]', ()=> {
describe('[SpotlightSearch]', () => {
describe('rocket.cat:', () => {
beforeEach(() => {
sideNav.getChannelFromSpotlight('rocket.cat').waitForVisible(5000);
});
afterEach(() => {
sideNav.spotlightSearch.setValue('');
@ -378,7 +376,8 @@ describe('[Channel]', ()=> {
});
});
describe('channel quit and enter', () => {
//no channel quit at the moment
describe.skip('channel quit and enter', () => {
it('it should leave the channel', () => {
const channel = sideNav.getChannelFromList(`NAME-EDITED-${ publicChannelName }`);
channel.click();

@ -7,7 +7,7 @@ import sideNav from '../../pageobjects/side-nav.page';
import preferencesMainContent from '../../pageobjects/preferences-main-content.page';
import {username, password, email} from '../../data/user.js';
import {imgURL} from '../../data/interactions.js';
// import {imgURL} from '../../data/interactions.js';
import {checkIfUserIsValid} from '../../data/checks';
@ -33,10 +33,6 @@ describe('[User Preferences]', ()=> {
sideNav.profile.isVisible().should.be.true;
});
it('it should show the avatar link', ()=> {
sideNav.avatar.isVisible().should.be.true;
});
it('it should click on the profile link', ()=> {
sideNav.profile.click();
});
@ -88,14 +84,6 @@ describe('[User Preferences]', ()=> {
preferencesMainContent.acceptPasswordOverlay(password);
});
it('it should click on the avatar link', ()=> {
sideNav.avatar.click();
});
it('it should upload a avatar', ()=> {
preferencesMainContent.changeAvatarUpload(imgURL);
});
it('it should close the preferences menu', () => {
sideNav.preferencesClose.waitForVisible(5000);
sideNav.preferencesClose.click();
@ -117,7 +105,7 @@ describe('[User Preferences]', ()=> {
});
it('it should be that the name on the nav bar is the edited one', () => {
sideNav.accountBoxUserName.getText().should.equal(`EditedRealName${ username }`);
sideNav.accountBoxUserName.getText().should.equal(`@EditeduserName${ username }`.toLowerCase());
});
it.skip('it should be that the user name on the members flex tab is the edited one', () => {

@ -326,7 +326,7 @@ describe('[Api Settings Change]', () => {
});
});
describe('block file upload:', () => {
describe.skip('block file upload:', () => {
it('it should change the file upload via api', (done) => {
request.post(api('settings/FileUpload_Enabled'))
.set(credentials)

@ -1,14 +1,14 @@
import Page from './Page';
class Administration extends Page {
get flexNav() { return browser.element('.flex-nav'); }
get flexNavContent() { return browser.element('.flex-nav .content'); }
get layoutLink() { return browser.element('.flex-nav .content [href="/admin/Layout"]'); }
get infoLink() { return browser.element('.flex-nav .content [href="/admin/info"]'); }
get roomsLink() { return browser.element('.flex-nav .content [href="/admin/rooms"]'); }
get usersLink() { return browser.element('.flex-nav .content [href="/admin/users"]'); }
get generalLink() { return browser.element('.flex-nav .content [href="/admin/General"]'); }
get permissionsLink() { return browser.element('.flex-nav .content [href="/admin/permissions"]'); }
get flexNav() { return browser.element('.sidebar--flex'); }
get flexNavContent() { return browser.element('.sidebar--flex'); }
get layoutLink() { return browser.element('.sidebar--flex [href="/admin/Layout"]'); }
get infoLink() { return browser.element('.sidebar--flex [href="/admin/info"]'); }
get roomsLink() { return browser.element('.sidebar--flex [href="/admin/rooms"]'); }
get usersLink() { return browser.element('.sidebar--flex [href="/admin/users"]'); }
get generalLink() { return browser.element('.sidebar--flex [href="/admin/General"]'); }
get permissionsLink() { return browser.element('.sidebar--flex [href="/admin/permissions"]'); }
get customScriptBtn() { return browser.element('.section:nth-of-type(6) .collapse'); }
get customScriptLoggedOutTextArea() { return browser.element('.section:nth-of-type(6) .CodeMirror-scroll'); }
get customScriptLoggedInTextArea() { return browser.element('.CodeMirror.cm-s-default:nth-of-type(2)'); }

@ -10,13 +10,12 @@ class MainContent extends Page {
get channelTitle() { return browser.element('.room-title'); }
//Main Content Footer (Message Input Area)
get messageInput() { return browser.element('.input-message'); }
get sendBtn() { return browser.element('.message-buttons.send-button'); }
get fileAttachmentBtn() { return browser.element('.message-buttons .icon-attach'); }
get fileAttachment() { return browser.element('.message-buttons input[type="file"]'); }
get messageInput() { return browser.element('.rc-message-box__container textarea'); }
get sendBtn() { return browser.element('.rc-message-box__icon.js-send'); }
get messageBoxActions() { return browser.element('.rc-message-box__icon'); }
get recordBtn() { return browser.element('.message-buttons .icon-mic'); }
get videoCamBtn() { return browser.element('.message-buttons .icon-videocam'); }
get emojiBtn() { return browser.element('.inner-left-toolbar .emoji-picker-icon'); }
get emojiBtn() { return browser.element('.rc-message-box__icon.emoji-picker-icon'); }
get messagePopUp() { return browser.element('.message-popup'); }
get messagePopUpTitle() { return browser.element('.message-popup-title'); }
get messagePopUpItems() { return browser.element('.message-popup-items'); }

@ -2,14 +2,14 @@ import Page from './Page';
class PreferencesMainContent extends Page {
get formTextInput() { return browser.element('.rocket-form'); }
get realNameTextInput() { return browser.element('[name="realname"]'); }
get userNameTextInput() { return browser.element('[name="username"]'); }
get realNameTextInput() { return browser.element('input[name="realname"]'); }
get userNameTextInput() { return browser.element('input[name="username"]'); }
get emailTextInput() { return browser.element('[name="email"]'); }
get passwordTextInput() { return browser.element('[name="password"]'); }
get resendVerificationEmailBtn() { return browser.element('#resend-verification-email'); }
get avatarFileInput() { return browser.element('.avatar-file-input'); }
get useUploadedAvatar() { return browser.element('.avatar-suggestion-item:nth-of-type(2) .select-service'); }
get submitBtn() { return browser.element('.submit .button'); }
get submitBtn() { return browser.element('.rc-button[type="submit"]'); }
changeUsername(userName) {
this.userNameTextInput.waitForVisible(5000);
@ -28,6 +28,9 @@ class PreferencesMainContent extends Page {
saveChanges() {
this.submitBtn.waitForVisible(5000);
browser.waitUntil(function() {
return browser.isEnabled('.rc-button[type="submit"]');
}, 5000);
this.submitBtn.click();
}

@ -2,32 +2,33 @@ import Page from './Page';
class SideNav extends Page {
// New channel
get channelType() { return browser.element('label[for="channel-type"]'); }
get channelReadOnly() { return browser.element('label[for="channel-ro"]'); }
get channelName() { return browser.element('input#channel-name'); }
get saveChannelBtn() { return browser.element('.save-channel'); }
get channelType() { return browser.element('.create-channel__content .rc-switch__button'); }
get channelReadOnly() { return browser.elements('.create-channel__switches .rc-switch__button').value[1]; }
get channelName() { return browser.element('.create-channel__content input[name="name"]'); }
get saveChannelBtn() { return browser.element('.create-channel__content button[data-button="create"]'); }
// Account box
get accountBoxUserName() { return browser.element('.account-box .data h4'); }
get accountBoxUserAvatar() { return browser.element('.account-box .avatar-image'); }
get userOptions() { return browser.element('.options'); }
get statusOnline() { return browser.element('.online'); }
get statusAway() { return browser.element('.away'); }
get statusBusy() { return browser.element('.busy'); }
get statusOffline() { return browser.element('.offline'); }
get account() { return browser.element('#account'); }
get admin() { return browser.element('#admin'); }
get logout() { return browser.element('#logout'); }
get accountBoxUserName() { return browser.element('.sidebar__account-name'); }
get accountBoxUserAvatar() { return browser.element('.sidebar__account .avatar-image'); }
get accountStatus() { return browser.element('.sidebar__account-status'); }
get popOverContent() { return browser.element('.rc-popover__content'); }
get statusOnline() { return browser.element('[data-status="online"]'); }
get statusAway() { return browser.element('[data-status="away"]'); }
get statusBusy() { return browser.element('[data-status="busy"]'); }
get statusOffline() { return browser.element('[data-status="offline"]'); }
get account() { return browser.element('[data-open="account"]'); }
get admin() { return browser.element('[data-open="administration"]'); }
get logout() { return browser.element('[data-open="logout"]'); }
get sideNavBar() { return browser.element('.sidebar'); }
// Toolbar
get spotlightSearch() { return browser.element('.toolbar__search-input'); }
get spotlightSearchPopUp() { return browser.element('.toolbar .message-popup'); }
get newChannelBtn() { return browser.element('.toolbar-search__create-channel'); }
get newChannelIcon() { return browser.element('.toolbar-search__create-channel.icon-plus'); }
get spotlightSearch() { return browser.element('.toolbar__search input'); }
get spotlightSearchPopUp() { return browser.element('.rooms-list__toolbar-search'); }
get newChannelBtn() { return browser.element('.toolbar .toolbar__search-create-channel'); }
get newChannelIcon() { return browser.element('.toolbar__icon.toolbar__search-create-channel'); }
// Rooms List
get general() { return browser.element('.rooms-list .room-type:not(.unread-rooms-mode) + ul .open-room[title="general"]'); }
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'); }
@ -36,15 +37,15 @@ class SideNav extends Page {
get preferences() { return browser.element('[href="/account/preferences"]'); }
get profile() { return browser.element('[href="/account/profile"]'); }
get avatar() { return browser.element('[href="/changeavatar"]'); }
get preferencesClose() { return browser.element('.sidebar .arrow.close'); }
get preferencesClose() { return browser.element('.sidebar-flex__back-button[data-action="back"]'); }
get burgerBtn() { return browser.element('.burger'); }
// Opens a channel via rooms list
openChannel(channelName) {
browser.waitForVisible(`.rooms-list ul:not(:first-of-type) a[title="${ channelName }"]`, 5000);
browser.click(`.rooms-list ul:not(:first-of-type) a[title="${ channelName }"]`);
browser.waitForVisible('.input-message', 5000);
browser.waitForVisible(`.sidebar-item__name=${ channelName }`, 5000);
browser.click(`.sidebar-item__name=${ channelName }`);
browser.waitForVisible('.rc-message-box__container textarea', 5000);
browser.waitUntil(function() {
browser.waitForVisible('.fixed-title .room-title', 8000);
return browser.getText('.fixed-title .room-title') === channelName;
@ -59,8 +60,8 @@ class SideNav extends Page {
this.spotlightSearch.waitForVisible(5000);
this.spotlightSearch.click();
this.spotlightSearch.setValue(channelName);
browser.waitForVisible(`[name='${ channelName }']`, 5000);
browser.click(`[name='${ channelName }']`);
browser.waitForVisible(`[title='${ channelName }']`, 5000);
browser.click(`[title='${ channelName }']`);
browser.waitUntil(function() {
browser.waitForVisible('.fixed-title .room-title', 8000);
return browser.getText('.fixed-title .room-title') === channelName;
@ -73,45 +74,47 @@ class SideNav extends Page {
getChannelFromSpotlight(channelName) {
browser.waitForVisible('.fixed-title .room-title', 15000);
const currentRoom = browser.element('.fixed-title .room-title').getText();
console.log(currentRoom, channelName);
if (currentRoom !== channelName) {
this.spotlightSearch.waitForVisible(5000);
this.spotlightSearch.click();
this.spotlightSearch.setValue(channelName);
browser.waitForVisible(`[name='${ channelName }']`, 5000);
return browser.element(`[name='${ channelName }']`);
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) {
browser.waitForVisible(`.rooms-list .room-type:not(.unread-rooms-mode) + ul .open-room[title="${ channelName }"]`, 5000);
browser.waitForVisible(`.sidebar-item__name=${ channelName }`, 5000);
}
return browser.element(`.rooms-list .room-type:not(.unread-rooms-mode) + ul .open-room[title="${ channelName }"]`);
return browser.element(`.sidebar-item__name=${ channelName }`);
}
createChannel(channelName, isPrivate, isReadOnly) {
createChannel(channelName, isPrivate, /*isReadOnly*/) {
this.newChannelBtn.waitForVisible(10000);
this.newChannelBtn.click();
this.channelName.waitForVisible(10000);
//workaround for incomplete setvalue bug
this.channelName.setValue(channelName);
this.channelName.setValue(channelName);
browser.pause(1000);
browser.waitUntil(function() {
return browser.isEnabled('.create-channel__content button[data-button="create"]');
}, 5000);
this.channelType.waitForVisible(10000);
if (isPrivate) {
this.channelType.click();
}
if (isReadOnly) {
this.channelReadOnly.click();
}
// if (isReadOnly) {
// this.channelReadOnly.click();
// }
browser.pause(500);
this.saveChannelBtn.click();
// this.channelType.waitForVisible(5000, true);
browser.pause(500);
browser.waitForExist(`[title="${ channelName }"]`, 10000);
this.channelType.waitForVisible(5000, true);
}
}

Loading…
Cancel
Save