LoginSignup
0
0

Playwrightのインストール方法

Posted at

事前準備

Node.jsのインストール

以下のリンクを参考にNode.jsをインストールする

Playwright Testのインストール

コマンドラインでPlaywright Testをインストールする

コマンドラインで以下のコマンドを実行して、Playwright Testをインストールします

コマンド
npm init playwright@latest

ブラウザのインストール

  • Playwright Testでは、Chromium、Firefox、Webkitの各ブラウザをテストに使用できます。
  • 必要なブラウザをインストールするには、以下のコマンドを実行します
コマンド
npx playwright install

テストコード作成

  • テストコードを作成するには、以下のコマンドを実行します
コマンド
npx playwright codegen [URL]
  • 以下のようにURLを指定して実行します
npx playwright codegen http://localhost:3000
  • コマンドを実行後、画面操作を行うことで以下のようにテストコードが生成されます

image.png

テストの実行

  • テストを実行するには、以下のコマンドを使用します
コマンド
npx playwright test

テストレポートの確認

  • レポートを確認するには、以下のコマンドを実行します
コマンド
npx playwright show-report

image.png

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