mirror of
https://github.com/margrop/wrong-notebook.git
synced 2026-12-05 09:09:21 +08:00
merge: 修复 CI 中 E2E 弹窗选择器、小问得分与删除权限用例
This commit is contained in:
@@ -72,15 +72,16 @@ test('Admin can configure OpenAI settings with multi-instance support', async ({
|
||||
await page.getByRole('button', { name: '设置' }).click();
|
||||
|
||||
// 等待对话框显示
|
||||
await expect(page.getByRole('dialog')).toBeVisible({ timeout: 5000 });
|
||||
const dialog = page.getByRole('dialog');
|
||||
await expect(dialog).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Switch to AI Tab (支持中英文)
|
||||
await page.getByRole('tab', { name: /AI Provider|AI 提供商/ }).click();
|
||||
await dialog.getByRole('tab', { name: /AI Provider|AI 提供商/ }).click();
|
||||
|
||||
// Verify values match
|
||||
// First combobox should be AI Provider, second should be instance selector
|
||||
await expect(page.locator('button[role="combobox"]').first()).toHaveText('OpenAI / Compatible');
|
||||
await expect(page.locator('input[placeholder="sk-..."]')).toHaveValue(apiKey);
|
||||
await expect(page.locator('input[placeholder="https://api.openai.com/v1"]')).toHaveValue(baseURL);
|
||||
await expect(page.locator('input[placeholder="gpt-6.2-sol"]')).toHaveValue(modelName);
|
||||
await expect(dialog.locator('button[role="combobox"]').first()).toHaveText('OpenAI / Compatible');
|
||||
await expect(dialog.locator('input[placeholder="sk-..."]')).toHaveValue(apiKey);
|
||||
await expect(dialog.locator('input[placeholder="https://api.openai.com/v1"]')).toHaveValue(baseURL);
|
||||
await expect(dialog.locator('input[placeholder="gpt-6.2-sol"]')).toHaveValue(modelName);
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ test('[E2E-M06] 试卷逐小问录入结果与得分汇总', async ({ page, scen
|
||||
await expect(card.getByText('第 2 小问', { exact: true })).toBeVisible();
|
||||
await card.getByRole('radio', { name: '做对', exact: true }).first().click();
|
||||
await card.getByRole('radio', { name: '做错', exact: true }).nth(1).click();
|
||||
const scores = card.locator('input[id^="sub-score-"]');
|
||||
const scores = card.getByLabel('得分', { exact: true });
|
||||
await expect(scores).toHaveCount(2);
|
||||
await scores.nth(0).fill('2');
|
||||
await scores.nth(1).fill('1');
|
||||
|
||||
@@ -3,6 +3,8 @@ import { importImage } from './support/flows';
|
||||
import { acceptConfirmDialog } from './helpers';
|
||||
|
||||
test('没有卷别分组时也能首次校对保存,随后刷新并删除', async ({ page, scenario }) => {
|
||||
// 只有管理员账号在错题与错题本详情页保留删除入口
|
||||
await scenario.db.user.update({ where: { id: scenario.user.id }, data: { role: 'admin' } });
|
||||
await scenario.db.paperGroup.deleteMany({ where: { userId: scenario.user.id } });
|
||||
const item = await importImage(page, scenario, true);
|
||||
const group = await scenario.db.paperGroup.findUniqueOrThrow({ where: { userId_key: { userId: scenario.user.id, key: 'a' } } });
|
||||
|
||||
Reference in New Issue
Block a user