chore: land in-progress workspace changes before 1.16.2
The tree carried uncommitted work from several areas (web push, mobile screens, admin charts, test-hygiene cleanup, CI and map docs). It is landed as one commit so the release pipeline can start from a clean tree; the desktop transcript-correction behaviour shipped in the previous commit and is unchanged here.
This commit is contained in:
parent
9c2b6a9782
commit
7fe49c437e
144 changed files with 3760 additions and 4523 deletions
|
|
@ -1,94 +1,43 @@
|
|||
import { test, expect, _electron as electron } from '@playwright/test';
|
||||
// apps/desktop/tests/e2e/settings.spec.ts
|
||||
// 설정 화면 계약: 탭 목록은 `SETTINGS_TAB_ORDER` 가 정본이므로 테스트도 그 상수를 읽는다.
|
||||
// 탭 순서·개수를 테스트에 복사하면 탭을 옮길 때마다 두 곳을 고쳐야 한다 (SSOT 위반).
|
||||
|
||||
test.describe('Settings Modal E2E', () => {
|
||||
test.describe.configure({ mode: 'serial' });
|
||||
let electronApp: any;
|
||||
let window: any;
|
||||
import { SETTINGS_TAB_ORDER, OPEN_SETTINGS_EVENT } from '../../src/renderer/navigation/settingsTabs'
|
||||
import { expect, expectNoRuntimeErrors, goToRoute, test } from './support/electron-app'
|
||||
|
||||
test.beforeAll(async () => {
|
||||
|
||||
electronApp = await electron.launch({
|
||||
args: ['out/main/index.js', '--user-data-dir=C:/Users/encep/AppData/Local/Temp/playwright-d3ro-test-settings'],
|
||||
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';
|
||||
}
|
||||
});
|
||||
test.describe('설정', () => {
|
||||
test('사이드바 설정은 정본 탭 개수만큼 탭을 렌더하고 첫 탭을 선택한다', async ({ mainWindow }) => {
|
||||
await goToRoute(mainWindow, 'settings')
|
||||
|
||||
const tabs = mainWindow.window.getByRole('tab')
|
||||
await expect(tabs).toHaveCount(SETTINGS_TAB_ORDER.length)
|
||||
await expect(mainWindow.window.getByTestId('settings-tab-general')).toHaveAttribute('aria-selected', 'true')
|
||||
|
||||
expectNoRuntimeErrors(mainWindow)
|
||||
})
|
||||
|
||||
test('딥링크로 특정 탭을 열면 그 탭이 선택된다', async ({ mainWindow }) => {
|
||||
await mainWindow.window.evaluate((eventName) => {
|
||||
window.dispatchEvent(new CustomEvent(eventName, { detail: { tab: 'stt' } }))
|
||||
}, OPEN_SETTINGS_EVENT)
|
||||
|
||||
await expect(mainWindow.window.getByTestId('settings-tab-stt')).toHaveAttribute('aria-selected', 'true')
|
||||
await expect(mainWindow.window.getByRole('tab', { selected: true })).toHaveCount(1)
|
||||
|
||||
expectNoRuntimeErrors(mainWindow)
|
||||
})
|
||||
|
||||
test('탭을 누르면 선택이 그 탭 하나로 바뀐다', async ({ mainWindow }) => {
|
||||
await goToRoute(mainWindow, 'settings')
|
||||
|
||||
for (const tab of SETTINGS_TAB_ORDER) {
|
||||
await test.step(tab, async () => {
|
||||
await mainWindow.window.getByTestId(`settings-tab-${tab}`).click()
|
||||
await expect(mainWindow.window.getByTestId(`settings-tab-${tab}`)).toHaveAttribute('aria-selected', 'true')
|
||||
await expect(mainWindow.window.getByRole('tab', { selected: true })).toHaveCount(1)
|
||||
})
|
||||
}
|
||||
|
||||
// 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 open Settings Modal and navigate through tabs', async () => {
|
||||
// Open Settings via IPC event instead of clicking the UI
|
||||
await window.evaluate(() => {
|
||||
window.dispatchEvent(new CustomEvent('d3ro:open-settings'));
|
||||
});
|
||||
|
||||
// Wait for the Settings modal to appear by checking for a known tab or title
|
||||
const tabs = window.locator('.MuiTab-root');
|
||||
await expect(tabs.first()).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Since MuiDialog might have transition, wait a bit
|
||||
await window.waitForTimeout(1000);
|
||||
|
||||
// Verify there are tabs available
|
||||
const tabCount = await tabs.count();
|
||||
expect(tabCount).toBeGreaterThan(0);
|
||||
|
||||
// Click through each tab (use force to bypass potential transition overlays)
|
||||
for (let i = 0; i < tabCount; i++) {
|
||||
await tabs.nth(i).click({ force: true });
|
||||
await window.waitForTimeout(300); // Allow content to switch
|
||||
const isSelected = await tabs.nth(i).getAttribute('aria-selected');
|
||||
expect(isSelected).toBe('true');
|
||||
}
|
||||
|
||||
// Close the settings modal using the Close button if it exists, or via Escape key
|
||||
await window.keyboard.press('Escape');
|
||||
|
||||
// Wait for the modal to disappear
|
||||
await expect(tabs.first()).toBeHidden({ timeout: 5000 });
|
||||
});
|
||||
});
|
||||
expectNoRuntimeErrors(mainWindow)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue