import { test, expect } from '@playwright/test'; test.describe('Help and Documentation', () => { test('can access help page', async ({ page }) => { await page.goto('/help'); await expect(page).toHaveURL(/\/help/); await expect(page.locator('body')).toBeVisible(); }); test('can view changelog', async ({ page }) => { await page.goto('/changelog'); await expect(page).toHaveURL(/\/changelog/); await expect(page.locator('body')).toBeVisible(); }); test('changelog shows recent updates', async ({ page }) => { await page.goto('/changelog'); // Look for changelog entries const changelogEntry = page.locator( '[data-changelog], .changelog-entry, :has-text("202")' ).first(); if (await changelogEntry.isVisible({ timeout: 2000 }).catch(() => false)) { await expect(changelogEntry).toBeVisible(); } }); test('can access API documentation', async ({ page }) => { await page.goto('/docs/api'); await expect(page).toHaveURL(/\/docs\/api/); await expect(page.locator('body')).toBeVisible(); }); test('API docs show endpoints', async ({ page }) => { await page.goto('/docs/api'); // Look for API endpoint documentation const endpoint = page.locator( 'code:has-text("/api"), pre:has-text("GET"), pre:has-text("POST")' ).first(); if (await endpoint.isVisible({ timeout: 2000 }).catch(() => false)) { await expect(endpoint).toBeVisible(); } }); test('can search help documentation', async ({ page }) => { await page.goto('/help'); // Look for search input const searchInput = page.locator('input[type="search"], input[placeholder*="Search"]').first(); if (await searchInput.isVisible()) { await searchInput.fill('device'); await page.waitForTimeout(500); } }); test('can navigate help categories', async ({ page }) => { await page.goto('/help'); // Look for category links or nav const categoryLink = page.locator( 'a[href*="/help/"], nav a, [role="navigation"] a' ).first(); if (await categoryLink.isVisible()) { await categoryLink.click(); await page.waitForTimeout(500); } }); });