From 1ecc57465dbae21ad8dfbfbdbde707cfc94ae263 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:49:16 -0500 Subject: [PATCH] test: reenable disabled GHA windows tests (#45075) * test: renable GHA on Windows disabled tests Co-authored-by: John Kleinschmidt * test: close edge after shell.openExternal Co-authored-by: John Kleinschmidt * test: close edge sync after shell.openExternal Co-authored-by: John Kleinschmidt --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt --- spec/api-shell-spec.ts | 10 ++++++++++ spec/chromium-spec.ts | 10 +++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/spec/api-shell-spec.ts b/spec/api-shell-spec.ts index 3d4593db28d..643c780ed4a 100644 --- a/spec/api-shell-spec.ts +++ b/spec/api-shell-spec.ts @@ -3,6 +3,7 @@ import { BrowserWindow, app } from 'electron/main'; import { expect } from 'chai'; +import { execSync } from 'node:child_process'; import { once } from 'node:events'; import * as fs from 'node:fs'; import * as http from 'node:http'; @@ -17,6 +18,15 @@ describe('shell module', () => { let envVars: Record = {}; let server: http.Server; + after(function () { + this.timeout(60000); + if (process.env.CI && process.platform === 'win32') { + // Edge may cause issues with visibility tests, so make sure it is closed after testing. + const killEdge = 'Get-Process | Where Name -Like "msedge" | Stop-Process'; + execSync(killEdge, { shell: 'powershell.exe' }); + } + }); + beforeEach(function () { envVars = { display: process.env.DISPLAY, diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index 232e938e6ea..bc36b1937b5 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -653,9 +653,7 @@ describe('chromium features', () => { expect(size).to.be.a('number'); }); - // TODO: Re-enable for windows on GitHub Actions, - // fullscreen tests seem to hang on GHA specifically - ifit(process.platform !== 'win32' || process.arch === 'arm64')('should lock the keyboard', async () => { + it('should lock the keyboard', async () => { const w = new BrowserWindow({ show: true }); await w.loadFile(path.join(fixturesPath, 'pages', 'modal.html')); @@ -2980,9 +2978,7 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', () server.close(); }); - // TODO: Re-enable for windows on GitHub Actions, - // fullscreen tests seem to hang on GHA specifically - ifit(process.platform !== 'darwin' && (process.platform !== 'win32' || process.arch === 'arm64'))('can fullscreen from out-of-process iframes (non-macOS)', async () => { + ifit(process.platform !== 'darwin')('can fullscreen from out-of-process iframes (non-macOS)', async () => { const fullscreenChange = once(ipcMain, 'fullscreenChange'); const html = ``; @@ -3037,7 +3033,7 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', () // TODO: Re-enable for windows on GitHub Actions, // fullscreen tests seem to hang on GHA specifically - ifit(process.platform !== 'win32' || process.arch === 'arm64')('can fullscreen from in-process iframes', async () => { + it('can fullscreen from in-process iframes', async () => { if (process.platform === 'darwin') await once(w, 'enter-full-screen'); const fullscreenChange = once(ipcMain, 'fullscreenChange');