diff --git a/e2e/specs/menu_bar/file_menu.test.js b/e2e/specs/menu_bar/file_menu.test.js index 33f0ad55..41cc1b96 100644 --- a/e2e/specs/menu_bar/file_menu.test.js +++ b/e2e/specs/menu_bar/file_menu.test.js @@ -14,16 +14,20 @@ describe('file_menu/dropdown', function desc() { const config = env.demoConfig; + let skipAfterEach = false; + beforeEach(async () => { env.createTestUserDataDir(); env.cleanTestConfig(); fs.writeFileSync(env.configFilePath, JSON.stringify(config)); await asyncSleep(1000); this.app = await env.getApp(); + + skipAfterEach = false; }); afterEach(async () => { - if (this.app) { + if (this.app && skipAfterEach === false) { await this.app.close(); } }); @@ -80,4 +84,21 @@ describe('file_menu/dropdown', function desc() { settingsWindowFromMenu.should.not.be.null; } }); + + it('MM-T806 Exit in the Menu Bar', () => { + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + mainWindow.should.not.be.null; + + if (process.platform === 'darwin') { + robot.keyTap('q', ['command']); + } + + if (process.platform === 'linux' || process.platform === 'win32') { + robot.keyTap('q', ['control']); + } + + this.app.windows().find((window) => window.url().should.not.include('index')); + + skipAfterEach = true; // Need to skip closing in aftereach as apps execution context is destroyed above + }); });