[MM-38875] Migrate E2E testing to Playwright, re-enable tests (#1800)

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* [MM-38875] Migrate E2E testing to Playwright, re-enable tests

* Add functionality to map view names to Playwright windows

* Added search box test

* Added robot.js for automating key presses

* Add test using key strokes to navigate menu

* Reload test and added webcontentsid to test helper

* Check Ctrl+Shift+R as well

* oops

* Reorganize

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Devin Binnie
2021-10-28 13:17:10 -04:00
committed by GitHub
parent bd0d9df7e3
commit c53e897bfd
26 changed files with 1854 additions and 3477 deletions

View File

@@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import path from 'path';
import {app, BrowserWindow, nativeImage, systemPreferences, ipcMain, IpcMainEvent} from 'electron';
import {app, BrowserWindow, nativeImage, systemPreferences, ipcMain, IpcMainEvent, IpcMainInvokeEvent} from 'electron';
import log from 'electron-log';
import {CombinedConfig} from 'types/config';
@@ -18,6 +18,8 @@ import {
UPDATE_SHORTCUT_MENU,
BROWSER_HISTORY_PUSH,
APP_LOGGED_IN,
GET_VIEW_NAME,
GET_VIEW_WEBCONTENTS_ID,
} from 'common/communication';
import urlUtils from 'common/utils/url';
@@ -54,6 +56,8 @@ ipcMain.on(REACT_APP_INITIALIZED, handleReactAppInitialized);
ipcMain.on(LOADING_SCREEN_ANIMATION_FINISHED, handleLoadingScreenAnimationFinished);
ipcMain.on(BROWSER_HISTORY_PUSH, handleBrowserHistoryPush);
ipcMain.on(APP_LOGGED_IN, handleAppLoggedIn);
ipcMain.handle(GET_VIEW_NAME, handleGetViewName);
ipcMain.handle(GET_VIEW_WEBCONTENTS_ID, handleGetWebContentsId);
export function setConfig(data: CombinedConfig) {
if (data) {
@@ -585,3 +589,11 @@ export function getCurrentTeamName() {
function handleAppLoggedIn(event: IpcMainEvent, viewName: string) {
status.viewManager?.reloadViewIfNeeded(viewName);
}
function handleGetViewName(event: IpcMainInvokeEvent) {
return getViewNameByWebContentsId(event.sender.id);
}
function handleGetWebContentsId(event: IpcMainInvokeEvent) {
return event.sender.id;
}