Files
Talks/e2e/flows.spec.js
Le Prévost-Corvellec Arnault 354c8cd9ef Add Makefile, package.json, and initial configuration for VitePress and Slidev integration
- Introduced a Makefile for streamlined commands related to building, running, and managing presentations.
- Created package.json to define project metadata, dependencies, and scripts for development and testing.
- Added .gitignore entries to exclude build artifacts and temporary files from version control.
- Included playwright.config.mjs for end-to-end testing setup with Playwright.
- Added README.md for project documentation, outlining setup instructions and development guidelines.
2026-04-11 15:59:20 +02:00

70 lines
3.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// @ts-check
import { test, expect } from '@playwright/test'
test.describe('Portail (build statique)', () => {
test('accueil : titre, intro, liens rapides, grille présentations', async ({ page }) => {
await page.goto('/')
await expect(page.getByRole('heading', { name: 'Talks', level: 1 })).toBeVisible()
await expect(page.getByRole('heading', { name: 'À propos de ce site' })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Liens rapides' })).toBeVisible()
await expect(page.getByRole('heading', { name: 'Présentations' })).toBeVisible()
const qrCanvases = page.locator('.qr-section canvas')
// Un seul QR sur l’accueil quand talkRepoUrl est vide (QR dépôt optionnel).
await expect(qrCanvases).toHaveCount(1)
const cards = page.locator('.talks-section--home .talk-card')
await expect(cards).toHaveCount(2)
})
test('navigation : liste → fiche → href slides cohérents', async ({ page }) => {
await page.goto('/presentations/')
await expect(page.getByRole('heading', { name: 'Présentations', level: 1 })).toBeVisible()
await expect(page.locator('article.talk-card--list')).toHaveCount(2)
await page
.locator('article.talk-card--list')
.filter({ hasText: 'Kubernetes Operators' })
.getByRole('link', { name: 'Kubernetes Operators' })
.click()
await expect(page).toHaveURL(/\/presentations\/kubernetes-operators\/?$/)
const slidesLink = page.getByRole('link', { name: 'Voir les slides' })
await expect(slidesLink).toHaveAttribute('href', /\/slides\/kubernetes-operators\/1\/?$/)
})
test('fiche kubernetes-operators : clic « Voir les slides » ouvre la 1ère planche Slidev', async ({ page }) => {
await page.goto('/presentations/kubernetes-operators/')
await expect(page.getByRole('heading', { name: 'Kubernetes Operators', level: 1 })).toBeVisible()
await page.getByRole('link', { name: 'Voir les slides' }).click()
await expect(page).toHaveURL(/\/slides\/kubernetes-operators\/1\/?$/)
await expect(page.locator('#app')).toBeAttached()
await expect(page).toHaveTitle(/Kubernetes Operators/i)
})
test('fiche : boutons slides + bloc QR deck', async ({ page }) => {
await page.goto('/presentations/spring-ai/')
await expect(page.getByRole('heading', { name: 'Spring AI', level: 1 })).toBeVisible()
await expect(page.getByRole('link', { name: 'Voir les slides' })).toHaveAttribute(
'href',
/\/slides\/spring-ai\/1\/?$/,
)
await expect(page.getByRole('heading', { name: 'Partager les slides' })).toBeVisible()
await expect(page.locator('.qr-deck canvas')).toHaveCount(1)
})
test('deck Slidev servi sous /slides/<slug>/1', async ({ page }) => {
await page.goto('/slides/kubernetes-operators/1')
await expect(page.locator('#app')).toBeAttached()
await expect(page).toHaveTitle(/Kubernetes Operators/i)
})
test('lien accueil → liste complète', async ({ page }) => {
await page.goto('/')
await page.getByRole('link', { name: /Voir toutes les présentations/ }).click()
await expect(page).toHaveURL(/\/presentations\/?$/)
})
})