Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PlaywrightというE2Eテストツールを布教したい
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ryome
June 27, 2024
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PlaywrightというE2Eテストツールを布教したい
PlaywrightというE2Eテストツールを布教したい
ryome
June 27, 2024
More Decks by ryome
See All by ryome
AWSデスノート〜AWSの嫌いなところまとめ〜
ryome
0
51
AWS MCPを使ってみた
ryome
0
640
ClineでAWS CDKやインフラ構成図作ってみた
ryome
1
650
Cursorという最強エディタを使いこなしたい
ryome
0
350
E2Eテストを自動化したい
ryome
0
97
AWS CodeBuildを高速化したい
ryome
0
730
CDKでAppSyncのJavaScriptリゾルバを開発したい
ryome
0
320
Cognitoの複数IDP認証でユーザを統合したい
ryome
1
1.5k
OAuth2.0完全に理解した
ryome
0
310
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
520
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
460
Marketing to machines
jonoalderson
1
5.8k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
270
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Paper Plane
katiecoart
PRO
3
53k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Transcript
Playwrightという E2Eテストツールを布教したい
E2Eテストとは? • E2E(エンドツーエンド)テストは、アプリ全体の流れが実際のユーザー 環境と同様の条件下で期待通りに動作するかを検証するテストです。 • E2Eテストは、外部システムとの連携やエラー時の動作、業務フローなど の観点でテストケースの作成をします。 • CI/CDパイプラインにE2Eテストを組み込むことで、デグレーション(新 しいコードの導入による既存機能への影響)の早期検知やテスト工数削減
などの効果が見込めます。
E2Eテスト自動化で得られる効果 • テスト工数の削減 o 自動化により繰り返し行われる手動テスト作業を削減 o バグ発見時の再テストが容易 o リリース頻度の向上 •
テスト消化漏れ(デグレ確認漏れ)の防止 o 毎回同じ品質でテストが実施される o 人為的なミスの削減 • バグの可視化 o テスト結果の自動レポート生成によるバグの可視化 o バグの追跡と管理が容易
E2Eテストツール Playwrightについて • Playwrightは、Microsoftによって開発されたオープンソースの エンドツーエンド(E2E)テストツールです。 • Playwrightは、Chromium(Google Chrome、Microsoft Edge)、 Firefox、WebKit(Safari)など複数の主要ブラウザでのテストを
サポートしています。 • ファイルのアップロード/ダウンロード、自動スクリーンショット、ビデオ録 画、ネットワークインターセプト、モックデータの使用など、豊富な機能を 提供しています。
Playwrightのできること • テストコード生成 • レポート生成と確認 • クロスブラウザでテスト確認
テストコード生成 • コマンド:npx playwright codegen 画面を操作することで コード生成が可能
レポートの生成と確認 • コマンド:npx playwright show-report ブラウザごとにテストが成功したか 失敗したか確認できる
レポートの生成と確認 • コマンド:npx playwright show-report テストコードのどの行で 失敗したか確認できる 各ステップにかかった時間や 失敗したステップが確認できる
レポートの生成と確認 エラー時のDOMのスナップショット やネットワーク、コンソールログが 確認できる
クロスブラウザでテスト確認 • playwright.config.js でブラウザを定義! npx playwright installを 実施しておく必要がある モバイルにも対応可能!
クロスブラウザでテスト確認 テスト結果にブラウザ or モバイルを表示
E2Eテストはどうやって自動化するのか? • E2Eテストツール(Playwrightなど)を使用してテストコードを作成する • CI/CDパイプライン内でテストツールを実行する • テスト時の環境はDockerで作成する(dind)
E2Eテスト自動化導入時に気を付けること • Dockerイメージはどこから取ってくるか o DockerHubからイメージを取得するとスロットリングに引っ掛かる • コンテナ間の通信はどう行うか o Docker Composeを使用したコンテナ間の通信は、ホスト名に「localhost」ではなく、
「コンテナID」または「コンテナ名」、「サービス名」を指定する。 • CodeBuildのリソースは足りているか o Docker Composeを使用してテストを行う場合、 最低でも vCPU 4、RAM 7GB 程度必要