Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
working-directory: ./website
run: npx playwright install --with-deps chromium

- name: Copy documentation files to public directory
run: |
mkdir -p website/public/docs
cp -r docs/anchors website/public/docs/
cp docs/about.adoc website/public/docs/
cp CONTRIBUTING.adoc website/public/

- name: Run E2E tests
working-directory: ./website
run: npm run test:e2e
Expand Down
1 change: 1 addition & 0 deletions website/src/components/doc-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function loadDocContent(docPath) {
const htmlContent = asciidocEngine.convert(adocContent, {
safe: 'secure',
attributes: {
'showtitle': true,
'source-highlighter': 'highlight.js',
'icons': 'font',
'sectanchors': true,
Expand Down
34 changes: 17 additions & 17 deletions website/tests/e2e/website.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ test.describe('Homepage - Card Grid', () => {
await expect(page.locator('#lang-toggle')).toBeVisible()
await expect(page.locator('#lang-toggle')).toHaveText('DE')

// Check navigation links
await expect(page.locator('a[data-route="/"]')).toContainText('Catalog')
await expect(page.locator('a[data-route="/about"]')).toContainText('About')
await expect(page.locator('a[data-route="/contributing"]')).toContainText('Contributing')
// Check navigation links (use .first() to select desktop nav, not mobile)
await expect(page.locator('a[data-route="/"]').first()).toContainText('Catalog')
await expect(page.locator('a[data-route="/about"]').first()).toContainText('About')
await expect(page.locator('a[data-route="/contributing"]').first()).toContainText('Contributing')
})

test('should display card grid with categories', async ({ page }) => {
Expand Down Expand Up @@ -218,12 +218,12 @@ test.describe('Routing - Documentation Pages', () => {
// URL should update
expect(page.url()).toContain('#/about')

// About content should be visible
await expect(page.locator('#doc-content')).toBeVisible()
await expect(page.locator('h1')).toContainText(/About|What are/)
// Wait for AsciiDoc content to load and check h1 in content area (not header)
await page.waitForSelector('#doc-content h1', { timeout: 10000 })
await expect(page.locator('#doc-content h1')).toContainText(/About|What are/)

// Active nav link should be highlighted
const aboutLink = page.locator('a[data-route="/about"]')
const aboutLink = page.locator('a[data-route="/about"]').first()
await expect(aboutLink).toHaveClass(/font-semibold/)
})

Expand All @@ -234,12 +234,12 @@ test.describe('Routing - Documentation Pages', () => {
// URL should update
expect(page.url()).toContain('#/contributing')

// Contributing content should be visible
await expect(page.locator('#doc-content')).toBeVisible()
await expect(page.locator('h1')).toContainText(/Contributing/)
// Wait for AsciiDoc content to load and check h1 in content area (not header)
await page.waitForSelector('#doc-content h1', { timeout: 10000 })
await expect(page.locator('#doc-content h1')).toContainText(/Contributing/)

// Active nav link should be highlighted
const contributingLink = page.locator('a[data-route="/contributing"]')
const contributingLink = page.locator('a[data-route="/contributing"]').first()
await expect(contributingLink).toHaveClass(/font-semibold/)
})

Expand All @@ -256,18 +256,18 @@ test.describe('Routing - Documentation Pages', () => {
// Card grid should be visible
await expect(page.locator('.anchor-card').first()).toBeVisible()

// Catalog link should be highlighted
const catalogLink = page.locator('a[data-route="/"]')
// Catalog link should be highlighted (use .first() to select desktop nav)
const catalogLink = page.locator('a[data-route="/"]').first()
await expect(catalogLink).toHaveClass(/font-semibold/)
})

test('should handle direct URL to About page', async ({ page }) => {
// Navigate directly to About
await page.goto('/#/about')

// About content should be visible
await expect(page.locator('#doc-content')).toBeVisible()
await expect(page.locator('h1')).toContainText(/About|What are/)
// Wait for AsciiDoc content to load and check h1 in content area (not header)
await page.waitForSelector('#doc-content h1', { timeout: 10000 })
await expect(page.locator('#doc-content h1')).toContainText(/About|What are/)
})

test('should handle browser back button', async ({ page }) => {
Expand Down