Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Playwrightの紹介
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yohei Iino
April 08, 2023
Technology
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Playwrightの紹介
Playwrightの紹介
Yohei Iino
April 08, 2023
More Decks by Yohei Iino
See All by Yohei Iino
1年半放置したExpo製アプリを最新化してみた
wheatandcat
0
100
作成中のFlutterアプリの中間発表
wheatandcat
0
86
最近読んだ技術書を簡単紹介
wheatandcat
0
110
ユニバーサルリンク/アプリリンクを使ってQRコードでゲストログインできるようにする
wheatandcat
0
380
Firebase App Checkを実装したので紹介
wheatandcat
0
310
PlanetScaleの無料プランがなくなるので、NeonとTiDBを試してみた
wheatandcat
0
410
Flutter HooksとRiverpodの解説
wheatandcat
0
580
T3 Stack(応用編: Next Auth & SSRの実装紹介)
wheatandcat
1
400
App Routerの紹介
wheatandcat
0
150
Other Decks in Technology
See All in Technology
プロンプト_きのこカンファレンス2026_LT
yurufuwahealer
0
130
しぶいSRE: サーバから見えない障害にどう向き合うか。ラストワンマイルのデバッグ実践 / Shibui SRE
kanny
0
440
4人目のSREはAgent
tanimuyk
0
370
AIに障害切り分けを全部やってもらった。 。 。 。
estie
0
340
Amazon EVS で VCF 9.0 / 9.1 のサポート開始まとめ
mtoyoda
0
170
AWS Summit Japan 2026の振り返りと2027へ向けて / AWS Summit Japan 2026 Recap and Prospects for 2027
kaminashi
1
190
認証認可だけじゃない! ID管理の構成要素と ライフサイクルを意識しよう
ritou
1
460
打造你的 AI 工作流:Agent Skill + MCP 實戰工作坊
appleboy
0
490
AI Agent SaaS を支える自社仮想化基盤への挑戦と実運用 / ai-agent-saas-virtualization
flatt_security
0
540
製造現場での生成AIの活用、およびエージェントAIの実装のあり方、AVEVAの取り組み
iotcomjpadmin
0
220
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
0
110
Agentic AI 時代のテスト手法: Kiro とはじめるプロパティベーステスト (AWS Summit Japan 2026 | DEV212)
ymhiroki
0
200
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
300
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Building Adaptive Systems
keathley
44
3.1k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
380
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
450
Transcript
Playwright の紹介 Press Space for next page
自己紹介 📝 飯野陽平(wheatandcat ) 🏢 個人事業主 → 法人設立(合同会社UNICORN 代表社員) 💻
Work: シェアフル株式会社CTO 📚 Blog: https://www.wheatandcat.me/ 🛠 今までに作ったもの memoir ペペロミア Atomic Design Check List
Playwright とは? E2E テストのためのNode.js のライブラリ Chromium 、Firefox 、および WebKit ブラウザをサポート
テストコードをブラウザ操作から自動生成できるのが強み Microsoft が作成 開発に元Puppeteer の開発者がいるため、インタフェースが似ている
導入 以下のコマンで実行で導入可能 npm init playwright@latest
コード 以下のコードで実行できる import { test, expect } from '@playwright/test'; test.describe("check
website", () => { test('has title', async ({ page }) => { await page.goto('https://playwright.dev/'); // Expect a title "to contain" a substring. await expect(page).toHaveTitle(/Playwright/); }); test('get started link', async ({ page }) => { await page.goto('https://playwright.dev/'); // Click the get started link. await page.getByRole('link', { name: 'Get started' }).click(); // Expects the URL to contain intro. await expect(page).toHaveURL(/.*intro/); }); });
実行① 以下のコマンドで実行 playwright test
実行② テスト結果は以下のように確認できる
実行③ 対象のテストをクリックで詳細も確認できる
実行④ Trace 機能を使用して確認 Trace Viewer | Playwright playwright test --trace
on npx playwright show-report
テストコードの自動生成 以下のコマンドで実行 ※ デモをやる Test Generator | Playwright npx playwright
codegen
実装 自作のアプリに導入してみたので紹介 PR: e2e で保存したデータを検証
実装したモチベーション アプリで使用しているmarkdown-to-jsx がユニットテストで動作しない Markdown の入力をparse してTODO 管理するアプリなので、markdown-to-jsx の入/ 出力が重要 なので、Playwright
で継続的にテストできるように実装
実装内容 ※ デモしながら紹介(トレースも見せる) テストファイルは以下を参照 e2e/todo.spec.ts localStorage のテストは evaluate を使用 Evaluating
JavaScript | Playwright CI で実行は以下を参照 .github/workflows/playwright.yml 実行結果は、こちら ` `
まとめ E2E テストは保守が大変だが、Playwright はテストコードの生成機能があるので保守しやすい 複数のブラウザをサポートしているので安全性が高い トレース機能があるのでCI でコケた時も原因の発見が容易
ご清聴ありがとうございました 🎉