Skip to content

Commit 53aa75a

Browse files
committed
Test win electron
1 parent ce5232a commit 53aa75a

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- '*'
7+
- '!winelectron'
78
tags:
89
- '*'
910

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Windows Electron Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- winelectron
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
windows-electron-e2e:
13+
name: Windows Electron E2E Tests
14+
runs-on: windows-latest
15+
steps:
16+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
with:
18+
persist-credentials: false
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
22+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
23+
with:
24+
node-version: '22'
25+
cache: 'pnpm'
26+
27+
- name: Install deps
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Build and test Electron on Windows
31+
run: pnpm test:e2e:ci:win
32+
working-directory: products/jbrowse-desktop

products/jbrowse-desktop/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
"test:e2e": "node --experimental-strip-types test/e2e.ts",
4141
"test:e2e:headless": "xvfb-run --auto-servernum node --experimental-strip-types test/e2e.ts --headless",
4242
"test:e2e:build": "pnpm build-electron-unpacked:linux && pnpm test:e2e",
43-
"test:e2e:ci": "pnpm build-electron-unpacked:linux && pnpm test:e2e:headless"
43+
"test:e2e:ci": "pnpm build-electron-unpacked:linux && pnpm test:e2e:headless",
44+
"test:e2e:build:win": "pnpm build-electron-unpacked:win && pnpm test:e2e",
45+
"test:e2e:ci:win": "pnpm build-electron-unpacked:win && node --experimental-strip-types test/e2e.ts --headless"
4446
},
4547
"dependencies": {
4648
"@emotion/react": "^11.14.0",

products/jbrowse-desktop/test/e2e.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ const require = createRequire(import.meta.url)
88

99
const __dirname = dirname(fileURLToPath(import.meta.url))
1010
const TEST_DATA_DIR = resolve(__dirname, '../../../test_data/volvox')
11-
const APP_BINARY = resolve(__dirname, '../dist/linux-unpacked/jbrowse-desktop')
11+
const isWindows = process.platform === 'win32'
12+
const APP_BINARY = resolve(
13+
__dirname,
14+
isWindows
15+
? '../dist/win-unpacked/JBrowse 2.exe'
16+
: '../dist/linux-unpacked/jbrowse-desktop',
17+
)
1218
const CHROMEDRIVER_PORT = 9515
1319

1420
// Check for headless mode via CLI arg or environment variable
@@ -19,7 +25,11 @@ const isHeadless =
1925
const electronChromedriverDir = dirname(
2026
require.resolve('electron-chromedriver/package.json'),
2127
)
22-
const CHROMEDRIVER_PATH = join(electronChromedriverDir, 'bin', 'chromedriver')
28+
const CHROMEDRIVER_PATH = join(
29+
electronChromedriverDir,
30+
'bin',
31+
isWindows ? 'chromedriver.exe' : 'chromedriver',
32+
)
2333

2434
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
2535

0 commit comments

Comments
 (0)