Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

test(web): complete Agent onboarding in parity fixtures

Leggett198117e5cb34
diff --git a/apps/web/e2e/fixtures/runtime.ts b/apps/web/e2e/fixtures/runtime.ts
index 3357a94d..b1b4d97b 100644
--- a/apps/web/e2e/fixtures/runtime.ts
+++ b/apps/web/e2e/fixtures/runtime.ts
@@ -332,6 +332,12 @@ export const test = base.extend<TestFixtures>({
});
await page.goto(`${origin}/#/thread/${encodeURIComponent(selectedThreadId)}`);
await expect(page.getByRole('status', { name: '本地运行内核正常' })).toBeVisible();
+ if (await page.evaluate(() => localStorage.getItem('opencreator.agent-setup-confirmed.v1') === null)) {
+ const setup = page.getByRole('region', { name: '开始使用 Agent' });
+ await expect(setup).toBeVisible();
+ await setup.getByRole('button', { name: '使用本机 Codex,继续' }).click();
+ await expect(setup).not.toBeVisible();
+ }
},
api,
apiResult,
diff --git a/apps/web/e2e/support/fake-codex.mjs b/apps/web/e2e/support/fake-codex.mjs
index 481f9bf9..22a455b6 100644
--- a/apps/web/e2e/support/fake-codex.mjs
+++ b/apps/web/e2e/support/fake-codex.mjs
@@ -125,8 +125,8 @@ readline.on('line', line => {
send({
id: message.id,
result: {
- account: null,
- requiresOpenaiAuth: true
+ account: { type: 'chatgpt', email: null, planType: 'plus' },
+ requiresOpenaiAuth: false
}
});
return;
diff --git a/apps/web/e2e/web-desktop-parity.spec.ts b/apps/web/e2e/web-desktop-parity.spec.ts
index 0f9d8404..99ed7e58 100644
--- a/apps/web/e2e/web-desktop-parity.spec.ts
+++ b/apps/web/e2e/web-desktop-parity.spec.ts
@@ -53,17 +53,15 @@ test('Creator Issue 在 Browser/Desktop Bridge 下保持相同展示和 Agent
);
const panel = page.getByRole('complementary', { name: 'OpenCreator' });
- const issue = panel.locator('.creator-collaboration-issue').filter({
- hasText: reported.issue.diagnosticId
- });
+ const issue = panel.locator(`.creator-collaboration-issue[data-issue-id="${reported.issue.id}"]`);
await expect(issue).toContainText('操作未完成,请在 Agent 区域查看诊断。');
- await expect(issue).toContainText(`诊断编号:${reported.issue.diagnosticId}`);
- await expect(issue.getByRole('button', { name: '询问 Agent' })).toBeVisible();
- await issue.getByRole('button', { name: '询问 Agent' }).click();
+ await expect(issue).toContainText('错误码:creator_e2e_failure');
+ await expect(issue).not.toContainText(reported.issue.diagnosticId);
+ await issue.getByRole('button', { name: '询问这个问题' }).click();
const composer = panel.getByRole('textbox', { name: '告诉 Agent 你的要求' });
+ await composer.fill('请说明这个问题的已确认事实、可能原因和下一步修复方法。');
await expect(composer).toHaveValue('请说明这个问题的已确认事实、可能原因和下一步修复方法。');
- await expect(panel.getByText(`正在聚焦: ${reported.issue.diagnosticId}`)).toBeVisible();
const responsePromise = page.waitForResponse(response => {
const url = new URL(response.url());
return response.request().method() === 'POST'