Files
next-ai-draw-io/tests/e2e/settings.spec.ts
dayuan.jiang d517268dbe fix: improve test infrastructure based on PR review
- Fix double build in CI: remove redundant build from playwright webServer
- Export chat helpers from shared module for proper unit testing
- Replace waitForTimeout with explicit waits in E2E tests
- Add data-testid attributes to settings and new chat buttons
- Add list reporter for CI to show failures in logs
- Add Playwright browser caching to speed up CI
- Add vitest coverage configuration
- Fix conditional test assertions to use test.skip() instead of silent pass
- Remove unused variables flagged by linter
2026-01-04 22:25:50 +09:00

43 lines
1.5 KiB
TypeScript

import { expect, test } from "@playwright/test"
test.describe("Settings", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/", { waitUntil: "networkidle" })
await page
.locator("iframe")
.waitFor({ state: "visible", timeout: 30000 })
})
test("settings dialog opens", async ({ page }) => {
const settingsButton = page.locator('[data-testid="settings-button"]')
await expect(settingsButton).toBeVisible()
await settingsButton.click()
const dialog = page.locator('[role="dialog"]')
await expect(dialog).toBeVisible({ timeout: 5000 })
})
test("language selection is available", async ({ page }) => {
const settingsButton = page.locator('[data-testid="settings-button"]')
await settingsButton.click()
const dialog = page.locator('[role="dialog"]')
await expect(dialog).toBeVisible({ timeout: 5000 })
// Should have language selector showing English
await expect(dialog.locator('text="English"')).toBeVisible()
})
test("draw.io theme toggle exists", async ({ page }) => {
const settingsButton = page.locator('[data-testid="settings-button"]')
await settingsButton.click()
const dialog = page.locator('[role="dialog"]')
await expect(dialog).toBeVisible({ timeout: 5000 })
// Should have draw.io theme option (sketch or minimal)
const themeText = dialog.locator("text=/sketch|minimal/i")
await expect(themeText.first()).toBeVisible()
})
})