guanghu/e2e/vault-picker-local.spec.ts
冰朔 8739805f99
Some checks failed
Auto-update PR branches / Update open PR branches (push) Has been cancelled
CI / Frontend Static Quality Checks (push) Has been cancelled
CI / Frontend Tests & Coverage (push) Has been cancelled
CI / Rust Tests & Quality Checks (push) Has been cancelled
CI / Linux build verification (push) Has been cancelled
Release (Alpha) / Compute alpha version (push) Has been cancelled
Release (Alpha) / Build release artifacts (push) Has been cancelled
Release (Alpha) / GitHub Release (alpha) (push) Has been cancelled
Release (Alpha) / Update docs and release pages (push) Has been cancelled
Deploy docs / Build VitePress site (push) Has been cancelled
Deploy docs / Deploy to GitHub Pages (push) Has been cancelled
光湖开源源码快照 · Tolaria AGPL 分叉基线 · 独立更新链
2026-07-05 17:45:16 +08:00

40 lines
1.6 KiB
TypeScript

import { test, expect } from '@playwright/test'
test.describe('Vault Picker Local Options', () => {
test.beforeEach(async ({ page }) => {
await page.goto('http://localhost:5240')
await page.waitForSelector('text=notes', { timeout: 10000 })
})
test('vault menu shows local folder options', async ({ page }) => {
// Screenshot before opening menu
await page.screenshot({ path: 'test-results/vault-picker-before.png', fullPage: true })
// Click the vault button in the status bar to open the menu
const vaultButton = page.locator('[title="Switch vault"]')
await expect(vaultButton).toBeVisible()
await vaultButton.click()
// Wait for menu to appear
await page.waitForTimeout(300)
// Verify all three options are visible
await expect(page.locator('text=Open local folder')).toBeVisible()
await expect(page.locator('text=Create new vault')).toBeVisible()
await expect(page.locator('text=Connect GitHub repo')).toBeVisible()
// Screenshot with menu open showing all options
await page.screenshot({ path: 'test-results/vault-picker-menu-open.png', fullPage: true })
})
test('vault menu options have correct test IDs', async ({ page }) => {
const vaultButton = page.locator('[title="Switch vault"]')
await vaultButton.click()
await page.waitForTimeout(200)
await expect(page.locator('[data-testid="vault-menu-open-local"]')).toBeVisible()
await expect(page.locator('[data-testid="vault-menu-create-new"]')).toBeVisible()
await expect(page.locator('[data-testid="vault-menu-connect-github"]')).toBeVisible()
})
})