mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-28 11:25:00 +00:00
Add a third peer tab 'CLI' to LandingQuickStartSection that surfaces the official install command 'npm i -g @astron-team/skillhub'. Layout uses grid-cols-1 md:grid-cols-3 so mobile shows tabs stacked and desktop shows three equal-width columns. Addresses iflytek/skillhub#419 (homepage Quick Start part only).
50 lines
1.9 KiB
TypeScript
50 lines
1.9 KiB
TypeScript
import { expect, test } from '@playwright/test'
|
|
import { setEnglishLocale } from './helpers/auth-fixtures'
|
|
|
|
test.describe('Landing Quick Start CLI Tab (Real API)', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await setEnglishLocale(page)
|
|
})
|
|
|
|
test('renders three peer tabs and exposes the CLI install command', async ({ page }) => {
|
|
await page.goto('/')
|
|
|
|
const agentTab = page.getByRole('button', { name: 'I am Agent', exact: true })
|
|
const humanTab = page.getByRole('button', { name: 'I am Human', exact: true })
|
|
const cliTab = page.getByRole('button', { name: 'CLI', exact: true })
|
|
|
|
await expect(agentTab).toBeVisible()
|
|
await expect(humanTab).toBeVisible()
|
|
await expect(cliTab).toBeVisible()
|
|
|
|
await expect(agentTab).toHaveAttribute('aria-pressed', 'true')
|
|
|
|
await cliTab.click()
|
|
await expect(cliTab).toHaveAttribute('aria-pressed', 'true')
|
|
await expect(agentTab).toHaveAttribute('aria-pressed', 'false')
|
|
await expect(humanTab).toHaveAttribute('aria-pressed', 'false')
|
|
|
|
await expect(
|
|
page.getByText('Install the SkillHub CLI locally to run skillhub install for skills.'),
|
|
).toBeVisible()
|
|
await expect(page.getByText('npm i -g @astron-team/skillhub', { exact: true })).toBeVisible()
|
|
})
|
|
|
|
test('agent and human tabs keep their original commands', async ({ page }) => {
|
|
await page.goto('/')
|
|
|
|
const agentTab = page.getByRole('button', { name: 'I am Agent', exact: true })
|
|
const humanTab = page.getByRole('button', { name: 'I am Human', exact: true })
|
|
|
|
await expect(
|
|
page.getByText(/Read .+\/registry\/skill\.md and follow the instructions/),
|
|
).toBeVisible()
|
|
|
|
await humanTab.click()
|
|
await expect(humanTab).toHaveAttribute('aria-pressed', 'true')
|
|
await expect(page.getByText('npx clawhub search <keyword>', { exact: true })).toBeVisible()
|
|
|
|
await agentTab.click()
|
|
await expect(agentTab).toHaveAttribute('aria-pressed', 'true')
|
|
})
|
|
})
|