diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 9a66461..581a581 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -8,7 +8,6 @@ on: env: CI: true - DEBUG: 'pw:browser*' jobs: install: diff --git a/test/functional/app/src/main.ts b/test/functional/app/src/main.ts index f9c332f..1db1fdb 100644 --- a/test/functional/app/src/main.ts +++ b/test/functional/app/src/main.ts @@ -33,10 +33,6 @@ const createWindow = () => { ); } - mainWindow.once('ready-to-show', () => { - return; - }); - childProcess = fork(path.join(__dirname, 'child-process.js'), { silent: false, env: { diff --git a/test/functional/fixtures/fixtures.ts b/test/functional/fixtures/fixtures.ts index c860206..c373015 100644 --- a/test/functional/fixtures/fixtures.ts +++ b/test/functional/fixtures/fixtures.ts @@ -1,20 +1,20 @@ import { test as base, _electron as electron } from '@playwright/test'; import { BrokerPage } from './broker-page'; import path from 'path'; +import { findFilePath } from '../utilities/findFilePath'; export interface Fixtures { brokerPage: BrokerPage; } +const appOutPath = path.join(__dirname, '../app/out'); +const mainFilePath = findFilePath('main.js', appOutPath); + export const test = base.extend({ brokerPage: [ async ({}, use) => { - const mainPath = process.env.CI - ? '../app/out/app-linux-x64/resources/app/.vite/build/main.js' - : '../app/out/app-darwin-arm64/app.app/Contents/Resources/app/.vite/build/main.js'; - const app = await electron.launch({ - args: [path.join(__dirname, mainPath)], + args: [path.join(appOutPath, mainFilePath)], env: { ...process.env, }, diff --git a/test/functional/utilities/findFilePath.ts b/test/functional/utilities/findFilePath.ts new file mode 100644 index 0000000..a5956fc --- /dev/null +++ b/test/functional/utilities/findFilePath.ts @@ -0,0 +1,13 @@ +import fs from 'fs'; + +export function findFilePath( + filename: string, + path: string, +): string | undefined { + const paths: string[] = fs.readdirSync(path, { + recursive: true, + encoding: 'utf-8', + }); + + return paths.find((path) => path.endsWith(filename)); +}