skillhub/web/e2e/settings-pages.spec.ts
XiaoSeS fc7c59534a
fix(platform): harden sessions, scanner recovery, and CLI guidance (#801)
* fix(auth): recover from unreadable sessions

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(scanner): defer unavailable scan tasks safely

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(web): prefer the SkillHub CLI install command

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(auth): decode session cookies during recovery

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(runtime): address scanner and session review findings

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(scanner): defer all server-side outages

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* docs(scanner): clarify deferred failure semantics

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* test(scanner): cover recovery boundaries

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* fix(scanner): register startup hook on router

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

* test(e2e): align install defaults and reuse auth session

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

---------

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-09-02 20:15:42 +08:00

37 lines
1.5 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { setEnglishLocale } from './helpers/auth-fixtures'
import { registerSession } from './helpers/session'
test.describe('Settings Pages (Real API)', () => {
test.use({ baseURL: 'http://127.0.0.1:3000' })
test.beforeEach(async ({ page }, testInfo) => {
await setEnglishLocale(page)
await registerSession(page, testInfo, { allowMockSession: false })
})
test('opens profile settings page', async ({ page }) => {
await page.goto('/settings/profile')
await expect(page.getByRole('heading', { name: 'Profile Settings' })).toBeVisible()
})
test('navigates to reset-password page from profile settings', async ({ page }) => {
await page.goto('/settings/profile')
await page.getByRole('button', { name: 'Reset Password' }).click()
await expect(page).toHaveURL('/reset-password')
await expect(page.getByRole('heading', { name: 'Reset Password' })).toBeVisible()
})
test('shows validation when current password is missing', async ({ page }) => {
await page.goto('/settings/security')
await expect(page.getByRole('heading', { name: 'Security Settings' })).toBeVisible()
await page.getByRole('button', { name: 'Update Password' }).click()
await expect(page.getByText('Please enter your current password')).toBeVisible()
})
test('opens notification settings page', async ({ page }) => {
await page.goto('/settings/notifications')
await expect(page.getByRole('heading', { name: 'Notification Settings' })).toBeVisible()
})
})