diff --git a/e2e/specs/menu_bar/view_menu.test.js b/e2e/specs/menu_bar/view_menu.test.js index 510b2043..a40c974b 100644 --- a/e2e/specs/menu_bar/view_menu.test.js +++ b/e2e/specs/menu_bar/view_menu.test.js @@ -20,7 +20,7 @@ async function setupPromise(window, id) { return true; } -describe('mattermost', function desc() { +describe('menu/view', function desc() { this.timeout(30000); const config = env.demoMattermostConfig; @@ -86,6 +86,53 @@ describe('mattermost', function desc() { } }); + it('MM-T817 Actual Size Zoom in the menu bar', async () => { + if (process.platform === 'win32' || process.platform === 'linux') { + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + mainWindow.should.not.be.null; + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('v'); + robot.keyTap('a'); + const zoomLevel = await mainWindow.evaluate('window.devicePixelRatio'); + zoomLevel.should.be.equal(1); + } + }); + + it('MM-T818 Zoom in from 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'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('v'); + robot.keyTap('z'); + robot.keyTap('enter'); + const zoomLevel = await firstServer.evaluate('window.devicePixelRatio'); + zoomLevel.should.be.greaterThan(1); + } + }); + + it('MM-T819 Zoom out from 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'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('v'); + robot.keyTap('z'); + robot.keyTap('z'); + robot.keyTap('enter'); + const zoomLevel = await firstServer.evaluate('window.devicePixelRatio'); + zoomLevel.should.be.lessThan(1); + } + }); + describe('Reload', () => { let browserWindow; let webContentsId;