Skip to content

netresearch/typo3-testing-skill / skills/typo3-testing

typo3-testing

Flagged

Use when reproducing defects as failing tests, testing template or rendered output changes, confirming changes on a running TYPO3 instance, or setting up TYPO3 extension tests: unit/functional/E2E, PHPUnit 11-13, mutation testing, final-class mocks (v14), CI matrix across TYPO3 12/13/14.3 LTS, typo3-ci-workflows meta-package, CI failures. Also: transaction rollback, worker crashes, competing requests, testing-framework setup, test matrix, integration/e2e testing, coverage, test generation.

FileKindSize
SKILL.mdskill md6.8 KB
assets/.php-cs-fixer.dist.phpscript7.0 KB
assets/AGENTS.mdmarkdown5.0 KB
assets/Build/Scripts/runTests.shexecutablescript27.5 KB
assets/Build/playwright/.nvmrcother6 B
assets/Build/playwright/package.jsonmanifest535 B
assets/Build/playwright/playwright.config.tsscript1.3 KB
assets/Build/playwright/tests/playwright/accessibility/modules.spec.tsscript2.0 KB
assets/Build/playwright/tests/playwright/config.tsscript712 B
assets/Build/playwright/tests/playwright/e2e/backend-module.spec.tsscript1.9 KB
assets/Build/playwright/tests/playwright/fixtures/setup-fixtures.tsscript2.7 KB
assets/Build/playwright/tests/playwright/helper/login.setup.tsscript975 B
assets/FunctionalTests.xmlconfig1.4 KB
assets/FunctionalTestsBootstrap.phpscript1.6 KB
assets/Makefileother2.3 KB
assets/UnitTests.xmlconfig890 B
assets/UnitTestsBootstrap.phpscript2.1 KB
assets/bootstrap.phpscript1.4 KB
assets/codecov.ymlconfig1.6 KB
assets/docker/codeception.ymlconfig979 B
assets/docker/docker-compose.ymlconfig1.4 KB
assets/example-tests/ExampleAcceptanceCest.phpscript2.2 KB
assets/example-tests/ExampleFunctionalTest.phpscript2.4 KB
assets/example-tests/ExampleUnitTest.phpscript1.6 KB
assets/fixtures/README.mdmarkdown2.0 KB
assets/fixtures/be_users.csvother361 B
assets/fixtures/pages.csvother257 B
assets/fixtures/sys_category.csvother228 B
assets/fixtures/tt_content.csvother338 B
assets/github-actions-e2e.ymlconfig8.8 KB
assets/github-actions-tests.ymlconfig6.3 KB
assets/infection.json5other2.8 KB
assets/phpat.neonother330 B
assets/phpat.phpscript8.4 KB
assets/phpstan-baseline.neonother365 B
assets/phpstan.neonother1.4 KB
assets/rector.phpscript2.9 KB
checkpoints.yamlconfig61.7 KB
references/accessibility-testing.mdmarkdown7.6 KB
references/architecture-testing.mdmarkdown4.4 KB
references/asset-templates-guide.mdmarkdown3.4 KB
references/backend-module-render-verification.mdmarkdown9.7 KB
references/backend-user-access-testing.mdmarkdown9.5 KB
references/captainhook-setup.mdmarkdown2.4 KB
references/ci-cd.mdmarkdown39.5 KB
references/ci-debugging.mdmarkdown20.0 KB
references/ci-workflows-meta-package.mdmarkdown11.6 KB
references/crash-and-concurrency-testing.mdmarkdown4.8 KB
references/crypto-testing.mdmarkdown16.6 KB
references/datahandler-silent-rewrites.mdmarkdown7.2 KB
references/ddev-testing.mdmarkdown1.3 KB
references/e2e-testing.mdmarkdown53.0 KB
references/enforcement-rules.mdmarkdown5.7 KB
references/event-dispatch-testing.mdmarkdown2.8 KB
references/framework-compat-gate.mdmarkdown4.9 KB
references/functional-test-patterns.mdmarkdown11.0 KB
references/functional-testing.mdmarkdown46.3 KB
references/fuzz-testing.mdmarkdown8.6 KB
references/integration-testing.mdmarkdown14.1 KB
references/javascript-testing.mdmarkdown29.3 KB
references/live-instance-verification.mdmarkdown8.6 KB
references/mock-validity.mdmarkdown15.7 KB
references/mutation-testing.mdmarkdown36.0 KB
references/performance-testing.mdmarkdown11.2 KB
references/quality-tools.mdmarkdown25.5 KB
references/release-workflow-validation.mdmarkdown3.6 KB
references/sonarcloud.mdmarkdown18.8 KB
references/synthetic-secret-fixtures.mdmarkdown3.8 KB
references/tdd-discipline.mdmarkdown9.1 KB
references/test-environment-guards.mdmarkdown18.5 KB
references/test-runners.mdmarkdown24.6 KB
references/typo3-ci-config-patterns.mdmarkdown9.0 KB
references/typo3-v14-final-classes.mdmarkdown16.5 KB
references/unit-testing.mdmarkdown59.1 KB
scripts/generate-test.shexecutablescript6.0 KB
scripts/setup-testing.shexecutablescript6.3 KB
scripts/validate-setup.shexecutablescript4.0 KB

assets/github-actions-e2e.yml

View on GitHub
# GitHub Actions E2E Workflow for TYPO3 Extensions
#
# Place this file in .github/workflows/e2e.yml
#
# This workflow uses GitHub Services (MariaDB) + PHP built-in server
# for fast, reliable E2E testing with Playwright.
#
# IMPORTANT: Do NOT use DDEV in CI - it's too slow and complex.
# DDEV is for LOCAL development only.
#
# PREREQUISITES:
# - Playwright tests in Tests/E2E/Playwright/ or Build/tests/playwright/
# - package.json with Playwright dependencies
# - composer.json with TYPO3 dependencies

name: E2E Tests

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]
  # Manual trigger for expensive E2E tests
  workflow_dispatch:
  # Weekly scheduled run (optional)
  schedule:
    - cron: '0 2 * * 0'

# Prevent concurrent E2E runs on same branch
concurrency:
  group: e2e-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  e2e:
    name: E2E Tests (Playwright)
    runs-on: ubuntu-latest
    timeout-minutes: 20

    # ==========================================================================
    # GitHub Services: Use MariaDB instead of DDEV
    # This is faster, simpler, and more reliable than DDEV in CI
    # ==========================================================================
    services:
      db:
        image: mariadb:11.4
        env:
          MYSQL_ROOT_PASSWORD: root
          MYSQL_DATABASE: typo3
          MYSQL_CHARSET: utf8mb4
          MYSQL_COLLATION: utf8mb4_unicode_ci
        ports:
          - 3306:3306
        options: >-
          --health-cmd="healthcheck.sh --connect --innodb_initialized"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=5

    steps:
      - name: Checkout
        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

      - name: Setup PHP
        uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
        with:
          # Match your composer.json PHP requirement
          php-version: '8.4'
          extensions: mysqli, pdo_mysql, gd, intl, curl, zip
          coverage: none

      - name: Get Composer cache directory
        id: composer-cache
        run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

      - name: Cache Composer dependencies
        uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
          restore-keys: ${{ runner.os }}-composer-

      - name: Install Composer dependencies
        run: composer install --prefer-dist --no-progress

      # ========================================================================
      # TYPO3 Setup: Create config and bootstrap database
      # ========================================================================
      - name: Setup TYPO3
        run: |
          # Create necessary directories
          mkdir -p .Build/Web/typo3conf
          mkdir -p .Build/Web/typo3temp/var/cache
          mkdir -p .Build/Web/typo3temp/var/log
          mkdir -p .Build/Web/fileadmin

          # Create LocalConfiguration.php with MySQL connection
          cat > .Build/Web/typo3conf/LocalConfiguration.php << 'EOF'
          <?php
          return [
              'BE' => [
                  'debug' => true,
                  // Password: 'password' (test-only, for CI debugging)
                  'installToolPassword' => '$argon2i$v=19$m=65536,t=16,p=1$M3QuMy5OdGlXTkxmTy56Zg$3A4Exo3BxTgTjLSaR4xaoIgd3gfWBPjXfYu7NdnVmzU',
                  'passwordHashing' => [
                      'className' => \TYPO3\CMS\Core\Crypto\PasswordHashing\Argon2iPasswordHash::class,
                      'options' => [],
                  ],
              ],
              'DB' => [
                  'Connections' => [
                      'Default' => [
                          'charset' => 'utf8mb4',
                          'driver' => 'mysqli',
                          'host' => '127.0.0.1',
                          'port' => 3306,
                          'dbname' => 'typo3',
                          'user' => 'root',
                          'password' => 'root',
                      ],
                  ],
              ],
              'FE' => [
                  'debug' => true,
              ],
              'SYS' => [
                  'devIPmask' => '*',
                  'displayErrors' => 1,
                  // Test encryption key (64 hex chars, not a real secret)
                  'encryptionKey' => '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
                  'exceptionalErrors' => 4096,
                  'sitename' => 'E2E Tests',
                  'trustedHostsPattern' => 'localhost|127\\.0\\.0\\.1',
              ],
          ];
          EOF

          # Wait for database to be ready (extra safety beyond health check)
          for i in {1..30}; do
            if mysqladmin ping -h127.0.0.1 -uroot -proot --silent 2>/dev/null; then
              echo "Database is ready."
              break
            fi
            echo "Waiting for database... (attempt $i/30)"
            sleep 2
          done

          # Setup database schema
          .Build/bin/typo3 extension:setup --no-interaction

          # Create admin user (password: 'Joh316!!' - test-only)
          .Build/bin/typo3 backend:user:create --username=admin --password='Joh316!!' --admin --no-interaction

          # Flush caches
          .Build/bin/typo3 cache:flush

      - name: Setup Node.js
        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
        with:
          node-version: '20'  # Use LTS version
          cache: 'npm'

      - name: Install npm dependencies
        run: npm ci

      - name: Install Playwright browsers
        run: npx playwright install --with-deps chromium

      # ========================================================================
      # Start PHP built-in server (NOT DDEV)
      # ========================================================================
      - name: Start PHP server
        run: |
          php -S 0.0.0.0:8080 -t .Build/Web > /tmp/php-server.log 2>&1 &
          echo $! > /tmp/php-server.pid

          # Wait for server to become ready (up to 30 seconds)
          for i in $(seq 1 30); do
            if curl -sf http://localhost:8080/typo3/ > /dev/null 2>&1; then
              echo "PHP server is up (after ${i}s)."
              break
            fi
            sleep 1
          done

          # Verify server is running
          if ! curl -sf http://localhost:8080/typo3/ > /dev/null 2>&1; then
            echo "PHP server failed to start. Log:"
            cat /tmp/php-server.log
            exit 1
          fi

      - name: Run Playwright tests
        env:
          # CI uses localhost, NOT DDEV URL
          TYPO3_BASE_URL: http://localhost:8080
        run: npm run test:e2e

      - name: Upload test results
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        if: always()
        with:
          name: playwright-report
          path: |
            Tests/E2E/Playwright/reports/
            Tests/E2E/Playwright/test-results/
          retention-days: 7

      - name: Upload PHP server logs
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        if: failure()
        with:
          name: php-server-logs
          path: /tmp/php-server.log
          retention-days: 3

      - name: Stop PHP server
        if: always()
        run: |
          if [ -f /tmp/php-server.pid ]; then
            kill $(cat /tmp/php-server.pid) 2>/dev/null || true
          fi

# =============================================================================
# WHY NOT DDEV IN CI?
# =============================================================================
#
# DDEV should NOT be used in CI for these reasons:
#
# 1. SLOW STARTUP (2-3+ minutes)
#    - Docker image pulls
#    - Container orchestration
#    - Network setup
#    - Service health checks
#
# 2. COMPLEXITY
#    - Docker-in-Docker or privileged mode required
#    - Networking between host and containers
#    - Volume mounting overhead
#
# 3. RESOURCE HEAVY
#    - Multiple containers (web, db, router)
#    - Not suited for GitHub Actions runners
#
# 4. FRAGILE
#    - Many moving parts that can fail
#    - Port conflicts, DNS issues, certificate problems
#
# 5. NON-STANDARD
#    - TYPO3 Core and community use direct PHP or testing containers
#    - Not how the TYPO3 community does CI
#
# DDEV is excellent for LOCAL DEVELOPMENT:
# - Consistent environment across team
# - Easy multi-version testing
# - Full-stack with services (Redis, Elasticsearch, etc.)
#
# But for CI, use GitHub Services + PHP built-in server.
# =============================================================================
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate 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's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall