fix(e2e): dual-stack selector compatibility — 18/18 specs pass on Tauri

- selectors.ts: dual CSS selectors for all divergent class names
- actions.ts: fallback DOM queries (try primary, then alternatives)
- assertions.ts: waitUntil with dual selectors
- 12 spec files updated with graceful skip for stack-specific features
- 175 tests pass, 30 skip (expected: groups/diagnostics Tauri-absent)
This commit is contained in:
Hibryda 2026-03-22 05:56:01 +01:00
parent 77b9ce9f62
commit 3d74398fde
16 changed files with 482 additions and 236 deletions

View file

@ -1,5 +1,7 @@
/**
* Status bar tests agent counts, burn rate, attention queue, tokens, cost.
*
* Supports both Tauri and Electrobun status bar implementations.
*/
import { browser, expect } from '@wdio/globals';
@ -22,45 +24,56 @@ describe('Status bar', () => {
});
it('should show agent state counts', async () => {
const exists = await browser.execute((sel: string) => {
return document.querySelector(sel) !== null;
}, S.AGENT_COUNTS);
const exists = await browser.execute(() => {
// Tauri uses inline spans (.state-running, .state-idle, .state-stalled)
// Electrobun uses .agent-counts
return (document.querySelector('.agent-counts')
?? document.querySelector('.state-running')
?? document.querySelector('.state-idle')) !== null;
});
expect(typeof exists).toBe('boolean');
});
it('should show burn rate', async () => {
const exists = await browser.execute((sel: string) => {
return document.querySelector(sel) !== null;
}, S.BURN_RATE);
const exists = await browser.execute(() => {
return document.querySelector('.burn-rate') !== null;
});
expect(typeof exists).toBe('boolean');
});
it('should show attention queue dropdown', async () => {
const exists = await browser.execute((sel: string) => {
return document.querySelector(sel) !== null;
}, S.ATTENTION_QUEUE);
const exists = await browser.execute(() => {
// Tauri: .attention-btn | Electrobun: .attention-queue
return (document.querySelector('.attention-queue')
?? document.querySelector('.attention-btn')) !== null;
});
expect(typeof exists).toBe('boolean');
});
it('should show total tokens', async () => {
const exists = await browser.execute((sel: string) => {
return document.querySelector(sel) !== null;
}, S.FLEET_TOKENS);
const exists = await browser.execute(() => {
return (document.querySelector('.fleet-tokens')
?? document.querySelector('.tokens')) !== null;
});
expect(typeof exists).toBe('boolean');
});
it('should show total cost', async () => {
const exists = await browser.execute((sel: string) => {
return document.querySelector(sel) !== null;
}, S.FLEET_COST);
const exists = await browser.execute(() => {
return (document.querySelector('.fleet-cost')
?? document.querySelector('.cost')) !== null;
});
expect(typeof exists).toBe('boolean');
});
it('should show project count', async () => {
const exists = await browser.execute((sel: string) => {
return document.querySelector(sel) !== null;
}, S.PROJECT_COUNT);
expect(typeof exists).toBe('boolean');
const exists = await browser.execute(() => {
// Tauri embeds count in text, Electrobun uses .project-count
const hasClass = document.querySelector('.project-count') !== null;
const hasText = (document.querySelector('.status-bar')?.textContent ?? '').includes('project');
return hasClass || hasText;
});
expect(exists).toBe(true);
});
it('should have proper height and layout', async () => {
@ -101,7 +114,8 @@ describe('Status bar', () => {
it('should show attention queue cards on click', async () => {
const dropdown = await browser.execute(() => {
const btn = document.querySelector('.attention-queue');
const btn = document.querySelector('.attention-queue')
?? document.querySelector('.attention-btn');
if (btn) (btn as HTMLElement).click();
return document.querySelector('.attention-dropdown')
?? document.querySelector('.attention-cards');