From ed84aeb78b167e734c5a3655fec03e732c613eab Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Fri, 9 Aug 2024 09:35:09 +0900 Subject: [PATCH] test: set more electron args when is testing --- tests/app.spec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/app.spec.ts b/tests/app.spec.ts index 106e133..803b681 100644 --- a/tests/app.spec.ts +++ b/tests/app.spec.ts @@ -1,6 +1,7 @@ import { Page, _electron as electron } from 'playwright' import { ElectronApplication } from 'playwright-core' import { test, expect } from '@playwright/test' +import { main } from '../package.json' let appWindow: Page let appElectron: ElectronApplication @@ -20,7 +21,15 @@ function existElementByTestId(selector: string, waitingMilliseconds = 100) { test.beforeAll(async () => { // Open Electron app from build directory appElectron = await electron.launch({ - args: ['dist/main/index.js'], + args: [ + main, + ...(process.env.CI === 'true' ? ['--no-sandbox'] : []), + '--enable-logging', + '--ignore-certificate-errors', + '--ignore-ssl-errors', + '--ignore-blocklist', + '--ignore-gpu-blocklist' + ], locale: 'en-US', colorScheme: 'light', env: {