133feff75d
6 chantiers v1 sur 7 livrés (DataTable refonte reportée car nécessite 2-3j en propre — TanStack Table + virtualisation + filter builder). v1-A — Tests (4 → 22 fichiers) : - Avatar, AvatarGroup, UserCard, MetricCard, ProfileHeader, Tooltip, Sheet, Drawer, Slider, ToggleGroup, Tabs, Pagination, Accordion, Switch, Badge, ConfirmDialog, Popover, Menu, Text, PricingCard, FeatureCard, Toast — chacun avec render + clavier + axe-core. v1-B — Storybook (7 → 23 fichiers) : - Avatar, UserCard, ProfileHeader, MetricCard, PricingCard, FeatureCard, Sheet (4 sides), HoverCard, Slider, ToggleGroup, Menu+ContextMenu, Toast (avec démo "Empiler 5"), Tabs, Pagination, Accordion, Badge. v1-D — Visual regression Playwright : - playwright.config.ts (light + dark, threshold strict 0.2) - e2e/visual.spec.ts (20 stories critiques) - Step CI + upload report en cas de fail v1-E — Site doc Starlight rempli : - 11 pages composants détaillées (Button, Input, Tooltip, Dialog, Toast, Avatar, ThemePicker, MetricCard, PricingCard, ToggleGroup, Slider) avec API, anatomie, do/don't, A11y. v1-F — Publishing Verdaccio : - verdaccio/config.yaml, docker-compose.verdaccio.yml, .npmrc - README setup local + déploiement prod + backups + sécurité v1-G — Gouvernance : - LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md - CODEOWNERS, PR template, 3 issue templates (bug/feature/rfc) Bug fix bonus : tooltip dark mode (text-primary comme bg + text-inverse comme texte → blanc-sur-blanc invisible). Remplacé par neutral-900/0 en light + bg-raised/text-primary en dark. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
/**
|
|
* DSMMG — Playwright config (visual regression sur Storybook).
|
|
*
|
|
* Stratégie : on build Storybook en static, on le sert localement,
|
|
* on prend des screenshots des stories critiques (light + dark) et
|
|
* on compare au baseline. Les régressions visuelles cassent la CI.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 2 : undefined,
|
|
reporter: process.env.CI ? [["html", { open: "never" }], ["github"]] : "list",
|
|
timeout: 30_000,
|
|
expect: {
|
|
/**
|
|
* Threshold de différence visuelle. 0.2 = très strict (pixel-near).
|
|
* Ajuster si flakiness sur le rendu des fonts.
|
|
*/
|
|
toHaveScreenshot: {
|
|
threshold: 0.2,
|
|
maxDiffPixelRatio: 0.005,
|
|
animations: "disabled",
|
|
caret: "hide",
|
|
},
|
|
},
|
|
use: {
|
|
baseURL: "http://localhost:6006",
|
|
trace: "on-first-retry",
|
|
video: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
viewport: { width: 1280, height: 800 },
|
|
colorScheme: "light",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium-light",
|
|
use: { ...devices["Desktop Chrome"], colorScheme: "light" },
|
|
},
|
|
{
|
|
name: "chromium-dark",
|
|
use: { ...devices["Desktop Chrome"], colorScheme: "dark" },
|
|
},
|
|
// Ajouter Firefox / WebKit en CI quand le baseline sera stable
|
|
],
|
|
webServer: {
|
|
command: "pnpm --filter storybook build && pnpm --filter storybook preview",
|
|
url: "http://localhost:6006",
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 180_000,
|
|
},
|
|
});
|