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.4 KiB
TypeScript
74 lines
2.4 KiB
TypeScript
import { test, expect, _electron as electron } from '@playwright/test';
|
|
|
|
test.describe('Electron Application', () => {
|
|
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-1786110374422-312'],
|
|
env: {
|
|
...process.env,
|
|
NODE_ENV: 'test',
|
|
},
|
|
});
|
|
|
|
let found = false;
|
|
for (const w of electronApp.windows()) {
|
|
await w.waitForLoadState('domcontentloaded');
|
|
const t = await w.title();
|
|
console.log('Window title:', t);
|
|
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();
|
|
console.log('New window title:', t);
|
|
return t === 'D3RO Voice' || t === 'd3ro-voice';
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
test.afterAll(async () => {
|
|
if (electronApp) {
|
|
await electronApp.close();
|
|
}
|
|
});
|
|
|
|
test('should display Onboarding Modal on first run', async () => {
|
|
// Wait for the modal to be visible
|
|
const isModalVisible = await window.locator('text="D3RO Voice 시작하기"').isVisible();
|
|
expect(isModalVisible).toBeTruthy();
|
|
|
|
const emailInput = window.locator('input[type="email"]');
|
|
const passwordInput = window.locator('input[type="password"]');
|
|
await expect(emailInput).toBeVisible();
|
|
await expect(passwordInput).toBeVisible();
|
|
});
|
|
|
|
test('should show error when login fails', async () => {
|
|
const emailInput = window.locator('input[type="email"]');
|
|
const passwordInput = window.locator('input[type="password"]');
|
|
const submitBtn = window.locator('button:has-text("로그인 완료")');
|
|
|
|
await emailInput.fill('fake@example.com');
|
|
await passwordInput.fill('wrongpassword');
|
|
await submitBtn.click();
|
|
|
|
// In a real e2e test, we either expect success or error depending on backend.
|
|
// For now, we wait for an error message or success phase.
|
|
const errorMsg = window.locator('text="인증에 실패하였습니다"');
|
|
if (await errorMsg.isVisible()) {
|
|
expect(await errorMsg.isVisible()).toBeTruthy();
|
|
}
|
|
});
|
|
});
|