fix(e2e): cross-protocol browser.execute() — works with both WebDriver + CDP
Root cause: WebDriverIO devtools protocol wraps functions in a polyfill that puts `return` inside eval() (not a function body) → "Illegal return". Fix: exec() wrapper in helpers/execute.ts converts function args to IIFE strings before passing to browser.execute(). Works identically on both WebDriver (Tauri) and CDP/devtools (Electrobun CEF). - 35 spec files updated (browser.execute → exec) - 4 config files updated (string-form expressions) - helpers/actions.ts + assertions.ts updated - 560 vitest + 116 cargo passing
This commit is contained in:
parent
407e49cc32
commit
6a8181f33a
42 changed files with 630 additions and 541 deletions
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import { browser, expect } from '@wdio/globals';
|
||||
import { exec } from '../helpers/execute.ts';
|
||||
|
||||
describe('BTerminal — Workspace & Projects', () => {
|
||||
it('should display the project grid', async () => {
|
||||
|
|
@ -45,7 +46,7 @@ describe('BTerminal — Workspace & Projects', () => {
|
|||
|
||||
it('should switch project tabs', async () => {
|
||||
// Use JS click — WebDriver clicks don't always trigger Svelte onclick
|
||||
const switched = await browser.execute(() => {
|
||||
const switched = await exec(() => {
|
||||
const box = document.querySelector('.project-box') ?? document.querySelector('.project-card');
|
||||
if (!box) return false;
|
||||
const tabs = box.querySelectorAll('.ptab, .project-tab, .tab-btn');
|
||||
|
|
@ -62,7 +63,7 @@ describe('BTerminal — Workspace & Projects', () => {
|
|||
expect(text.toLowerCase()).toContain('docs');
|
||||
|
||||
// Switch back to Model tab
|
||||
await browser.execute(() => {
|
||||
await exec(() => {
|
||||
const box = document.querySelector('.project-box') ?? document.querySelector('.project-card');
|
||||
const tab = box?.querySelector('.ptab, .project-tab, .tab-btn');
|
||||
if (tab) (tab as HTMLElement).click();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue