Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat): appEntryPoint #704

Merged
merged 78 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8f0af4c
feat: appEntryPoint
goosewobbler Jul 24, 2024
25cbb95
test: add no-binary e2es
goosewobbler Jul 24, 2024
34000c2
chore: chmod -x
goosewobbler Jul 24, 2024
b0d3f0c
chore: update lockfile
goosewobbler Jul 24, 2024
e8baf5b
test: hook up e2es
goosewobbler Jul 24, 2024
bf51cb9
chore: update graphs
goosewobbler Jul 24, 2024
49d93da
fix: point to correct rollup config
goosewobbler Jul 24, 2024
abdbc16
fix: use correct preload path
goosewobbler Jul 24, 2024
7def36c
fix: set appArgs correctly
goosewobbler Jul 24, 2024
0b161be
debug: move no-binary build & tests to end
goosewobbler Jul 24, 2024
493a0bd
fix: bundle `@vitest/spy`
goosewobbler Jul 24, 2024
26c3f94
chore: revert debug
goosewobbler Jul 24, 2024
d3329a0
fix: inject @vitest/spy
goosewobbler Jul 24, 2024
937280c
test: fix no-binary tests
goosewobbler Jul 24, 2024
9efd054
chore: run no-binary tasks sequentially
goosewobbler Jul 24, 2024
b70194c
chore: update lockfile
goosewobbler Jul 24, 2024
23cd952
ci: ensure latest debug
goosewobbler Jul 24, 2024
c096368
chore: update pnpm
goosewobbler Jul 24, 2024
d33ff60
fix: use correct binary for windows
goosewobbler Jul 24, 2024
f3da465
chore: update lockfile
goosewobbler Jul 24, 2024
6495668
debug: move no-binary to end
goosewobbler Jul 24, 2024
1ac9b9b
debug: sequential
goosewobbler Jul 24, 2024
8b876ed
debug: add debug to no-binary
goosewobbler Jul 24, 2024
318c68d
debug: no-binary first
goosewobbler Jul 24, 2024
cf12ef7
debug: try lower case cmd
goosewobbler Jul 24, 2024
00e7347
chore: ensure builder-esm doesn't build in parallel with no-binary
goosewobbler Jul 25, 2024
d97eeb1
ci: use electron 29 for all apps on windows
goosewobbler Jul 25, 2024
3abfc07
ci: fix task name
goosewobbler Jul 25, 2024
09245b3
ci: fix task loop
goosewobbler Jul 25, 2024
5862c78
chore: ensure builder-esm#build runs after no-binary builds
goosewobbler Jul 25, 2024
1ee8dac
chore: update task graph
goosewobbler Jul 25, 2024
0b63e15
debug: cat logs
goosewobbler Jul 25, 2024
be5e71e
chore: ensure builder-esm runs after no-binary tests
goosewobbler Jul 25, 2024
582a0e5
chore: add logs task
goosewobbler Jul 25, 2024
185901a
chore: ensure linux always runs sequentially
goosewobbler Jul 25, 2024
7098490
debug: revert to CMD
goosewobbler Jul 25, 2024
b0e249e
debug: move concurrency to script
goosewobbler Jul 25, 2024
2c1b29a
chore: add comment
goosewobbler Jul 25, 2024
a232b4b
debug: no-binary-esm only
goosewobbler Jul 30, 2024
c8db66b
Merge branch 'main' into sm/no-binary
goosewobbler Jul 30, 2024
457f7c2
chore: update lockfile
goosewobbler Jul 30, 2024
ac5d1e7
chore: update deps
goosewobbler Jul 30, 2024
a8c9e89
debug: no-binary-cjs only
goosewobbler Jul 30, 2024
83478bd
debug: serial
goosewobbler Jul 30, 2024
79eacbd
debug: latest electron
goosewobbler Jul 30, 2024
f8592da
debug: win-2019
goosewobbler Jul 30, 2024
5790945
debug: split tests over windows runners
goosewobbler Jul 30, 2024
c8915e0
debug: add job names
goosewobbler Jul 30, 2024
ae8673a
debug: quote test values
goosewobbler Jul 30, 2024
2284a39
debug: further split e2es
goosewobbler Jul 30, 2024
8dcde64
ci: build forge apps individually
goosewobbler Jul 30, 2024
9d92ddf
ci: split out mac-universal
goosewobbler Jul 30, 2024
a5ceb87
ci: speed up mac-universal
goosewobbler Jul 30, 2024
8b34d5c
chore: delete init-windows-ci script
goosewobbler Jul 30, 2024
2fe1c25
chore: add comment
goosewobbler Jul 30, 2024
5f67ed7
chore: delete ejs
goosewobbler Jul 30, 2024
a56b73b
chore: delete bin
goosewobbler Jul 30, 2024
cf5575f
chore: abstract dep script
goosewobbler Jul 30, 2024
b9aa1e1
chore: move e2e to root
goosewobbler Jul 30, 2024
d98746f
chore: update lockfile
goosewobbler Jul 30, 2024
ce6a8ea
chore: update paths
goosewobbler Jul 30, 2024
9693e5d
chore: update deps
goosewobbler Jul 31, 2024
0af2cb3
test: add appEntryPoint test
goosewobbler Jul 31, 2024
196f15b
chore: add warning when both appBinaryPath and appEntryPoint are set
goosewobbler Jul 31, 2024
b2d4067
chore: add extra debug message
goosewobbler Jul 31, 2024
f096a27
chore: update graph
goosewobbler Jul 31, 2024
fe2316e
docs: add appEntryPoint
goosewobbler Jul 31, 2024
bc6e1aa
test: fix electron path for windows
goosewobbler Jul 31, 2024
4152824
Merge remote-tracking branch 'origin/main' into sm/no-binary
goosewobbler Aug 5, 2024
dd1a741
chore: update wdio
goosewobbler Aug 6, 2024
b7fdb9a
fix: disable bidi
goosewobbler Aug 6, 2024
f44c38d
chore: update type
goosewobbler Aug 6, 2024
48de177
Merge remote-tracking branch 'origin/main' into sm/no-binary
goosewobbler Aug 7, 2024
8a9df43
chore: update deps
goosewobbler Aug 9, 2024
bcdbd33
chore: update pnpm
goosewobbler Aug 9, 2024
b6a8eda
chore: update deps
goosewobbler Aug 19, 2024
aeed0d2
fix(linting): update `eslint-plugin-wdio` import
goosewobbler Aug 19, 2024
de5ed76
chore: add override, use latest pnpm
goosewobbler Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/assets/e2e-graph-mac-universal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/assets/e2e-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 108 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ env:

jobs:
build:
name: Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, macOS-latest]
node-version: [20.x]
fail-fast: false

Expand All @@ -37,33 +38,127 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- uses: pnpm/action-setup@v3
with:
version: 9.5.0
version: 9.7.0
run_install: false
- name: Set pnpm store path
run: |
pnpm config set store-dir ~/.pnpm-store --global
- name: Install Dependencies
run: |
pnpm install
if [ "$RUNNER_OS" == "Windows" ]; then
pnpm run ci:init-windows
pnpm install --no-frozen-lockfile
shell: bash
- name: Run Tests
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
# Run tasks in serial on Ubuntu to avoid Xvfb issues
pnpm run ci-linux
else
pnpm run ci
fi
shell: bash
- name: 🐛 Show logs
if: failure()
run: |
pnpm run ci:e2e:logs
- name: 🐛 Debug Build
uses: stateful/vscode-server-action@v1.1.0
if: failure()
with:
timeout: '180000'
build-macos-universal:
name: MacOS Universal Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest]
node-version: [20.x]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- uses: pnpm/action-setup@v3
with:
version: 9.7.0
run_install: false
- name: Set pnpm store path
run: |
pnpm config set store-dir ~/.pnpm-store --global
- name: Install Dependencies
run: |
pnpm install
shell: bash
- name: Run Tests
run: |
pnpm run ci
pnpm run build
pnpm run ci-mac:e2e:mac-universal
shell: bash
- name: Run OS-specific Tests
- name: 🐛 Show logs
if: failure()
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
pnpm run ci:e2e:clean
pnpm install --no-frozen-lockfile
pnpm run ci:e2e:mac-universal
fi
pnpm run ci:e2e:logs
- name: 🐛 Debug Build
uses: stateful/vscode-server-action@v1.1.0
if: failure()
with:
timeout: '180000'
build-windows:
name: Windows Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
test: ['units', 'e2e:no-binary', 'e2e:builder-cjs', 'e2e:builder-esm', 'e2e:forge-cjs', 'e2e:forge-esm']
node-version: [20.x]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- uses: pnpm/action-setup@v3
with:
version: 9.7.1
run_install: false
- name: Set pnpm store path
run: |
pnpm config set store-dir ~/.pnpm-store --global
- name: Install Dependencies
run: |
pnpm install
shell: bash
- name: Run Tests
run: |
pnpm run build
pnpm run ci-windows:${{ matrix.test }}
shell: bash
- name: 🐛 Show logs
if: failure()
run: |
pnpm run ci:e2e:logs
- name: 🐛 Debug Build
uses: stateful/vscode-server-action@v1
uses: stateful/vscode-server-action@v1.1.0
if: failure()
with:
timeout: '180000'
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
node-version: 20.x
- uses: pnpm/action-setup@v3
with:
version: 9.5.0
version: 9.7.1
run_install: false
- name: Package Manager Setup
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
node-version: 20.x
- uses: pnpm/action-setup@v3
with:
version: 9.5.0
version: 9.7.1
run_install: false
- name: Package Manager Setup
run: |
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,27 @@ export const config = {
{
'browserName': 'electron',
'wdio:electronServiceOptions': {
appBinaryPath: './path/to/bundled/electron/app.exe',
appBinaryPath: './path/to/built/electron/app.exe',
appArgs: ['foo', 'bar=baz'],
},
},
],
// ...
};
```

Alternatively, you can point the service at an unpackaged app by providing the path to the `main.js` script. Electron will need to be installed in your `node_modules`. It is recommended to bundle unpackaged apps using a bundler such as Rollup, Parcel, Webpack, etc.

_`wdio.conf.ts`_

```ts
export const config = {
// ...
capabilities: [
{
'browserName': 'electron',
'wdio:electronServiceOptions': {
appEntryPoint: './path/to/bundled/electron/main.bundle.js',
appArgs: ['foo', 'bar=baz'],
},
},
Expand Down
16 changes: 8 additions & 8 deletions apps/builder-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.14.14",
"@wdio/cli": "9.0.0-alpha.426",
"@wdio/globals": "9.0.0-alpha.426",
"@wdio/local-runner": "9.0.0-alpha.367",
"@wdio/mocha-framework": "9.0.0-alpha.426",
"@wdio/cli": "^9.0.4",
"@wdio/globals": "^9.0.4",
"@wdio/local-runner": "^9.0.4",
"@wdio/mocha-framework": "^9.0.4",
"cross-env": "^7.0.3",
"electron": "^31.3.1",
"electron": "^31.4.0",
"electron-builder": "^25.0.1",
"global-jsdom": "^24.0.0",
"jsdom": "^24.1.1",
"rollup": "^4.20.0",
"rollup": "^4.21.0",
"ts-loader": "^9.4.4",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "9.0.0-alpha.369"
"webdriverio": "^9.0.4"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
Empty file modified apps/builder-cjs/tsconfig.json
100755 → 100644
Empty file.
16 changes: 8 additions & 8 deletions apps/builder-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.14.14",
"@wdio/cli": "9.0.0-alpha.426",
"@wdio/globals": "9.0.0-alpha.426",
"@wdio/local-runner": "9.0.0-alpha.367",
"@wdio/mocha-framework": "9.0.0-alpha.426",
"@wdio/cli": "^9.0.4",
"@wdio/globals": "^9.0.4",
"@wdio/local-runner": "^9.0.4",
"@wdio/mocha-framework": "^9.0.4",
"cross-env": "^7.0.3",
"electron": "^31.3.1",
"electron": "^31.4.0",
"electron-builder": "^25.0.1",
"global-jsdom": "^24.0.0",
"jsdom": "^24.1.1",
"rollup": "^4.20.0",
"rollup": "^4.21.0",
"ts-loader": "^9.4.4",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "9.0.0-alpha.369"
"webdriverio": "^9.0.4"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
Empty file modified apps/builder-esm/tsconfig.json
100755 → 100644
Empty file.
18 changes: 9 additions & 9 deletions apps/forge-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:package:mac-universal": "cp ./src/index.html ./dist && electron-forge package --platform=darwin --arch=universal",
"build:mac-universal": "pnpm build:bundle && pnpm build:package:mac-universal",
"ci": "pnpm i && pnpm build && pnpm test",
"clean": "pnpm clean:dist && pnpm dlx shx rm -rf ./node_modules ./package-lock.json ./wdio-logs ./out",
"clean": "pnpm clean:dist && pnpm dlx shx rm -rf ./node_modules ./wdio-logs",
"clean:dist": "pnpm dlx shx rm -rf ./dist ./out && pnpm dlx shx mkdir -p ./dist"
},
"dependencies": {
Expand All @@ -21,19 +21,19 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.14.14",
"@wdio/cli": "9.0.0-alpha.426",
"@wdio/globals": "9.0.0-alpha.426",
"@wdio/local-runner": "9.0.0-alpha.367",
"@wdio/mocha-framework": "9.0.0-alpha.426",
"@wdio/cli": "^9.0.4",
"@wdio/globals": "^9.0.4",
"@wdio/local-runner": "^9.0.4",
"@wdio/mocha-framework": "^9.0.4",
"cross-env": "^7.0.3",
"electron": "^31.3.1",
"electron": "^31.4.0",
"global-jsdom": "^24.0.0",
"jsdom": "^24.1.1",
"rollup": "^4.20.0",
"rollup": "^4.21.0",
"ts-loader": "^9.4.4",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "9.0.0-alpha.369"
"webdriverio": "^9.0.4"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
18 changes: 9 additions & 9 deletions apps/forge-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build:package": "cp ./src/index.html ./dist && electron-forge package",
"build:package:mac-universal": "cp ./src/index.html ./dist && electron-forge package --platform=darwin --arch=universal",
"build:mac-universal": "pnpm build:bundle && pnpm build:package:mac-universal",
"clean": "pnpm clean:dist && pnpm dlx shx rm -rf ./node_modules ./package-lock.json ./wdio-logs ./out",
"clean": "pnpm clean:dist && pnpm dlx shx rm -rf ./node_modules ./wdio-logs",
"clean:dist": "pnpm dlx shx rm -rf ./dist ./out && pnpm dlx shx mkdir -p ./dist"
},
"dependencies": {
Expand All @@ -22,19 +22,19 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.14.14",
"@wdio/cli": "9.0.0-alpha.426",
"@wdio/globals": "9.0.0-alpha.426",
"@wdio/local-runner": "9.0.0-alpha.367",
"@wdio/mocha-framework": "9.0.0-alpha.426",
"@wdio/cli": "^9.0.4",
"@wdio/globals": "^9.0.4",
"@wdio/local-runner": "^9.0.4",
"@wdio/mocha-framework": "^9.0.4",
"cross-env": "^7.0.3",
"electron": "^31.3.1",
"electron": "^31.4.0",
"global-jsdom": "^24.0.0",
"jsdom": "^24.1.1",
"rollup": "^4.20.0",
"rollup": "^4.21.0",
"ts-loader": "^9.4.4",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "9.0.0-alpha.369"
"webdriverio": "^9.0.4"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
Binary file added apps/forge-esm/src/assets/icon/webdriverio.icns
Binary file not shown.
Binary file added apps/forge-esm/src/assets/icon/webdriverio.ico
Binary file not shown.
Binary file added apps/forge-esm/src/assets/icon/webdriverio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions apps/forge-esm/src/assets/icon/webdriverio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified apps/forge-esm/tsconfig.json
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions apps/no-binary-cjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# no-binary-cjs

A CJS project for a minimal Electron app, designed to provide E2E testing for `wdio-electron-service`.

The app is not built but has been bundled.
35 changes: 35 additions & 0 deletions apps/no-binary-cjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "example-no-binary-cjs",
"version": "1.0.0",
"main": "dist/main.bundle.js",
"private": true,
"scripts": {
"build": "tsc && rollup -c rollup.config.mjs && cp ./src/index.html ./dist",
"clean": "pnpm clean:dist && pnpm dlx shx rm -rf ./node_modules ./wdio-logs",
"clean:dist": "pnpm dlx shx rm -rf ./dist && pnpm dlx shx mkdir -p ./dist"
},
"dependencies": {
"wdio-electron-service": "workspace:*"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@types/node": "^20.14.12",
"@wdio/cli": "^9.0.4",
"@wdio/globals": "^9.0.4",
"@wdio/local-runner": "^9.0.4",
"@wdio/mocha-framework": "^9.0.4",
"cross-env": "^7.0.3",
"electron": "^31.4.0",
"global-jsdom": "^24.0.0",
"jsdom": "^24.1.1",
"rollup": "^4.21.0",
"ts-loader": "^9.4.4",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"webdriverio": "^9.0.4"
},
"peerDependencies": {
"typescript": "5.2.2"
}
}
25 changes: 25 additions & 0 deletions apps/no-binary-cjs/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';

export default [
{
input: 'dist/preload.js',
output: {
file: 'dist/preload.bundle.js',
inlineDynamicImports: true,
format: 'cjs',
},
plugins: [nodeResolve(), commonjs()],
external: ['electron'],
},
{
input: 'dist/main.js',
output: {
file: 'dist/main.bundle.js',
inlineDynamicImports: true,
format: 'cjs',
},
plugins: [nodeResolve(), commonjs()],
external: ['electron'],
},
];
Loading
Loading