mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 08:03:20 +00:00
test: extract hidden Electron compositor setup
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import type { ElectronApplication } from '@stablyai/playwright-test'
|
||||
|
||||
export async function enableHiddenElectronCompositor(app: ElectronApplication): Promise<void> {
|
||||
await app.evaluate(({ BrowserWindow }) => {
|
||||
if (process.env.ORCA_E2E_HEADLESS === '1' && process.env.ORCA_E2E_HEADFUL !== '1') {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
window.webContents.setBackgroundThrottling(false)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import path from 'node:path'
|
||||
import { TEST_REPO_PATH_FILE } from '../global-setup'
|
||||
import { cleanupE2EDaemons, closeElectronAppForE2E } from './electron-process-shutdown'
|
||||
import { getOrcaElectronLaunchArgs } from './electron-launch-args'
|
||||
import { enableHiddenElectronCompositor } from './hidden-electron-compositor'
|
||||
import { retryTransientMainEvaluate } from './electron-main-evaluate-retry'
|
||||
import { getE2ECompletedOnboardingProfile } from './e2e-completed-onboarding-profile'
|
||||
import {
|
||||
@@ -293,13 +294,7 @@ export const test = base.extend<OrcaTestFixtures, OrcaWorkerFixtures>({
|
||||
// especially on cold start with no prior dev userData. Isolated per-test
|
||||
// profiles make late-suite launches slower, so use the full test budget.
|
||||
const page = await electronApp.firstWindow({ timeout: 120_000 })
|
||||
await electronApp.evaluate(({ BrowserWindow }) => {
|
||||
if (process.env.ORCA_E2E_HEADLESS === '1' && process.env.ORCA_E2E_HEADFUL !== '1') {
|
||||
for (const window of BrowserWindow.getAllWindows()) {
|
||||
window.webContents.setBackgroundThrottling(false)
|
||||
}
|
||||
}
|
||||
})
|
||||
await enableHiddenElectronCompositor(electronApp)
|
||||
await page.waitForLoadState('domcontentloaded')
|
||||
|
||||
// Wait for the store to be available
|
||||
|
||||
Reference in New Issue
Block a user