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
76 lines
2.6 KiB
TypeScript
76 lines
2.6 KiB
TypeScript
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import { test, expect, _electron as electron } from '@playwright/test';
|
|
|
|
test.describe('Dashboard', () => {
|
|
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-dashboard'],
|
|
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 render dashboard components', async () => {
|
|
await window.locator('text=/^(Dashboard|대시보드)$/').first().click();
|
|
|
|
// The Dashboard page has many icons. Let's check for Lucide-Mic or similar SVG if possible.
|
|
// We can just verify if the Dashboard page wrapper exists.
|
|
// Checking for a card header like "현재 백엔드" or "Current Backend"
|
|
await expect(window.locator('text=/^(Current Backend|현재 백엔드)$/').first()).toBeVisible({ timeout: 5000 });
|
|
|
|
// Checking for "Recent Transcriptions" or "최근 변환 기록"
|
|
await expect(window.locator('text=/^(Recent Transcriptions|최근 변환 기록|최근 기록|최근 전사)$/').first()).toBeVisible();
|
|
});
|
|
});
|