Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
przucidlo committed Jun 9, 2024
1 parent 54a73a6 commit 692b3f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

env:
CI: true
DEBUG: 'pw:browser*'

jobs:
install:
Expand Down
4 changes: 0 additions & 4 deletions test/functional/app/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ const createWindow = () => {
);
}

mainWindow.once('ready-to-show', () => {
return;
});

childProcess = fork(path.join(__dirname, 'child-process.js'), {
silent: false,
env: {
Expand Down
10 changes: 5 additions & 5 deletions test/functional/fixtures/fixtures.ts
Original file line number Diff line number Diff line change
@@ -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<Fixtures>({
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,
},
Expand Down
13 changes: 13 additions & 0 deletions test/functional/utilities/findFilePath.ts
Original file line number Diff line number Diff line change
@@ -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));
}

0 comments on commit 692b3f9

Please sign in to comment.