The tree carried uncommitted work from several areas (web push, mobile screens, admin charts, test-hygiene cleanup, CI and map docs). It is landed as one commit so the release pipeline can start from a clean tree; the desktop transcript-correction behaviour shipped in the previous commit and is unchanged here.
61 lines
2.2 KiB
TypeScript
61 lines
2.2 KiB
TypeScript
// apps/web/e2e/smoke.spec.ts
|
|
// 인증 없이 접근 가능한 표면의 계약 (스모크):
|
|
// 1. 보호 라우트는 예외 없이 전부 /login 으로 되돌린다 (fail-closed)
|
|
// 2. /login 은 로고와 Google/GitHub OAuth 진입을 보여준다
|
|
// 3. /download 는 웹앱이 아니라 랜딩 사이트로 넘긴다
|
|
//
|
|
// 실행:
|
|
// npm run test:e2e --workspace=@d3ro/web
|
|
//
|
|
// 배포 환경별 차이는 E2E_BASE_URL 로 주입한다. 서버를 띄우지 않으려면 E2E_NO_SERVER=1.
|
|
|
|
import { test, expect } from '@playwright/test'
|
|
import { SITE_URLS } from '@d3ro/core/web-urls'
|
|
|
|
// 보호 라우트 전체. 라우트를 추가하면 여기에도 추가한다 (누락 = 미검증 표면).
|
|
const PROTECTED_ROUTES = [
|
|
'/dashboard',
|
|
'/dictionary',
|
|
'/commands',
|
|
'/history',
|
|
'/knowledge',
|
|
'/meetings',
|
|
'/billing',
|
|
'/chat',
|
|
'/teams',
|
|
'/record',
|
|
'/actions',
|
|
] as const
|
|
|
|
test.describe('Smoke: unauthenticated access', () => {
|
|
test('루트(/)는 /login으로 리다이렉트된다', async ({ page }) => {
|
|
await page.goto('/app')
|
|
await page.waitForURL(/\/login/, { timeout: 10000 })
|
|
expect(page.url()).toContain('/login')
|
|
})
|
|
|
|
test('/login은 로고와 Google/GitHub OAuth 버튼을 보여준다', async ({ page }) => {
|
|
await page.goto('/app/login')
|
|
|
|
await expect(page.getByText(/D3RO[- ]VOICE/i)).toBeVisible({ timeout: 10000 })
|
|
await expect(page.getByRole('button', { name: /Google/i })).toBeVisible()
|
|
await expect(page.getByRole('button', { name: /GitHub/i })).toBeVisible()
|
|
})
|
|
|
|
test('모든 보호 라우트는 미로그인 시 /login으로 되돌린다', async ({ page }) => {
|
|
for (const route of PROTECTED_ROUTES) {
|
|
await test.step(route, async () => {
|
|
await page.goto(`/app${route}`)
|
|
await page.waitForURL(/\/login/, { timeout: 10000 })
|
|
expect(page.url()).toContain('/login')
|
|
})
|
|
}
|
|
})
|
|
|
|
test('/download는 랜딩 사이트 다운로드 페이지로 넘긴다', async ({ page }) => {
|
|
const response = await page.request.get('/app/download', { maxRedirects: 0 })
|
|
|
|
expect([307, 308]).toContain(response.status())
|
|
expect(response.headers()['location']).toBe(SITE_URLS.download)
|
|
})
|
|
})
|