Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
74 lines
2.2 KiB
TypeScript
74 lines
2.2 KiB
TypeScript
import { test, expect, _electron as electron } from '@playwright/test';
|
|
|
|
test.describe('Navigation', () => {
|
|
test.describe.configure({ mode: 'serial' });
|
|
let electronApp: any;
|
|
let window: any;
|
|
|
|
test.beforeAll(async () => {
|
|
electronApp = await electron.launch({
|
|
args: ['out/main/index.js'],
|
|
env: {
|
|
...process.env,
|
|
NODE_ENV: 'test',
|
|
},
|
|
});
|
|
|
|
let found = false;
|
|
for (const w of electronApp.windows()) {
|
|
await w.waitForLoadState('domcontentloaded');
|
|
const t = await w.title();
|
|
if (t === 'D3RO Voice' || t === 'd3ro-voice') {
|
|
window = w;
|
|
found = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!found) {
|
|
window = await electronApp.waitForEvent('window', {
|
|
predicate: async (page: any) => {
|
|
await page.waitForLoadState('domcontentloaded');
|
|
const t = await page.title();
|
|
return t === 'D3RO Voice' || t === 'd3ro-voice';
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
test.afterAll(async () => {
|
|
if (electronApp) {
|
|
await electronApp.close();
|
|
}
|
|
});
|
|
|
|
test('should navigate to all sidebar tabs correctly', async () => {
|
|
// Dashboard
|
|
await window.locator('nav >> text="Dashboard"').click();
|
|
await expect(window.locator('text="Dashboard"').first()).toBeVisible();
|
|
|
|
// History
|
|
await window.locator('nav >> text="History"').click();
|
|
await expect(window.locator('text="History"').first()).toBeVisible();
|
|
|
|
// Dictionary
|
|
await window.locator('nav >> text="Dictionary"').click();
|
|
await expect(window.locator('text="Dictionary"').first()).toBeVisible();
|
|
|
|
// Commands
|
|
await window.locator('nav >> text="Commands"').click();
|
|
await expect(window.locator('text="Commands"').first()).toBeVisible();
|
|
|
|
// Voice Conversation
|
|
await window.locator('nav >> text="Voice Conversation"').click();
|
|
await expect(window.locator('text="Voice Conversation"').first()).toBeVisible();
|
|
|
|
// Knowledge Base
|
|
await window.locator('nav >> text="Knowledge Base"').click();
|
|
await expect(window.locator('text="Knowledge Base"').first()).toBeVisible();
|
|
|
|
// Meeting Mode
|
|
await window.locator('nav >> text="Meeting Mode"').click();
|
|
await expect(window.locator('text="Meeting Mode"').first()).toBeVisible();
|
|
});
|
|
});
|