From f9661bb8ac0bf4424f3e66dc4c2802fe115d4f26 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 1 Feb 2019 17:29:51 -0200 Subject: [PATCH] [FIX] Mobile view and re-enable E2E tests (#13322) --- packages/rocketchat-ui-master/client/index.js | 2 -- packages/rocketchat-ui-master/package.js | 4 +++ tests/end-to-end/ui/08-resolutions.js | 33 ++++++++----------- tests/pageobjects/side-nav.page.js | 2 ++ 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/packages/rocketchat-ui-master/client/index.js b/packages/rocketchat-ui-master/client/index.js index fd3af97d4fe6..f6f55f64a219 100644 --- a/packages/rocketchat-ui-master/client/index.js +++ b/packages/rocketchat-ui-master/client/index.js @@ -1,5 +1,3 @@ -import './main.html'; import './loading.html'; import './error.html'; import './logoLayout.html'; -import './main'; diff --git a/packages/rocketchat-ui-master/package.js b/packages/rocketchat-ui-master/package.js index 4ac4f0471624..b5ca30505859 100644 --- a/packages/rocketchat-ui-master/package.js +++ b/packages/rocketchat-ui-master/package.js @@ -22,8 +22,12 @@ Package.onUse(function(api) { 'rocketchat:ui-sidenav', 'meteorhacks:inject-initial', ]); + api.addFiles('client/main.html', 'client'); + api.addFiles('client/main.js', 'client'); + api.mainModule('client/index.js', 'client'); api.mainModule('server/index.js', 'server'); + api.addAssets('server/dynamic-css.js', 'server'); api.addAssets('public/icons.svg', 'server'); }); diff --git a/tests/end-to-end/ui/08-resolutions.js b/tests/end-to-end/ui/08-resolutions.js index 1bf01c7ea65f..8346d488f5b4 100644 --- a/tests/end-to-end/ui/08-resolutions.js +++ b/tests/end-to-end/ui/08-resolutions.js @@ -7,7 +7,7 @@ import { checkIfUserIsValid } from '../../data/checks'; // 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('[Resolution]', () => { describe('[Mobile Render]', () => { before(() => { checkIfUserIsValid(username, email, password); @@ -17,15 +17,13 @@ describe.skip('[Resolution]', () => { }); after(() => { - Global.setWindowSize(1450, 900); - sideNav.preferencesClose.waitForVisible(5000); - sideNav.preferencesClose.click(); - sideNav.spotlightSearch.waitForVisible(5000); + Global.setWindowSize(1600, 1600); + sideNav.spotlightSearchIcon.waitForVisible(5000); }); describe('moving elements:', () => { it('it should close de sidenav', () => { - mainContent.mainContent.getLocation().should.deep.equal({ x:0, y:0 }); + mainContent.mainContent.getLocation().should.deep.include({ x:0 }); }); it('it should press the navbar button', () => { @@ -33,7 +31,7 @@ describe.skip('[Resolution]', () => { }); it('it should open de sidenav', () => { - mainContent.mainContent.getLocation().should.not.deep.equal({ x:0, y:0 }); + mainContent.mainContent.getLocation().should.not.deep.equal({ x:0 }); }); it('it should open general channel', () => { @@ -41,7 +39,7 @@ describe.skip('[Resolution]', () => { }); it('it should close de sidenav', () => { - mainContent.mainContent.getLocation().should.deep.equal({ x:0, y:0 }); + mainContent.mainContent.getLocation().should.deep.include({ x:0 }); }); it('it should press the navbar button', () => { @@ -49,9 +47,9 @@ describe.skip('[Resolution]', () => { }); it('it should open the user preferences screen', () => { - sideNav.accountMenu.waitForVisible(5000); - sideNav.accountMenu.click(); - sideNav.account.waitForVisible(5000); + sideNav.sidebarUserMenu.waitForVisible(); + sideNav.sidebarUserMenu.click(); + sideNav.account.waitForVisible(); sideNav.account.click(); }); @@ -61,7 +59,7 @@ describe.skip('[Resolution]', () => { }); it('it should close de sidenav', () => { - mainContent.mainContent.getLocation().should.deep.equal({ x:0, y:0 }); + mainContent.mainContent.getLocation().should.deep.include({ x:0 }); }); it('it should press the navbar button', () => { @@ -74,20 +72,17 @@ describe.skip('[Resolution]', () => { }); it('it should close de sidenav', () => { - mainContent.mainContent.getLocation().should.deep.equal({ x:0, y:0 }); + mainContent.mainContent.getLocation().should.deep.include({ x:0 }); }); it('it should press the navbar button', () => { sideNav.burgerBtn.click(); }); - it('it should press the avatar link', () => { - sideNav.avatar.waitForVisible(5000); - sideNav.avatar.click(); - }); - it('it should close de sidenav', () => { - mainContent.mainContent.getLocation().should.deep.equal({ x:0, y:0 }); + sideNav.preferencesClose.waitForVisible(5000); + sideNav.preferencesClose.click(); + sideNav.sidebarWrap.click(); }); it('it should press the navbar button', () => { diff --git a/tests/pageobjects/side-nav.page.js b/tests/pageobjects/side-nav.page.js index 104111c70ed5..25640d0bec20 100644 --- a/tests/pageobjects/side-nav.page.js +++ b/tests/pageobjects/side-nav.page.js @@ -46,6 +46,8 @@ class SideNav extends Page { get burgerBtn() { return browser.element('.burger'); } + get sidebarWrap() { return browser.element('.sidebar-wrap'); } + // Opens a channel via rooms list openChannel(channelName) { browser.waitForVisible(`.sidebar-item__name=${ channelName }`, 5000);