From 68c7914b80eae0b25fb1aadcb24e276c8df744d2 Mon Sep 17 00:00:00 2001 From: fanziqing Date: Fri, 14 Aug 2026 17:01:25 +0800 Subject: [PATCH] test: cover Ark provider setup end to end --- surfaces/gui/e2e/fixtures.ts | 8 +++++++ surfaces/gui/e2e/settings.spec.ts | 38 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/surfaces/gui/e2e/fixtures.ts b/surfaces/gui/e2e/fixtures.ts index e6dfa409..ec4deba7 100644 --- a/surfaces/gui/e2e/fixtures.ts +++ b/surfaces/gui/e2e/fixtures.ts @@ -45,6 +45,10 @@ const SETTINGS = { model_labels: { "anthropic:claude-opus-4-8": "Claude Opus 4.8 · Anthropic", "zai:glm-5.2": "GLM-5.2 · Z AI", + "ark:dola-seed-evolving-latest-version": "Dola Seed Evolving · BytePlus Ark", + "ark:dola-seed-2-1-turbo-260628": "Dola Seed 2.1 Turbo · BytePlus Ark", + "ark-agent-plan-cn:doubao-seed-evolving": "Doubao Seed Evolving · Volcengine Agent Plan", + "ark-agent-plan-cn:doubao-seed-2.1-turbo": "Doubao Seed 2.1 Turbo · Volcengine Agent Plan", }, // Context windows (subset — mirrors /v1/settings.model_context_windows); drives the // composer usage chip's context-fill meter. @@ -336,6 +340,10 @@ const PROVIDERS = [ { name: "anthropic", title: "Claude (Anthropic)", needs_key: true, fields: [{ key: "api_key", label: "API key", secret: true, required: true, help: "", placeholder: "sk-…" }], configured: true, values: {}, suggested_models: ["claude-opus-4-8"], key_set_at: null, last_used_at: null }, // zai: an OpenAI-compatible vendor — unconfigured, with a prefilled editable endpoint + blurb. { name: "zai", title: "Z AI (GLM)", needs_key: true, blurb: "Uses Z AI's OpenAI-compatible API — the endpoint is prefilled, just add your key.", fields: [{ key: "api_key", label: "Z AI API key", secret: true, required: true, help: "", placeholder: "" }, { key: "base_url", label: "Endpoint", secret: false, required: false, help: "Prefilled with Z AI's international endpoint.", placeholder: "https://api.z.ai/api/paas/v4", default: "https://api.z.ai/api/paas/v4" }], configured: false, values: {}, suggested_models: ["glm-5.2"], key_set_at: null, last_used_at: null }, + // Ark uses two provider identities: BytePlus pay-as-you-go and Volcengine Agent Plan CN + // have independent credentials, endpoints, and strict curated model lists. + { name: "ark", title: "BytePlus Ark", needs_key: true, blurb: "Uses BytePlus Ark's OpenAI-compatible Responses API — the endpoint is prefilled, just add your key.", fields: [{ key: "api_key", label: "BytePlus Ark API key", secret: true, required: true, help: "", placeholder: "" }, { key: "base_url", label: "Endpoint", secret: false, required: false, help: "BytePlus Ark's Asia Pacific endpoint.", placeholder: "https://ark.ap-southeast.bytepluses.com/api/v3", default: "https://ark.ap-southeast.bytepluses.com/api/v3" }], configured: false, values: {}, suggested_models: ["dola-seed-evolving-latest-version", "dola-seed-2-1-turbo-260628"], key_set_at: null, last_used_at: null }, + { name: "ark-agent-plan-cn", title: "Volcengine Ark Agent Plan", needs_key: true, blurb: "Uses Volcengine Ark Agent Plan's OpenAI-compatible Responses API — the endpoint is prefilled, just add your key.", fields: [{ key: "api_key", label: "Volcengine Ark Agent Plan API key", secret: true, required: true, help: "", placeholder: "" }, { key: "base_url", label: "Endpoint", secret: false, required: false, help: "Volcengine Ark Agent Plan's China (Beijing) endpoint.", placeholder: "https://ark.cn-beijing.volces.com/api/plan/v3", default: "https://ark.cn-beijing.volces.com/api/plan/v3" }], configured: false, values: {}, suggested_models: ["doubao-seed-evolving", "doubao-seed-2.1-turbo"], key_set_at: null, last_used_at: null }, // ollama: keyless local provider — "configured" without proving anything runs; the // onboarding gallery shows "No key needed" and its form is endpoint + Detect (§39). { name: "ollama", title: "Ollama (local models)", needs_key: false, fields: [{ key: "base_url", label: "Endpoint", secret: false, required: false, help: "", placeholder: "http://127.0.0.1:11434", default: "http://127.0.0.1:11434" }], configured: true, values: {}, suggested_models: ["qwen3-coder:30b"], key_set_at: null, last_used_at: null }, diff --git a/surfaces/gui/e2e/settings.spec.ts b/surfaces/gui/e2e/settings.spec.ts index 1bee81fa..1d1b6a5e 100644 --- a/surfaces/gui/e2e/settings.spec.ts +++ b/surfaces/gui/e2e/settings.spec.ts @@ -71,6 +71,44 @@ test("Models: provider gallery states; vendor form previews models", async ({ pa await expect(page.getByTestId("set-provider-openai")).toBeVisible(); }); +test("Models: BytePlus and Volcengine Ark stay visually and operationally separate", async ({ page }) => { + await page.goto("/"); + await page.getByTestId("account-row").click(); + await page.getByRole("button", { name: "Settings", exact: true }).click(); + await page.getByRole("button", { name: "Models", exact: true }).click(); + + const byteplusCard = page.getByTestId("set-provider-ark"); + const volcengineCard = page.getByTestId("set-provider-ark-agent-plan-cn"); + await expect(byteplusCard).toContainText("BytePlus Ark"); + await expect(volcengineCard).toContainText("Volcengine Ark Agent Plan"); + const byteplusLogo = await byteplusCard.locator("img").getAttribute("src"); + const volcengineLogo = await volcengineCard.locator("img").getAttribute("src"); + expect(byteplusLogo).toBeTruthy(); + expect(volcengineLogo).toBeTruthy(); + expect(byteplusLogo).not.toBe(volcengineLogo); + + await byteplusCard.click(); + await page.getByTestId("set-endpoint-link").click(); + await expect(page.getByTestId("set-field-base_url")).toHaveValue( + "https://ark.ap-southeast.bytepluses.com/api/v3", + ); + let preview = page.getByTestId("model-preview"); + await expect(preview).toContainText("Dola Seed Evolving · BytePlus Ark"); + await expect(preview).toContainText("Dola Seed 2.1 Turbo · BytePlus Ark"); + await expect(preview).not.toContainText("Doubao Seed"); + + await page.getByTestId("set-back").click(); + await volcengineCard.click(); + await page.getByTestId("set-endpoint-link").click(); + await expect(page.getByTestId("set-field-base_url")).toHaveValue( + "https://ark.cn-beijing.volces.com/api/plan/v3", + ); + preview = page.getByTestId("model-preview"); + await expect(preview).toContainText("Doubao Seed Evolving · Volcengine Agent Plan"); + await expect(preview).toContainText("Doubao Seed 2.1 Turbo · Volcengine Agent Plan"); + await expect(preview).not.toContainText("Dola Seed"); +}); + // UX-021: a configured provider's form shows the in-field saved state and the Remove key… // affordance; removing reverts the card to "Not set up". test("Models: Remove key reverts a configured provider", async ({ page }) => {