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

E2Eテスト自動化入門

 E2Eテスト自動化入門

「E2Eテストを自動化したいけれど、何から始めればいいのかわからない…」 「GitHub Actionsを使って、テストをCI/CDに組み込みたい!」 そんな方に向けて、デモを交えながらわかりやすく解説します。

E2Eテスト自動化ツールを使ったテストシナリオ作成の基本からGitHub Actionsを活用したCI/CDパイプラインへの統合までの流れを一緒に学びましょう。

https://devops-study.connpass.com/event/346364/

とことんDevOps

February 26, 2025
Tweet

More Decks by とことんDevOps

Other Decks in Technology

Transcript

  1. import { test, expect } from '@playwright/test'; 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 page to have a heading with the name of Installation. await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); });
  2. import { test, expect } from '@playwright/test'; 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 page to have a heading with the name of Installation. await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); });
  3. test('タイトル', async ({ page }) => { ... }); タイトル

    import { test, expect } from '@playwright/test'; test('has title', async ({ page }) => { // テストシナリオ1 }); test('get started link', async ({ page }) => { // テストシナリオ2 });
  4. test('タイトル', async ({ page }) => { ... }); test('has

    title', async ({ page }) => { await page.goto('https://playwright.dev/'); // Expect a title "to contain" a substring. await expect(page).toHaveTitle(/Playwright/); });
  5. 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 page to have a heading with the name of Installation. await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); });
  6. Installation page.getByRole('heading', { name: 'Installation' }) <h1> <h6> Installation expect()

    .toBeVisible() await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
  7. locator() #username username .btn btn button div > p div

    p await page.locator('#username').fill('my_username');