From 6807019431b24fb799a863affe82fd9903213cbc Mon Sep 17 00:00:00 2001 From: Rohitesh Gupta <1429138+srkgupta@users.noreply.github.com> Date: Mon, 31 Jan 2022 17:34:06 -0500 Subject: [PATCH] test:MM-T824/MM-T825 Minimize/Close in the Menu Bar (#1975) * Added E2E test for Desktop - Minimize and Close * Fixed padding blank lines * Fixed test * Changed robot keyTap * Slight rework and fixes for flakiness * Try sleeping longer * Added .skip * Fix linting error caused by merge Co-authored-by: Devin Binnie Co-authored-by: Harrison Healey --- e2e/specs/menu_bar/window_menu.test.js | 28 +++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/e2e/specs/menu_bar/window_menu.test.js b/e2e/specs/menu_bar/window_menu.test.js index eecac1cb..f5bde557 100644 --- a/e2e/specs/menu_bar/window_menu.test.js +++ b/e2e/specs/menu_bar/window_menu.test.js @@ -49,7 +49,6 @@ describe('Menu/window_menu', function desc() { fs.writeFileSync(env.configFilePath, JSON.stringify(config)); await asyncSleep(1000); this.app = await env.getApp(); - this.serverMap = await env.getServerMap(this.app); }); afterEach(async () => { @@ -59,6 +58,7 @@ describe('Menu/window_menu', function desc() { }); it('MM-T826 should switch to servers when keyboard shortcuts are pressed', async () => { + await env.getServerMap(this.app); const mainWindow = this.app.windows().find((window) => window.url().includes('index')); let dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton'); @@ -95,4 +95,30 @@ describe('Menu/window_menu', function desc() { tabViewButton = await mainView.innerText('.active'); tabViewButton.should.equal('Channels'); }); + + it.skip('MM-T824 should be minimized when keyboard shortcuts are pressed', async () => { + const browserWindow = await this.app.browserWindow(await this.app.firstWindow()); + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('w'); + robot.keyTap('m'); + robot.keyTap('enter'); + await asyncSleep(2000); + const isMinimized = await browserWindow.evaluate((window) => window.isMinimized()); + isMinimized.should.be.true; + }); + + it.skip('MM-T825 should be hidden when keyboard shortcuts are pressed', async () => { + const browserWindow = await this.app.browserWindow(await this.app.firstWindow()); + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('w'); + robot.keyTap('c'); + robot.keyTap('enter'); + await asyncSleep(2000); + const isVisible = await browserWindow.evaluate((window) => window.isVisible()); + isVisible.should.be.false; + const isDestroyed = await browserWindow.evaluate((window) => window.isDestroyed()); + isDestroyed.should.be.false; + }); });