E2E test fixups (#2045)

* Reinstall reporter and re-enable skipped tests

* Fixups for Linux

* Mac fixes

* Windows fixes

* Use keyboard shortcuts instead of menu for most menu actions

* Couple fixes

* One more fix for now

* Windows fixes

* Lint fixes

* Change up developer tools tests to be more consistent

* Fix key for mac

* Couple fixes for flaky tests/to avoid crashes on unload
This commit is contained in:
Devin Binnie
2022-04-19 09:56:41 -04:00
committed by GitHub
parent ce2ddb6a6a
commit 1c44c8527a
19 changed files with 323 additions and 491 deletions

View File

@@ -40,6 +40,8 @@ describe('Menu/window_menu', function desc() {
lastActiveTab: 0,
},
],
minimizeToTray: true,
alwaysMinimize: true,
};
beforeEach(async () => {
@@ -64,16 +66,16 @@ describe('Menu/window_menu', function desc() {
let dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
dropdownButtonText.should.equal('example');
robot.keyTap('2', ['control', 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
robot.keyTap('2', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("github")');
dropdownButtonText.should.equal('github');
robot.keyTap('3', ['control', 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
robot.keyTap('3', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("google")');
dropdownButtonText.should.equal('google');
robot.keyTap('1', ['control', 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
robot.keyTap('1', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("example")');
dropdownButtonText.should.equal('example');
});
@@ -83,15 +85,15 @@ describe('Menu/window_menu', function desc() {
let tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels');
robot.keyTap('2', [process.platform === 'darwin' ? 'command' : 'control']);
robot.keyTap('2', [env.cmdOrCtrl]);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Boards');
robot.keyTap('3', [process.platform === 'darwin' ? 'command' : 'control']);
robot.keyTap('3', [env.cmdOrCtrl]);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Playbooks');
robot.keyTap('1', [process.platform === 'darwin' ? 'command' : 'control']);
robot.keyTap('1', [env.cmdOrCtrl]);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels');
});
@@ -111,25 +113,27 @@ describe('Menu/window_menu', function desc() {
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());
it('MM-T824 should be minimized when keyboard shortcuts are pressed', async () => {
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');
const browserWindow = await this.app.browserWindow(mainWindow);
if (process.platform === 'darwin') {
robot.keyTap('m', [env.cmdOrCtrl]);
} else {
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());
it('MM-T825 should be hidden when keyboard shortcuts are pressed', async () => {
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');
const browserWindow = await this.app.browserWindow(mainWindow);
robot.keyTap('w', [env.cmdOrCtrl]);
await asyncSleep(2000);
const isVisible = await browserWindow.evaluate((window) => window.isVisible());
isVisible.should.be.false;