d3ro-voice/apps/desktop/tests/e2e/navigation.spec.ts
Yun Chan 708e20f747
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
feat: complete release preparation, 10+ ad mediation, CI/CD, and docker deployment
2026-08-20 11:12:05 +09:00

94 lines
3.4 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as fs from 'fs';
import * as path from 'path';
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', '--user-data-dir=C:/Users/encep/AppData/Local/Temp/playwright-d3ro-test-navigation'],
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) => {
await page.waitForLoadState('domcontentloaded');
const t = await page.title();
return t === 'D3RO Voice' || t === 'd3ro-voice';
}
});
}
// Bypass onboarding via IPC config set
await window.evaluate(async () => {
if (window.electronAPI && window.electronAPI.config) {
await window.electronAPI.config.set({ key: 'onboardingCompleted', value: true });
await window.electronAPI.config.set({ key: 'appUsageMode', value: 'online' });
await window.electronAPI.config.set({ key: 'llmBackend', value: 'online' });
}
});
// Wait for the config to propagate then reload the page
await window.waitForTimeout(500);
await window.reload();
await window.waitForLoadState('domcontentloaded');
// Wait for React to mount AppLayout
await window.waitForTimeout(1000);
});
test.afterAll(async () => {
if (electronApp) {
await electronApp.close();
}
});
test('should navigate to all sidebar tabs correctly', async () => {
// Dashboard
await window.locator('text=/^(Dashboard|대시보드)$/').first().click();
await expect(window.locator('text=/^(Current Backend|현재 백엔드)$/').first()).toBeVisible();
// History
await window.locator('text=/^(History|히스토리|기ë¡<C3AB>)$/').first().click();
await expect(window.locator('text=/^(History|히스토리|변환 기ë¡<C3AB>)$/').first()).toBeVisible();
// Dictionary
await window.locator('text=/^(Dictionary|사전|단어장)$/').first().click();
await expect(window.locator('text=/^(Custom Dictionary|커스텀 사전|단어장)$/').first()).toBeVisible();
// Commands
await window.locator('text=/^(Commands|명령어)$/').first().click();
await expect(window.locator('text=/^(LLM Commands|LLM 명령어)$/').first()).toBeVisible();
// Voice Conversation
await window.locator('text=/^(Conversation|대화|ì<>Œì„± 대화)$/').first().click();
await expect(window.locator('text=/^(Voice Conversation|ì<>Œì„± 대화)$/').first()).toBeVisible();
// Knowledge Base
await window.locator('text=/^(Knowledge|ì§€ì<C3AC> ë² ì<C2A0>´ìФ)$/').first().click();
await expect(window.locator('text=/^(Knowledge Base|ì§€ì<C3AC> ë² ì<C2A0>´ìФ)$/').first()).toBeVisible();
// Meeting Mode
await window.locator('text=/^(Meeting|회ì<C592>˜|회ì<C592>˜ 모드)$/').first().click();
await expect(window.locator('text=/^(Meeting Mode|회ì<C592>˜ 모드)$/').first()).toBeVisible();
});
});