Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Mobile view and re-enable E2E tests #13322

Merged
merged 1 commit into from
Feb 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/rocketchat-ui-master/client/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import './main.html';
import './loading.html';
import './error.html';
import './logoLayout.html';
import './main';
4 changes: 4 additions & 0 deletions packages/rocketchat-ui-master/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
33 changes: 14 additions & 19 deletions tests/end-to-end/ui/08-resolutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -17,41 +17,39 @@ 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', () => {
sideNav.burgerBtn.click();
});

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', () => {
sideNav.openChannel('general');
});

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 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();
});

Expand All @@ -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', () => {
Expand All @@ -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', () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/pageobjects/side-nav.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down