メインコンテンツへスキップ

概要

E2E テストは重要ですが、メンテナンスコストが高くつきます。Playwright や Selenium のテストは UI が変わるたびに壊れます。CSS クラスの変更、フォーム構造の変更、ナビゲーションの刷新 — チームはバグを見つけるよりもセレクタの修正に時間を費やしています。 Refrain は壊れやすいテストスクリプトを自己修復する手順書に置き換えます。各テストで検証したい内容を記述し、手順書を生成して CI/CD パイプラインに組み込むだけ。UI が変わっても手順書が自動的に適応し、テストコードのメンテナンスは不要です。

手順書の例

name: login-flow-test
url: https://staging.example.com/login
variables:
  - name: test_email
    source: secrets
  - name: test_password
    source: secrets
steps:
  - action: input
    selector: "#email"
    value: "{{ test_email }}"
  - action: input
    selector: "#password"
    value: "{{ test_password }}"
  - action: click
    selector: "#login-button"
  - action: wait
    selector: ".dashboard"
  - action: extract
    selector: ".welcome-message"
    capture: welcome_text
  - action: extract
    selector: ".user-menu"
    capture: user_menu

生成と実行

1

テスト用手順書を生成する

npx @refrainai/cli generate -- \
  --url https://staging.example.com/login \
  --goal "テスト用認証情報でログインし、ダッシュボードにウェルカムメッセージが表示されることを確認する" \
  --context ./context.md \
  --output ./tests/login-flow.yaml
2

ローカルで実行する

npx @refrainai/cli execute -- \
  --runbook ./tests/login-flow.yaml \
  --secrets ./secrets.json \
  --report ./test-reports/login-flow.md
3

CI/CD に組み込む

CI パイプラインに実行コマンドを追加します:
# .github/workflows/e2e.yml
- name: E2E テスト実行
  run: |
    npx @refrainai/cli execute -- \
      --runbook ./tests/login-flow.yaml \
      --secrets ./secrets.json \
      --report ./test-reports/login-flow.md

Refrain が向いている理由

  • テストコード不要 — 手順書が Playwright / Selenium スクリプトを置き換え。セレクタのメンテナンス不要。
  • 自己修復 — UI 変更にも自動対応。リニューアルでテストが壊れない。
  • CI/CD ネイティブ — CLI で任意のパイプラインから実行可能。GitHub Actions、GitLab CI、Jenkins 等に対応。
  • ビジュアルデバッグ--headless false--screenshots で失敗箇所を視覚的に確認。

次のステップ