Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Playwrightの紹介

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 Playwrightの紹介

Playwrightの紹介

Avatar for Yohei Iino

Yohei Iino

April 08, 2023
Tweet

More Decks by Yohei Iino

Other Decks in Technology

Transcript

  1. 自己紹介 📝 飯野陽平(wheatandcat ) 🏢 個人事業主 → 法人設立(合同会社UNICORN 代表社員) 💻

    Work: シェアフル株式会社CTO 📚 Blog: https://www.wheatandcat.me/ 🛠 今までに作ったもの memoir ペペロミア Atomic Design Check List
  2. Playwright とは? E2E テストのためのNode.js のライブラリ Chromium 、Firefox 、および WebKit ブラウザをサポート

    テストコードをブラウザ操作から自動生成できるのが強み Microsoft が作成 開発に元Puppeteer の開発者がいるため、インタフェースが似ている
  3. コード 以下のコードで実行できる 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/); }); });