Fixed some E2E tests that broke on v5.2 (#2453)

* Fixing some E2E tests

* Fixed a couple flaky ones

* Fixed some issues on Windows
This commit is contained in:
Devin Binnie
2022-12-06 08:40:56 -04:00
committed by GitHub
parent c37d1ba308
commit 865fd2522f
14 changed files with 64 additions and 77 deletions

View File

@@ -87,7 +87,7 @@ describe('file_menu/dropdown', function desc() {
// TODO: Causes issues on Windows so skipping for Windows
if (process.platform !== 'win32') {
it('MM-T806 Exit in the Menu Bar', () => {
it('MM-T806 Exit in the Menu Bar', async () => {
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
mainWindow.should.not.be.null;
@@ -99,6 +99,7 @@ describe('file_menu/dropdown', function desc() {
robot.keyTap('q', ['control']);
}
await asyncSleep(500);
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

View File

@@ -234,7 +234,7 @@ describe('menu/view', function desc() {
});
it('MM-T820 should open Developer Tools For Application Wrapper for main window', async () => {
const mainWindow = this.app.windows().find((window) => window.url().includes('loadingScreen'));
const mainWindow = this.app.windows().find((window) => window.url().includes('index.html'));
const browserWindow = await this.app.browserWindow(mainWindow);
const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));
await loadingScreen.waitForSelector('.LoadingScreen', {state: 'hidden'});
@@ -244,7 +244,11 @@ describe('menu/view', function desc() {
});
isDevToolsOpen.should.be.false;
robot.keyTap('i', process.platform === 'darwin' ? ['command', 'alt'] : ['control', 'shift']);
robot.keyTap('alt');
robot.keyTap('enter');
robot.keyTap('v');
robot.keyTap('d');
robot.keyTap('enter');
await asyncSleep(1000);
isDevToolsOpen = await browserWindow.evaluate((window) => {
@@ -256,7 +260,7 @@ describe('menu/view', function desc() {
// TODO: Missing shortcut for macOS
if (process.platform !== 'darwin') {
it('MM-T821 should open Developer Tools For Current Server for the active tab', async () => {
const mainWindow = this.app.windows().find((window) => window.url().includes('loadingScreen'));
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
const browserWindow = await this.app.browserWindow(mainWindow);
const webContentsId = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].webContentsId;
const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));

View File

@@ -38,6 +38,7 @@ describe('Menu/window_menu', function desc() {
lastActiveTab: 0,
},
],
lastActiveTeam: 2,
minimizeToTray: true,
alwaysMinimize: true,
};
@@ -72,7 +73,7 @@ describe('Menu/window_menu', function desc() {
it('MM-T826_1 should show the second server', async () => {
let dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
dropdownButtonText.should.equal('example');
dropdownButtonText.should.equal('google');
robot.keyTap('2', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("github")');
@@ -92,7 +93,7 @@ describe('Menu/window_menu', function desc() {
});
});
it('MM-T4385 select tab from menu', async () => {
describe('MM-T4385 select tab from menu', async () => {
let mainView;
before(async () => {
@@ -106,18 +107,21 @@ describe('Menu/window_menu', function desc() {
tabViewButton.should.equal('Channels');
robot.keyTap('2', [env.cmdOrCtrl]);
await asyncSleep(500);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Boards');
});
it('MM-T4385_2 should show the third tab', async () => {
robot.keyTap('3', [env.cmdOrCtrl]);
await asyncSleep(500);
const tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Playbooks');
});
it('MM-T4385_3 should show the first tab', async () => {
robot.keyTap('1', [env.cmdOrCtrl]);
await asyncSleep(500);
const tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels');
});
@@ -132,10 +136,12 @@ describe('Menu/window_menu', function desc() {
tabViewButton.should.equal('Channels');
robot.keyTap('tab', ['control']);
await asyncSleep(500);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Boards');
robot.keyTap('tab', ['shift', 'control']);
await asyncSleep(500);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels');