收口 Makelore 客户端变更
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-12 22:35:06 +08:00
parent 253bad8b40
commit f4113a872f
232 changed files with 4617 additions and 20121 deletions

View File

@@ -1,25 +1,43 @@
import { closeElectronApp, expect, test } from './fixtures/electron';
test.describe('Makelore Electron smoke flows', () => {
test('loads the bundled mixed-script UI font', async ({ page }) => {
await page.evaluate(async () => {
await document.fonts.load('400 16px "Makelore Latin"', 'Makelore');
await document.fonts.load('400 16px "Makelore CJK"', '中文');
await document.fonts.load('600 16px "Makelore Latin"', 'Makelore');
await document.fonts.load('600 16px "Makelore CJK"', '中文');
});
await expect.poll(async () => page.evaluate(() => getComputedStyle(document.body).fontFamily))
.toContain('Makelore Latin');
await expect.poll(async () => page.evaluate(() => (
Array.from(document.fonts).some((font) => font.family === 'Makelore CJK' && font.status === 'loaded')
))).toBe(true);
});
test('shows the setup wizard on a fresh profile', async ({ page }) => {
await expect(page.getByTestId('setup-page')).toBeVisible();
await expect(page.getByTestId('setup-welcome-step')).toBeVisible();
await expect(page.getByTestId('setup-skip-button')).toBeVisible();
});
test('can skip setup and continue to the login page', async ({ page }) => {
test('can skip setup and open the public module chooser', async ({ page }) => {
await expect(page.getByTestId('setup-page')).toBeVisible();
await page.getByTestId('setup-skip-button').click();
await expect(page.getByRole('button', { name: 'Continue in browser' })).toBeVisible();
await expect(page.getByTestId('ai-module-selection-page')).toBeVisible();
await expect(page.getByTestId('main-layout')).toHaveCount(0);
await page.getByTestId('ai-module-option-programming').click();
await expect(page.getByRole('button', { name: '在浏览器中继续' })).toBeVisible();
});
test('persists skipped setup across relaunch for the same isolated profile', async ({ electronApp, launchElectronApp }) => {
const firstWindow = await electronApp.firstWindow();
await firstWindow.waitForLoadState('domcontentloaded');
await firstWindow.getByTestId('setup-skip-button').click();
await expect(firstWindow.getByRole('button', { name: 'Continue in browser' })).toBeVisible();
await expect(firstWindow.getByTestId('ai-module-selection-page')).toBeVisible();
await closeElectronApp(electronApp);
@@ -28,7 +46,7 @@ test.describe('Makelore Electron smoke flows', () => {
const relaunchedWindow = await relaunchedApp.firstWindow();
await relaunchedWindow.waitForLoadState('domcontentloaded');
await expect(relaunchedWindow.getByRole('button', { name: 'Continue in browser' })).toBeVisible();
await expect(relaunchedWindow.getByTestId('ai-module-selection-page')).toBeVisible();
await expect(relaunchedWindow.getByTestId('setup-page')).toHaveCount(0);
} finally {
await closeElectronApp(relaunchedApp);