Playwright

Fast and reliable end-to-end testing for modern web apps

公式サイト:

Playwright [Official]

使い方

ドキュメント:

Writing Tests | Playwright [Official]

導入

参考:

Playwright を使った E2E  テストの構築手順 | Aliyell

Playwright E2E テスト 実践入門 – Qiita

Playwright に入門してみた – Qiita

Playwright を使って E2E テストを書いてみる – Qiita

pnpm を用いて Playwright で E2E テスト/VRT をする環境を整えよう | Riml

Playwright で E2E テスト | Ryoya Kamikawa

Playwright の始め方 | A Memorandum

Playwright を活用した E2E テストの導入 | every Tech Blog

インストール

ドキュメント:

Installation | Playwright [Official]

オプション

ドキュメント:

Test Options | Playwright [Official]

CLI

pnpm コマンドで実行する。

pnpm exec playwright test

テストの一覧を確認する。

pnpm exec playwright test --list

ドキュメント:

Command Line | Playwright [Official]

workers

参考:

Playwright の並行実行の設定を見てみよう | saimyon

タイムアウト

参考:

Playwright のタイムアウト時間を変更する | misawa

繰り返し

  • --repeat-each=N: 繰り返し回数を指定する

指定したテストを5回ずつ実行する。

$ pnpm exec playwright test path/to/tests/ --repeat-each=5

参考:

In Playwright Test is there an easy way to loop the test multiple times to check for flakiness? | Playwright Solutions

経過時間

参考:

Add method to get current test execution duration · Issue #36821 · microsoft/playwright – GitHub

スロットリング

参考:

CPU and Network throttling · Issue #29155 · microsoft/playwright – GitHub

パフォーマンス

参考:

実行速度を改善するテクニック – Qiita

Playwright で作成したテストのパフォーマンスを改善する – Qiita

Playwright CI が遅い?pnpm / bun で 20% 高速化した方法 | aoba

待機

参考:

待機処理の逆引きメモ – Qiita

page.waitForFunction not working as expected – Stack Overflow

ページ API

ドキュメント:

Page | Playwright [Official]

レポート

ドキュメント:

Reporters | Playwright [Official]

参考:

Playwright Reporting and Test Artifacts | TestingMint

How to Create Custom Playwright Reports with Dynamic Charts | Abigail Armijo

Trace Viewer

動画:

Exploring Trace Viewer for Debugging Locally and on CI (Official)

ドキュメント:

Trace Viewer | Playwright [Official]

参考:

Playwright の Trace Viewer で、失敗した E2E テストの原因を調べる | DevelopersIO

GitHub Actions

参考:

Playwright のブラウザバイナリを GitHub Actions でキャッシュする – Qiita

Github Actions 上の Playwright 実行を高速化 | fuzimaru

How to cache on GitHub Actions? · Issue #7249 · microsoft/playwright – GitHub

リリースノート

Release Notes | Playwright [Official]

ドキュメント

Docs | Playwright [Official]

リポジトリ

microsoft/playwright – GitHub

まとめ

初心者からずっと使い続けたい Playwright スクリプトチートシート – Qiita

Tips

Playwright が画面を奪う問題を headless で解決する | masayasu suzuki

Playwright の Chromium が孤児化して CPU 100% で16時間回り続けた | 仮説先行

HTML Reports (Rodrigo Odhin)

リポジトリ:

Odhin Reports / Playwright – GitLab

入手:

odhin-reports-playwright – npm

リンク:

Playwright HTML Report | DEV Community

記事をシェアする:

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Protected by reCAPTCHA