feat: unified E2E testing engine — 205 tests, dual-stack support
Infrastructure: - adapters/: base, tauri (port 9750), electrobun (port 9761 + PTY daemon) - helpers/: 120+ centralized selectors, reusable actions, custom assertions - wdio.shared.conf.js + stack-specific configs 18 unified specs (205 tests): splash(6) smoke(15) settings(19) terminal(14) agent(15) search(12) files(15) comms(10) tasks(10) theme(12) groups(12) keyboard(8) notifications(10) diagnostics(8) status-bar(12) context(9) worktree(8) llm-judged(10) Daemon: --stack tauri|electrobun|both flag Scripts: test:e2e:tauri, test:e2e:electrobun, test:e2e:both
This commit is contained in:
parent
1995f03682
commit
77b9ce9f62
31 changed files with 3547 additions and 344 deletions
92
tests/e2e/specs/context.test.ts
Normal file
92
tests/e2e/specs/context.test.ts
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
* Context tab tests — token meter, file references, turn count.
|
||||
*/
|
||||
|
||||
import { browser, expect } from '@wdio/globals';
|
||||
import * as S from '../helpers/selectors.ts';
|
||||
import { clickProjectTab } from '../helpers/actions.ts';
|
||||
|
||||
describe('Context tab', () => {
|
||||
before(async () => {
|
||||
await clickProjectTab('context');
|
||||
});
|
||||
|
||||
it('should render the context tab container', async () => {
|
||||
const exists = await browser.execute((sel: string) => {
|
||||
return document.querySelector(sel) !== null;
|
||||
}, S.CONTEXT_TAB);
|
||||
if (exists) {
|
||||
const el = await browser.$(S.CONTEXT_TAB);
|
||||
await expect(el).toBeDisplayed();
|
||||
}
|
||||
});
|
||||
|
||||
it('should show token meter', async () => {
|
||||
const exists = await browser.execute((sel: string) => {
|
||||
return document.querySelector(sel) !== null;
|
||||
}, S.TOKEN_METER);
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should show file references section', async () => {
|
||||
const exists = await browser.execute((sel: string) => {
|
||||
return document.querySelector(sel) !== null;
|
||||
}, S.FILE_REFS);
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should show turn count', async () => {
|
||||
const exists = await browser.execute((sel: string) => {
|
||||
return document.querySelector(sel) !== null;
|
||||
}, S.TURN_COUNT);
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should show stats bar', async () => {
|
||||
const exists = await browser.execute(() => {
|
||||
return (document.querySelector('.context-stats')
|
||||
?? document.querySelector('.stats-bar')
|
||||
?? document.querySelector('.context-header')) !== null;
|
||||
});
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should show anchor section if available', async () => {
|
||||
const exists = await browser.execute(() => {
|
||||
return (document.querySelector('.anchor-section')
|
||||
?? document.querySelector('.anchors')
|
||||
?? document.querySelector('.anchor-budget')) !== null;
|
||||
});
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should show segmented meter bar', async () => {
|
||||
const exists = await browser.execute(() => {
|
||||
return (document.querySelector('.segment-bar')
|
||||
?? document.querySelector('.meter-bar')
|
||||
?? document.querySelector('.progress-bar')) !== null;
|
||||
});
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should show turn breakdown list', async () => {
|
||||
const exists = await browser.execute(() => {
|
||||
return (document.querySelector('.turn-list')
|
||||
?? document.querySelector('.turn-breakdown')
|
||||
?? document.querySelector('.context-turns')) !== null;
|
||||
});
|
||||
expect(typeof exists).toBe('boolean');
|
||||
});
|
||||
|
||||
it('should have proper layout dimensions', async () => {
|
||||
const dims = await browser.execute(() => {
|
||||
const el = document.querySelector('.context-tab');
|
||||
if (!el) return null;
|
||||
const rect = el.getBoundingClientRect();
|
||||
return { width: rect.width, height: rect.height };
|
||||
});
|
||||
if (dims) {
|
||||
expect(dims.width).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue