0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

E2Eテストについてまとめてみました。

0
Posted at

概要

E2E(End-to-End)テストとは、ユーザー操作を再現してシステムを最初から最後まで通して検証するテスト手法です。
単体テストや統合テストが「部分」を確認するのに対して、E2Eテストはユーザー操作を再現してシステム全体の動作を確認します。

例えば

ECサイトを例に出すと、

  • ログイン
  • 商品検索
  • カート追加
  • 決済完了

この一連の流れを通して検証します。
つまり、実際のユーザー体験に近い品質保証をできるのが特徴です。

なぜE2Eテストが必要か

個別の機能が正しく動いていても、システム全体ではAPI連携ミスやDB整合性問題などが起きることがあります。

E2Eテストはこうした「全体をつないだ時の不具合」を検出できます。

テスト工程の中での位置

テスト種類 対象
単体テスト 関数・クラス
統合テスト モジュール間連携
E2Eテスト システム全体

playwrightを使用するイメージ

await page.goto("/login")
await page.fill("#email", "test@example.com")
await page.fill("#password", "password")
await page.click("button[type=submit]")
await expect(page).toHaveURL("/home")

上記は、

  • 人がブラウザ開く
  • ログイン入力
  • ボタン押す
  • 画面遷移確認

をそのまま自動化してるだけです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?