guanghu/e2e/keyboard-shortcuts.spec.ts
Guanghu Domestic Migration 9b41d51231
Some checks are pending
Auto-update PR branches / Update open PR branches (push) Waiting to run
CI / Frontend Static Quality Checks (push) Waiting to run
CI / Frontend Tests & Coverage (push) Waiting to run
CI / Rust Tests & Quality Checks (push) Waiting to run
CI / Linux build verification (push) Waiting to run
Deploy docs / Build VitePress site (push) Waiting to run
Deploy docs / Deploy to GitHub Pages (push) Blocked by required conditions
Release (Alpha) / Compute alpha version (push) Waiting to run
Release (Alpha) / Build release artifacts (push) Blocked by required conditions
Release (Alpha) / GitHub Release (alpha) (push) Blocked by required conditions
Release (Alpha) / Update docs and release pages (push) Blocked by required conditions
chore: import sanitized domestic snapshot for REPO-004
Source snapshot: 514ab1975951d94342ea38e64101d5a0f1c51c77
2026-07-17 15:55:28 +08:00

44 lines
1.3 KiB
TypeScript

import { test, expect } from '@playwright/test'
test('Cmd+N opens create note dialog', async ({ page }) => {
await page.goto('/')
await page.waitForTimeout(500)
await page.keyboard.press('Meta+n')
await page.waitForTimeout(200)
await expect(page.locator('.create-dialog')).toBeVisible()
await expect(page.locator('.create-dialog__title')).toHaveText('Create New Note')
})
test('Cmd+S shows save toast', async ({ page }) => {
await page.goto('/')
await page.waitForTimeout(500)
await page.keyboard.press('Meta+s')
await page.waitForTimeout(200)
await expect(page.locator('.toast')).toBeVisible()
await expect(page.locator('.toast')).toHaveText('Saved')
await page.screenshot({ path: 'test-results/save-toast.png', fullPage: true })
})
test('Cmd+W closes the active tab', async ({ page }) => {
await page.goto('/')
await page.waitForTimeout(500)
// Open a note
await page.click('.note-list__item')
await page.waitForTimeout(300)
await expect(page.locator('.editor__tab--active')).toBeVisible()
// Close it with Cmd+W
await page.keyboard.press('Meta+w')
await page.waitForTimeout(300)
// Tab should be gone, placeholder should show
await expect(page.locator('.editor__tab')).not.toBeVisible()
await expect(page.locator('.editor__placeholder')).toBeVisible()
})