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 <devin.binnie@mattermost.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
This commit is contained in:
Rohitesh Gupta
2022-01-31 17:34:06 -05:00
committed by GitHub
parent c49aadc563
commit 6807019431

View File

@@ -49,7 +49,6 @@ describe('Menu/window_menu', function desc() {
fs.writeFileSync(env.configFilePath, JSON.stringify(config)); fs.writeFileSync(env.configFilePath, JSON.stringify(config));
await asyncSleep(1000); await asyncSleep(1000);
this.app = await env.getApp(); this.app = await env.getApp();
this.serverMap = await env.getServerMap(this.app);
}); });
afterEach(async () => { 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 () => { 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')); const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
let dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton'); let dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
@@ -95,4 +95,30 @@ describe('Menu/window_menu', function desc() {
tabViewButton = await mainView.innerText('.active'); tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels'); 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;
});
}); });