Unverified 提交 8f9e535c authored 作者: wwwillchen-bot's avatar wwwillchen-bot 提交者: GitHub

fix(e2e): fix themes_management test selectors for theme name inputs (#2728)

## Summary - Fixed ambiguous `getByLabel("Theme Name")` selectors in themes management E2E tests - Used specific element IDs (`#manual-name`, `#ai-name`) for create dialogs where multiple matching inputs exist - Scoped edit dialog selectors to the dialog context to avoid matching create form inputs ## Test plan - Run the themes_management E2E tests: `npx playwright test e2e-tests/themes_management.spec.ts` - Verify all theme CRUD operations, chat input creation, and AI generator flows pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2728" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> Co-authored-by: 's avatarWill Chen <willchen90@gmail.com> Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
上级 fc62c32e
...@@ -27,7 +27,7 @@ test("themes management - CRUD operations", async ({ po }) => { ...@@ -27,7 +27,7 @@ test("themes management - CRUD operations", async ({ po }) => {
await po.page.getByRole("tab", { name: "Manual Configuration" }).click(); await po.page.getByRole("tab", { name: "Manual Configuration" }).click();
// Fill in manual configuration form // Fill in manual configuration form
await po.page.getByLabel("Theme Name").fill("My Test Theme"); await po.page.locator("#manual-name").fill("My Test Theme");
await po.page await po.page
.getByLabel("Description (optional)") .getByLabel("Description (optional)")
.fill("A test theme description"); .fill("A test theme description");
...@@ -53,9 +53,12 @@ test("themes management - CRUD operations", async ({ po }) => { ...@@ -53,9 +53,12 @@ test("themes management - CRUD operations", async ({ po }) => {
po.page.getByRole("dialog").getByText("Edit Theme"), po.page.getByRole("dialog").getByText("Edit Theme"),
).toBeVisible(); ).toBeVisible();
// Update the theme details // Update the theme details (edit dialog uses different input IDs)
await po.page.getByLabel("Theme Name").clear(); await po.page.getByRole("dialog").getByLabel("Theme Name").clear();
await po.page.getByLabel("Theme Name").fill("Updated Theme"); await po.page
.getByRole("dialog")
.getByLabel("Theme Name")
.fill("Updated Theme");
await po.page await po.page
.getByLabel("Description (optional)") .getByLabel("Description (optional)")
.fill("Updated description"); .fill("Updated description");
...@@ -122,7 +125,7 @@ test("themes management - create theme from chat input", async ({ po }) => { ...@@ -122,7 +125,7 @@ test("themes management - create theme from chat input", async ({ po }) => {
await po.page.getByRole("tab", { name: "Manual Configuration" }).click(); await po.page.getByRole("tab", { name: "Manual Configuration" }).click();
// Fill in manual configuration form // Fill in manual configuration form
await po.page.getByLabel("Theme Name").fill("Chat Input Theme"); await po.page.locator("#manual-name").fill("Chat Input Theme");
await po.page await po.page
.getByLabel("Description (optional)") .getByLabel("Description (optional)")
.fill("Created from chat input"); .fill("Created from chat input");
...@@ -236,7 +239,7 @@ test("themes management - AI generator flow", async ({ po }) => { ...@@ -236,7 +239,7 @@ test("themes management - AI generator flow", async ({ po }) => {
await expect(generateButton).toBeDisabled(); await expect(generateButton).toBeDisabled();
// Fill in theme details // Fill in theme details
await po.page.getByLabel("Theme Name").fill("AI Generated Theme"); await po.page.locator("#ai-name").fill("AI Generated Theme");
await po.page await po.page
.getByLabel("Description (optional)") .getByLabel("Description (optional)")
.fill("Created via AI generator"); .fill("Created via AI generator");
...@@ -306,7 +309,7 @@ test("themes management - AI generator from website URL", async ({ po }) => { ...@@ -306,7 +309,7 @@ test("themes management - AI generator from website URL", async ({ po }) => {
await expect(generateButton).toBeDisabled(); await expect(generateButton).toBeDisabled();
// Fill in theme details // Fill in theme details
await po.page.getByLabel("Theme Name").fill("Website Theme"); await po.page.locator("#ai-name").fill("Website Theme");
await po.page await po.page
.getByLabel("Description (optional)") .getByLabel("Description (optional)")
.fill("Generated from website"); .fill("Generated from website");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论