## Introduction

La commande `/test-web` permet de tester l'accessibilite et le contenu des ressources web de votre projet. Elle supporte plusieurs modes : fetch rapide, tests E2E avec Chrome, et generation de rapports.

The `/test-web` command tests the accessibility and content of your project's web resources. It supports multiple modes: quick fetch, E2E tests with Chrome, and report generation.

## Modes d'execution Execution Modes

⚡
--quick
WebFetch

Test rapide HTTP 200 + verification du contenu texte.

Quick HTTP 200 test + text content verification.

💻
--chrome
E2E

Tests E2E complets avec Claude for Chrome.

Full E2E tests with Claude for Chrome.

📄
--report
Markdown

Genere un rapport detaille dans reports/.

Generates a detailed report in reports/.

## Utilisation Usage

`/test-web` Test

    # Test rapide de toutes les URLs configurees
    /test-web --quick

    # Test E2E avec navigateur (requires claude --chrome)
    /test-web --chrome

    # Test d'une URL specifique
    /test-web https://github.com/org/repo

    # Generer rapport detaille
    /test-web --report

## Configuration

Creez un fichier de configuration dans `.claude/test-web/config.json` :

Create a configuration file in `.claude/test-web/config.json`:

    {
      "version": "1.0.0",
      "targets": [
        {
          "name": "npm Package Page",
          "url": "https://www.npmjs.com/package/@scope/package-name",
          "type": "fetch",
          "expects": {
            "status": 200,
            "contains": ["package-name", "Install"]
          }
        },
        {
          "name": "npm Search",
          "query": "@scope/package-name npm",
          "type": "search",
          "expects": {
            "hasResults": true
          }
        },
        {
          "name": "GitHub Repository",
          "url": "https://github.com/org/repo",
          "type": "fetch",
          "expects": {
            "status": 200,
            "contains": ["README", "package.json"]
          }
        }
      ],
      "settings": {
        "timeout": 30000,
        "retries": 2,
        "reportPath": ".claude/test-web/reports"
      }
    }

### Types de targets

### Target Types

Type | Description Description | Validation Validation
--- | --- | ---
`fetch` | Requete HTTP simple Simple HTTP request | status, contains
`search` | Recherche web Web search | hasResults
`chrome` | Test E2E navigateur Browser E2E test | actions, screenshots

## Templates pre-configures Pre-configured Templates

SmartStack CLI inclut des templates de configuration pour les cas d'usage courants :

SmartStack CLI includes configuration templates for common use cases:

Template | Description Description
--- | ---
`minimal.json` | Configuration minimale de base Basic minimal configuration
`npm-package.json` | Tests pour package npm (npm, GitHub, releases) Tests for npm package (npm, GitHub, releases)
`api-health.json` | Tests de sante API REST REST API health tests
`seo-check.json` | Verification SEO et indexation SEO and indexation check

    # Utiliser un template
    /test-web-config npm-package

    # Cela copie le template dans .claude/test-web/config.json

## Format de sortie Output Format

### Succes

### Success

    TEST WEB RESULTS
    ────────────────────────────────
    GitHub Repository     200 OK    "README" found
    npm Package           200 OK    "smartstack-cli" found
    Google Indexation     Results   Found in search

    Status: 3/3 PASS
    ────────────────────────────────

### Echec

### Failure

    TEST WEB RESULTS
    ────────────────────────────────
    GitHub Repository     200 OK    "README" found
    npm Package           404       Package not found
    Google Indexation     Results   No relevant results

    Status: 1/3 PASS, 1 FAIL, 1 WARNING
    ────────────────────────────────

## Mode Chrome (E2E) Chrome Mode (E2E)

💡

##### Prerequis

##### Prerequisites

🔌 Extension "Claude for Chrome" installee Extension "Claude for Chrome" installed
🆔 Plan Max/Pro/Team/Enterprise Max/Pro/Team/Enterprise plan
▶ Claude Code lance avec : `claude --chrome` Claude Code launched with: `claude --chrome`

    # 1. Lancer Claude Code avec Chrome
    claude --chrome

    # 2. Executer les tests E2E
    /test-web --chrome

## Integration workflows Workflow Integration

`/test-web` peut etre appele automatiquement dans d'autres workflows :

`/test-web` can be called automatically in other workflows:

Workflow | Phase | Usage Usage
--- | --- | ---
BA | /ba 5-verify | Verification des endpoints deployes Deployed endpoints verification
EPCT | Phase T (Test) | Tests d'integration web Web integration tests