2026-01-05 01:37:32 +09:00
|
|
|
import {
|
|
|
|
|
expect,
|
|
|
|
|
getIframe,
|
|
|
|
|
getIframeContent,
|
2026-10-12 12:35:55 +09:00
|
|
|
openApp,
|
2026-01-05 01:37:32 +09:00
|
|
|
test,
|
|
|
|
|
} from "./lib/fixtures"
|
|
|
|
|
|
|
|
|
|
test.describe("Iframe Interaction", () => {
|
|
|
|
|
test("draw.io iframe loads successfully", async ({ page }) => {
|
|
|
|
|
await page.goto("/", { waitUntil: "networkidle" })
|
|
|
|
|
|
|
|
|
|
const iframe = getIframe(page)
|
|
|
|
|
await expect(iframe).toBeVisible({ timeout: 30000 })
|
|
|
|
|
|
|
|
|
|
// iframe should have loaded draw.io content
|
|
|
|
|
const frame = getIframeContent(page)
|
2026-10-08 16:20:15 +09:00
|
|
|
await expect(frame.locator(".geDiagramContainer").first()).toBeVisible({
|
|
|
|
|
timeout: 30000,
|
|
|
|
|
})
|
2026-01-05 01:37:32 +09:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test("can interact with draw.io toolbar", async ({ page }) => {
|
2026-10-12 12:35:55 +09:00
|
|
|
await openApp(page)
|
2026-01-05 01:37:32 +09:00
|
|
|
|
|
|
|
|
const frame = getIframeContent(page)
|
|
|
|
|
|
|
|
|
|
// Draw.io menu items should be accessible
|
|
|
|
|
await expect(
|
|
|
|
|
frame
|
|
|
|
|
.locator('text="Diagram"')
|
2026-05-19 08:52:02 +08:00
|
|
|
.or(frame.locator('[title*="Diagram"]'))
|
|
|
|
|
.filter({ visible: true })
|
|
|
|
|
.first(),
|
|
|
|
|
).toBeVisible({ timeout: 30000 })
|
2026-01-05 01:37:32 +09:00
|
|
|
})
|
|
|
|
|
})
|