mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-09 03:17:52 +00:00
Migrated from local desktop work (rescued from un-pushed commit 3b970865). 64 test cases with stable semantic selectors, covering pages that were previously untested.
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
import { expect, test } from '@playwright/test'
|
|
import { setEnglishLocale } from './helpers/auth-fixtures'
|
|
import { registerSession } from './helpers/session'
|
|
|
|
test.describe('My Namespaces Full Flow (Real API)', () => {
|
|
test.describe.configure({ timeout: 120_000 })
|
|
|
|
test.beforeEach(async ({ page }, testInfo) => {
|
|
await setEnglishLocale(page)
|
|
await registerSession(page, testInfo)
|
|
})
|
|
|
|
test('TC_NS_001: displays my namespaces page with title', async ({ page }) => {
|
|
await page.goto('/dashboard/namespaces')
|
|
|
|
await expect(page.getByRole('heading', { name: 'My Namespaces' })).toBeVisible()
|
|
})
|
|
|
|
test('TC_NS_002: shows namespace cards or empty state', async ({ page }) => {
|
|
await page.goto('/dashboard/namespaces')
|
|
|
|
await page.waitForTimeout(1000)
|
|
const hasContent = await page.getByText(/Global|Personal|My Namespaces|No namespaces/i).first().isVisible().catch(() => false)
|
|
|
|
expect(hasContent).toBeTruthy()
|
|
})
|
|
|
|
test('TC_NS_003: global namespace section is visible', async ({ page }) => {
|
|
await page.goto('/dashboard/namespaces')
|
|
|
|
await page.waitForTimeout(1000)
|
|
const hasGlobal = await page.getByRole('heading', { name: 'Global' }).or(page.getByText('Global').first()).isVisible().catch(() => false)
|
|
expect(hasGlobal).toBeTruthy()
|
|
})
|
|
|
|
test('TC_NS_004: namespace cards show member management links', async ({ page }) => {
|
|
await page.goto('/dashboard/namespaces')
|
|
|
|
await page.waitForTimeout(1000)
|
|
const hasLink = await page.getByRole('link').first().isVisible().catch(() => false)
|
|
expect(hasLink).toBeTruthy()
|
|
})
|
|
})
|