test-webapp

Kit d'outils pour interagir avec et tester des applications web locales avec Playwright. Prend en charge la vérification du frontend, le débogage de l'interface utilisateur, les captures d'écran et la consultation des logs navigateur.

Qu'est-ce que test-webapp ?

Cette compétence fournit un ensemble d'outils et de scripts conçus pour automatiser les tests et le débogage d'applications web locales à l'aide de Playwright en Python. Elle est particulièrement utile pour les développeurs et les ingénieurs QA qui ont besoin de valider rapidement le comportement du frontend, de capturer des captures d'écran, d'inspecter le DOM rendu et de consulter les logs de la console. La compétence fonctionne sur toutes les plateformes prenant en charge Python. Elle offre une approche structurée via un arbre de décision pour choisir entre la lecture de fichiers HTML statiques et l'automatisation d'applications dynamiques. Un script clé, `scripts/with_server.py`, gère le cycle de vie des serveurs (un ou multiples), permettant aux scripts d'automatisation de se concentrer uniquement sur la logique Playwright. La compétence promeut un modèle de 'reconnaissance puis action' : naviguer, attendre que la page soit stable, inspecter le DOM, identifier les sélecteurs, puis exécuter les actions. Les scripts d'assistance doivent être utilisés comme des boîtes noires, invoqués via `--help` et exécutés directement, afin d'éviter d'encombrer le contexte de travail.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/anthropics/skills/tree/main/skills/webapp-testing

Installed? Explore more Développement et programmation skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Test d'Application Web

Pour tester des applications web locales, écrivez des scripts Python natifs utilisant Playwright.

Scripts d'aide disponibles :

  • scripts/with_server.py - Gère le cycle de vie du serveur (prend en charge plusieurs serveurs)

Exécutez toujours les scripts avec --help en premier pour voir leur utilisation. NE lisez PAS le code source avant d'avoir d'abord essayé d'exécuter le script et constaté qu'une solution personnalisée est absolument nécessaire. Ces scripts peuvent être très volumineux et polluer votre fenêtre de contexte. Ils existent pour être appelés directement en tant que scripts boîtes noires, plutôt que d'être ingérés dans votre contexte.

Arbre de Décision : Choisir Votre Approche

Tâche utilisateur → Est-ce du HTML statique ?
    ├─ Oui → Lire le fichier HTML directement pour identifier les sélecteurs
    │         ├─ Succès → Écrire le script Playwright en utilisant les sélecteurs
    │         └─ Échec/Incomplet → Traiter comme dynamique (ci-dessous)
    │
    └─ Non (application dynamique) → Le serveur est-il déjà en cours d'exécution ?
        ├─ Non → Exécuter : python scripts/with_server.py --help
        │        Puis utiliser l'assistant + écrire un script Playwright simplifié
        │
        └─ Oui → Modèle de reconnaissance puis action :
            1. Naviguer et attendre networkidle
            2. Prendre une capture d'écran ou inspecter le DOM
            3. Identifier les sélecteurs à partir de l'état rendu
            4. Exécuter les actions avec les sélecteurs découverts

Exemple : Utilisation de with_server.py

Pour démarrer un serveur, exécutez --help en premier, puis utilisez l'assistant :

Serveur unique :

python scripts/with_server.py --server "npm run dev" --port 5173 -- python votre_automatisation.py

Serveurs multiples (ex. backend + frontend) :

python scripts/with_server.py \
  --server "cd backend && python server.py" --port 3000 \
  --server "cd frontend && npm run dev" --port 5173 \
  -- python votre_automatisation.py

Pour créer un script d'automatisation, incluez uniquement la logique Playwright (les serveurs sont gérés automatiquement) :

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True) # Toujours lancer chromium en mode headless
    page = browser.new_page()
    page.goto('http://localhost:5173') # Serveur déjà en cours et prêt
    page.wait_for_load_state('networkidle') # CRITIQUE : Attendre que le JS s'exécute
    # ... votre logique d'automatisation
    browser.close()

Modèle de Reconnaissance Puis Action

  1. Inspecter le DOM rendu :

    page.screenshot(path='/tmp/inspect.png', full_page=True)
    content = page.content()
    page.locator('button').all()
    
  2. Identifier les sélecteurs à partir des résultats d'inspection

  3. Exécuter les actions en utilisant les sélecteurs découverts

Piège Fréquent

❌ Ne pas inspecter le DOM avant d'avoir attendu networkidle sur les applications dynamiques ✅ Faire attendre page.wait_for_load_state('networkidle') avant l'inspection

Bonnes Pratiques

  • Utiliser les scripts fournis comme boîtes noires - Pour accomplir une tâche, considérez si l'un des scripts disponibles dans scripts/ peut vous aider. Ces scripts gèrent des flux de travail complexes et courants de manière fiable sans encombrer la fenêtre de contexte. Utilisez --help pour voir l'usage, puis invoquez-les directement.
  • Utilisez sync_playwright() pour les scripts synchrones
  • Fermez toujours le navigateur à la fin
  • Utilisez des sélecteurs descriptifs : text=, role=, sélecteurs CSS, ou IDs
  • Ajoutez des attentes appropriées : page.wait_for_selector() ou page.wait_for_timeout()

Fichiers de Référence

  • examples/ - Exemples montrant des motifs courants :
    • element_discovery.py - Découverte des boutons, liens et champs de saisie sur une page
    • static_html_automation.py - Utilisation d'URLs file:// pour du HTML local
    • console_logging.py - Capture des logs de la console pendant l'automatisation

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists

anthropics/template-skill

Replace with description of the skill and when Claude should use it.

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists

claude-api

|-

discernment-nudge

After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

pptx

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions \

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill

slack-gif-creator

Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like

theme-factory

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \

Skills associés