Files
landing-builder/tests/e2e/wysiwyg-guides-multiselect.e2e.ts
T
jaybe fc0134ffb5
CI / test (push) Failing after 1m5s
auto: PR for feat/export-css-tokens-deep (#83)
Automated PR created on push to feat/export-css-tokens-deep

Reviewed-on: #83
Co-authored-by: Jaybe <master@jaybe.dev>
Co-committed-by: Jaybe <master@jaybe.dev>
2025-11-17 10:41:27 +00:00

39 lines
1.3 KiB
TypeScript

import { test, expect } from '@playwright/test'
const wysiwygUrl = '/en/wysiwyg'
test.describe('WYSIWYG - Guides toggle and multiselect live region', () => {
test('toggles guides and announces multiselect in aria-live', async ({ page }) => {
await page.goto(wysiwygUrl)
// Canvas and live region present
const canvas = page.getByTestId('wysiwyg-canvas')
await expect(canvas).toBeVisible()
const live = page.getByTestId('aria-live')
await expect(live).toContainText(/선택\s*0개/)
// Add two text objects
const addText = page.getByRole('button', { name: /^Add Text$/i })
await addText.click()
await addText.click()
// Marquee select both
const box = await canvas.boundingBox()
if (!box) throw new Error('canvas not found')
await page.mouse.move(box.x + 40, box.y + 40)
await page.mouse.down()
await page.mouse.move(box.x + 300, box.y + 200)
await page.mouse.up()
await expect(live).toContainText(/선택\s*2개/)
// Guides toggle
const guidesBtn = page.getByRole('button', { name: /Guides/i })
await expect(guidesBtn).toHaveAttribute('aria-pressed', 'true')
await guidesBtn.click()
await expect(guidesBtn).toHaveAttribute('aria-pressed', 'false')
await guidesBtn.click()
await expect(guidesBtn).toHaveAttribute('aria-pressed', 'true')
})
})