From 2e8a2b13303d588f3e03301432274c10d492a7eb Mon Sep 17 00:00:00 2001 From: Suneet Srivastava Date: Thu, 3 Feb 2022 02:32:45 +0530 Subject: [PATCH] test:MM-T816 Toggle Full Screen in the Menu Bar (#1976) --- e2e/specs/menu_bar/view_menu.test.js | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/e2e/specs/menu_bar/view_menu.test.js b/e2e/specs/menu_bar/view_menu.test.js index 4dc4963e..510b2043 100644 --- a/e2e/specs/menu_bar/view_menu.test.js +++ b/e2e/specs/menu_bar/view_menu.test.js @@ -55,6 +55,37 @@ describe('mattermost', function desc() { text.should.include('in:'); }); + it.skip('MM-T816 Toggle Full Screen in the Menu Bar', async () => { + if (process.platform === 'win32' || process.platform === 'linux') { + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen')); + await loadingScreen.waitForSelector('.LoadingScreen', {state: 'hidden'}); + const firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win; + await env.loginToMattermost(firstServer); + await firstServer.waitForSelector('#searchBox'); + let currentWidth = await firstServer.evaluate('window.outerWidth'); + let currentHeight = await firstServer.evaluate('window.outerHeight'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('v'); + robot.keyTap('t'); + robot.keyTap('enter'); + await asyncSleep(1000); + const fullScreenWidth = await firstServer.evaluate('window.outerWidth'); + const fullScreenHeight = await firstServer.evaluate('window.outerHeight'); + fullScreenWidth.should.be.greaterThan(currentWidth); + fullScreenHeight.should.be.greaterThan(currentHeight); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('v'); + robot.keyTap('t'); + robot.keyTap('enter'); + await asyncSleep(1000); + currentWidth = await firstServer.evaluate('window.outerWidth'); + currentHeight = await firstServer.evaluate('window.outerHeight'); + currentWidth.should.be.lessThan(fullScreenWidth); + currentHeight.should.be.lessThan(fullScreenHeight); + } + }); + describe('Reload', () => { let browserWindow; let webContentsId;