Skip to content
Open
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
d1d1219
fix: improve script handling in execute commands for better serializa…
goosewobbler Apr 9, 2026
529b134
docs: remove tauri-playwright analysis document and update improvemen…
goosewobbler Apr 9, 2026
0130321
refactor(tauri): improve script handling in execute function for Tauri
goosewobbler Apr 9, 2026
d7d53e9
refactor(tauri): enhance script handling in execute function
goosewobbler Apr 9, 2026
bb4085b
refactor(electron): simplify script handling in execute function
goosewobbler Apr 9, 2026
f21d60a
refactor(tauri): enhance error handling in execute function
goosewobbler Apr 9, 2026
5f2526b
refactor(tauri): simplify script handling in execute function
goosewobbler Apr 9, 2026
4d80fcb
refactor(tauri): update script handling in execute function
goosewobbler Apr 9, 2026
1b6b4be
refactor(tauri): correct script wrapping in execute function
goosewobbler Apr 9, 2026
dd8b8a4
docs(tauri): clarify script serialization in execute function
goosewobbler Apr 9, 2026
bf638a7
refactor(tauri): enhance script execution logic in execute function
goosewobbler Apr 9, 2026
4210433
refactor(tauri): streamline script execution logic in execute function
goosewobbler Apr 9, 2026
cfcbdf3
refactor(tauri): improve argument handling in script execution
goosewobbler Apr 9, 2026
3bbf167
refactor(tauri): improve script execution for no-args case
goosewobbler Apr 9, 2026
87f1f94
test(electron, tauri): add comprehensive script execution tests
goosewobbler Apr 9, 2026
c81a43f
refactor(tauri): enhance script execution logic for no-args case
goosewobbler Apr 9, 2026
52d891f
refactor(tauri): enhance script execution for statement expressions
goosewobbler Apr 9, 2026
17c4255
refactor(tauri): embed command and arguments in script string for exe…
goosewobbler Apr 9, 2026
11b618c
refactor(tauri): pass command and arguments as function parameters in…
goosewobbler Apr 9, 2026
126659f
refactor(tauri): improve script wrapping logic for execution
goosewobbler Apr 9, 2026
90513e8
refactor(tauri): improve script execution handling for async results
goosewobbler Apr 9, 2026
fbf1381
refactor(tauri): enhance function detection in script execution
goosewobbler Apr 9, 2026
83e254a
refactor(tauri): enhance script execution for async compatibility
goosewobbler Apr 9, 2026
66ee9f2
refactor(tauri): enhance error handling in async script execution
goosewobbler Apr 9, 2026
725a83e
refactor(tauri): refine function detection logic in script execution
goosewobbler Apr 9, 2026
a1269f5
refactor(tauri): improve async script execution wrapping
goosewobbler Apr 9, 2026
aec6d24
refactor(tauri): improve return detection for pure expressions in scr…
goosewobbler Apr 9, 2026
1de3895
refactor(tauri): enhance async script execution wrapping for WebKit c…
goosewobbler Apr 9, 2026
ee5d38a
refactor(tauri): enhance error handling in async script execution
goosewobbler Apr 9, 2026
6b72060
refactor(tauri): streamline async script execution error handling
goosewobbler Apr 9, 2026
9182584
refactor(tauri): update script execution to use executeAsync for WebK…
goosewobbler Apr 9, 2026
60e09bd
refactor(tauri): improve pure expression detection in script execution
goosewobbler Apr 9, 2026
0d391e8
refactor(tauri): fix argument handling in async script execution
goosewobbler Apr 9, 2026
119b7b3
refactor(tauri): enhance pure expression detection in script execution
goosewobbler Apr 9, 2026
2cc06d6
refactor(tauri): expand pure expression detection in script execution
goosewobbler Apr 9, 2026
2de3568
refactor(tauri): enhance script execution logic for function and stat…
goosewobbler Apr 9, 2026
caca107
refactor(tauri): enhance function detection in script execution logic
goosewobbler Apr 9, 2026
9c76b98
refactor(tauri): improve async script execution for embedded provider
goosewobbler Apr 9, 2026
4976d20
refactor(tauri): improve function detection in script execution logic
goosewobbler Apr 9, 2026
70cfca5
refactor(tauri): simplify script execution for embedded provider
goosewobbler Apr 9, 2026
e562c4f
refactor(electron): enhance script execution handling in execute func…
goosewobbler Apr 9, 2026
2c9ca71
refactor(tauri): enhance arrow function detection in script execution
goosewobbler Apr 9, 2026
64a9684
refactor(electron): improve script statement detection in wrapStringS…
goosewobbler Apr 10, 2026
d0172ef
refactor(tauri): improve error handling for string scripts with argum…
goosewobbler Apr 10, 2026
e45001b
refactor(electron): refine arrow function detection in wrapStringScript
goosewobbler Apr 10, 2026
af003eb
refactor(tauri): ensure async handling in script execution
goosewobbler Apr 10, 2026
c718b0a
refactor(tauri): ensure async function handling in script execution
goosewobbler Apr 10, 2026
7979023
chore: reorder e2e scripts
goosewobbler Apr 10, 2026
648da6d
refactor(tauri): refine function detection in script execution
goosewobbler Apr 10, 2026
5a99329
refactor(electron): enhance script parsing for string inputs
goosewobbler Apr 10, 2026
6b91d62
refactor(tauri): simplify script handling in execute function
goosewobbler Apr 10, 2026
21b3c04
refactor(electron): improve statement keyword detection in wrapString…
goosewobbler Apr 10, 2026
f878857
refactor(tauri): enhance arrow function detection in script execution
goosewobbler Apr 10, 2026
612ae1c
test(electron): add tests for false positive handling in script execu…
goosewobbler Apr 10, 2026
21f14e0
refactor(tauri): clean up comments in execute function
goosewobbler Apr 10, 2026
1029e1f
refactor(tauri): enhance script wrapping logic in execute function
goosewobbler Apr 10, 2026
e8357d4
refactor(electron): improve string script handling in execute function
goosewobbler Apr 10, 2026
310e0a1
refactor(electron, tauri): improve escape sequence handling in execut…
goosewobbler Apr 10, 2026
e609d1f
refactor(tauri): streamline script evaluation in execute function
goosewobbler Apr 10, 2026
020f0bc
refactor(tauri): update script wrapping for expression evaluation
goosewobbler Apr 10, 2026
c7f89f7
refactor(electron): simplify async function wrapping in script execution
goosewobbler Apr 11, 2026
f493f8e
refactor(tauri): enhance script wrapping logic in execute function
goosewobbler Apr 11, 2026
e89c7dc
refactor(electron): optimize async function wrapping in script execution
goosewobbler Apr 11, 2026
d415750
refactor(tauri): implement semicolon detection outside quotes for scr…
goosewobbler Apr 11, 2026
8d71425
refactor(tauri): update script handling in TauriWorkerService
goosewobbler Apr 11, 2026
4a98230
refactor(tauri): enhance async function handling in script execution
goosewobbler Apr 11, 2026
8b1af1f
refactor(tauri): improve async handling for script execution in Tauri…
goosewobbler Apr 11, 2026
c2e16db
refactor(tauri): skip patching for internal executeWithinTauri calls
goosewobbler Apr 11, 2026
8b9f702
refactor(tauri): enhance error handling and improve async execution i…
goosewobbler Apr 11, 2026
fe105bb
refactor(tauri): update event emission to target app context
goosewobbler Apr 11, 2026
013a5e4
refactor(tauri): update event listener to target window context
goosewobbler Apr 11, 2026
e0356f9
refactor(tauri): enhance event handling in execute function
goosewobbler Apr 11, 2026
312c24e
chore: merge main into refactor/audit-string-interpolation
goosewobbler Apr 22, 2026
5a1f159
fix(tauri): break circular dependency between execute.ts and window.ts
goosewobbler Apr 22, 2026
e008495
test(tauri): update window.spec.ts to spy on pluginCache module
goosewobbler Apr 22, 2026
dbed72c
fix(electron): add word-boundary check for async/function in wrapStri…
goosewobbler Apr 22, 2026
9d3195a
fix(tauri-plugin): add word-boundary check for 'return' prefix in has…
goosewobbler Apr 22, 2026
152ea04
fix(electron): require => when paren-prefixed script is classified as…
goosewobbler Apr 22, 2026
3c14850
fix(electron): align executeCdp escape handling with execute.ts
goosewobbler Apr 22, 2026
7c41bfc
fix(tauri): route executeWithinTauri through executeAsync on non-embe…
goosewobbler Apr 23, 2026
727213f
fix(tauri): prepend return for expression-style string scripts on non…
goosewobbler Apr 23, 2026
2482568
fix(tauri-plugin): enhance script execution handling in guest-js
goosewobbler Apr 23, 2026
2bd885c
fix(tauri-service): add settleMs parameter to waitTestRunnerBackendReady
goosewobbler Apr 23, 2026
d93b308
fix(ci): enhance cleanup process for CrabNebula provider tests
goosewobbler Apr 23, 2026
a610b00
fix(tauri-service): improve function script handling for embedded Web…
goosewobbler Apr 23, 2026
4008cd7
fix(tauri-plugin): improve arrow function detection in script execution
goosewobbler Apr 23, 2026
d6f2ae2
feat(electron-service): add hasTopLevelArrow utility for improved scr…
goosewobbler Apr 23, 2026
0cffdd3
fix(tauri-plugin): enhance return detection for script execution
goosewobbler Apr 23, 2026
43053ef
fix(tauri-service): enhance backend process management and readiness …
goosewobbler Apr 23, 2026
5b5f26a
fix(tauri-service): improve port validation and process termination i…
goosewobbler Apr 23, 2026
3cacc77
fix(tauri-service): refactor process termination command in startTest…
goosewobbler Apr 23, 2026
b4c411e
fix(tauri-service): update script execution handling for embedded Web…
goosewobbler Apr 23, 2026
36f8964
refactor(electron-service): simplify IIFE wrapping for script execution
goosewobbler Apr 23, 2026
b0367f2
feat(electron-service): add hasSemicolonOutsideQuotes utility for scr…
goosewobbler Apr 23, 2026
3ed0a80
feat(tauri-plugin): add hasSemicolonOutsideQuotes utility for enhance…
goosewobbler Apr 23, 2026
57a8691
refactor(tauri-service): update script execution handling for embedde…
goosewobbler Apr 23, 2026
35efe7b
refactor(tauri-plugin): clarify script execution handling in Platform…
goosewobbler Apr 23, 2026
a004f59
refactor(tauri-service): update script handling for embedded WebDrive…
goosewobbler Apr 23, 2026
2cb6d81
refactor(tauri-service): simplify IIFE structure in mock script execu…
goosewobbler Apr 23, 2026
329ca84
refactor(tauri-service): update script structure for WebDriver compat…
goosewobbler Apr 23, 2026
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
8 changes: 8 additions & 0 deletions .github/workflows/_ci-e2e-tauri-all-providers.reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,12 @@ jobs:
echo "Cleaning up before CrabNebula provider tests..."
if [ "${{ runner.os }}" == "Windows" ]; then
powershell -Command "Get-Process -Name 'tauri-e2e-app' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue" || true
powershell -Command "Get-Process -Name 'test-runner-backend' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue" || true
powershell -Command "Get-Process -Name 'tauri-driver' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue" || true
else
pkill -9 -f tauri-e2e-app || true
pkill -9 -f test-runner-backend || true
pkill -9 -f tauri-driver || true
fi

- name: 🧪 E2E Tests [CrabNebula]
Expand Down Expand Up @@ -457,8 +461,12 @@ jobs:
echo "Cleaning up after CrabNebula provider tests..."
if [ "${{ runner.os }}" == "Windows" ]; then
powershell -Command "Get-Process -Name 'tauri-e2e-app' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue" || true
powershell -Command "Get-Process -Name 'test-runner-backend' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue" || true
powershell -Command "Get-Process -Name 'tauri-driver' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue" || true
else
pkill -9 -f tauri-e2e-app || true
pkill -9 -f test-runner-backend || true
pkill -9 -f tauri-driver || true
fi

- name: 🐛 Debug Information [CrabNebula]
Expand Down
177 changes: 0 additions & 177 deletions docs/tauri-playwright-analysis.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/tauri-playwright-improvements-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| 2 | Direct WebView eval channel (supplement WebDriver) | Tauri (embedded) | Large | High | Pending |
| 3 | Multi-window label configuration | Tauri | Small | Medium | **Completed** |
| 4 | Native screenshot capture | Tauri + Electron | Medium | Low | Pending |
| 5 | Audit JS string interpolation / escaping | Tauri + Electron | Small | Medium | Pending |
| 5 | Audit JS string interpolation / escaping | Tauri + Electron | Small | Medium | **Done** |
| 6 | IPC mock serialization pattern | Tauri + Electron | Medium | Medium | Pending |

---
Expand Down
50 changes: 50 additions & 0 deletions e2e/test/electron/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,56 @@ describe('Electron APIs', () => {
);
});

describe('execute - different script types', () => {
it('should execute function with args (with-args branch)', async () => {
const result = await browser.electron.execute(
(electron, arg1, arg2) => {
return { appName: electron.app.getName(), arg1, arg2 };
},
'first',
'second',
);
expect(result.appName).toBeDefined();
expect(result.arg1).toBe('first');
expect(result.arg2).toBe('second');
});

it('should execute statement-style string (return statement)', async () => {
const result = await browser.electron.execute('return 42');
expect(result).toBe(42);
});

it('should execute expression-style string', async () => {
const result = await browser.electron.execute('1 + 2 + 3');
expect(result).toBe(6);
});

it('should execute string with variable declaration', async () => {
const result = await browser.electron.execute(`
const x = 10;
const y = 20;
return x + y;
`);
expect(result).toBe(30);
});

it('should execute function without args', async () => {
const result = await browser.electron.execute((electron) => {
return { name: electron.app.getName() };
});
expect(result.name).toBeDefined();
});

it('should execute async function with args', async () => {
const result = await browser.electron.execute(async (electron, value) => {
await new Promise((resolve) => setTimeout(resolve, 10));
return { received: value, appName: electron.app.getName() };
}, 'async-test');
expect(result.received).toBe('async-test');
expect(result.appName).toBeDefined();
});
});

describe('workaround for TSX issue', () => {
// Tests for the following issue - can be removed when the TSX issue is resolved
// https://github.com/webdriverio-community/wdio-electron-service/issues/756
Expand Down
63 changes: 63 additions & 0 deletions e2e/test/tauri/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,67 @@ describe('Tauri API', () => {
expect(result).toHaveProperty('os');
expect(typeof result.os).toBe('string');
});

describe('execute - different script types', () => {
it('should execute function with Tauri APIs and args (with-args branch)', async () => {
// This tests the with-args branch: function receives Tauri APIs as first param, user args after
const result = await browser.tauri.execute(
(tauri, arg1, arg2) => {
return { tauriHasCore: typeof tauri?.core?.invoke === 'function', arg1, arg2 };
},
'first',
'second',
);
expect(result.tauriHasCore).toBe(true);
expect(result.arg1).toBe('first');
expect(result.arg2).toBe('second');
});

it('should execute statement-style string (return statement)', async () => {
// This tests the no-args branch with statement-style script like "return document.title"
const result = await browser.tauri.execute('return 42');
expect(result).toBe(42);
});

it('should execute expression-style string', async () => {
// This tests the no-args branch with expression-style script
const result = await browser.tauri.execute('1 + 2 + 3');
expect(result).toBe(6);
});

it('should execute string with variable declaration', async () => {
// Statement-style: declare variables and return
const result = await browser.tauri.execute(`
const x = 10;
const y = 20;
return x + y;
`);
expect(result).toBe(30);
});

it('should execute function with Tauri APIs (no args)', async () => {
// Function without args should still receive Tauri APIs
const result = await browser.tauri.execute((tauri) => {
return { hasCore: typeof tauri?.core !== 'undefined' };
});
expect(result.hasCore).toBe(true);
});

it('should execute string that accesses Tauri APIs', async () => {
// String script that uses window.__TAURI__ directly
const result = await browser.tauri.execute(`
return typeof window.__TAURI__?.core;
`);
expect(result).toBe('object');
});

it('should execute async function with args', async () => {
const result = await browser.tauri.execute(async (tauri, value) => {
await new Promise((resolve) => setTimeout(resolve, 10));
return { received: value, hasTauri: !!tauri?.core };
}, 'async-test');
expect(result.received).toBe('async-test');
expect(result.hasTauri).toBe(true);
});
});
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"e2e": "pnpm --filter @repo/e2e run test",
"e2e:electron-builder": "pnpm protocol-install:electron-builder && pnpm --filter @repo/e2e run test:e2e:electron-builder",
"e2e:electron-forge": "pnpm protocol-install:electron-forge && pnpm --filter @repo/e2e run test:e2e:electron-forge",
"e2e:multiremote": "pnpm --filter @repo/e2e run test:e2e:multiremote",
"e2e:electron-script": "pnpm --filter @repo/e2e run test:e2e:electron-script",
"e2e:multiremote": "pnpm --filter @repo/e2e run test:e2e:multiremote",
"e2e:standalone": "pnpm --filter @repo/e2e run test:e2e:standalone",
"e2e:window": "pnpm --filter @repo/e2e run test:e2e:window",
"e2e:tauri": "pnpm protocol-install:tauri && pnpm --filter @repo/e2e run test:e2e:tauri",
"e2e:tauri-basic": "pnpm protocol-install:tauri && pnpm --filter @repo/e2e run test:e2e:tauri-basic",
"e2e:window": "pnpm --filter @repo/e2e run test:e2e:window",
"protocol-install:tauri": "pnpm --filter @repo/e2e run protocol-install:tauri",
"protocol-install:electron-builder": "pnpm --filter @repo/e2e run protocol-install:electron-builder",
"protocol-install:electron-forge": "pnpm --filter @repo/e2e run protocol-install:electron-forge",
Expand Down
6 changes: 1 addition & 5 deletions packages/electron-cdp-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@
"typescript": "^5.9.3",
"vitest": "^4.0.18"
},
"files": [
"dist",
"README.md",
"LICENSE"
],
"files": ["dist", "README.md", "LICENSE"],
"publishConfig": {
"access": "public",
"provenance": true
Expand Down
Loading
Loading