Created
December 1, 2023 15:47
-
-
Save hatappo/87e82dfe388136b5b824a55bbe8a5e36 to your computer and use it in GitHub Desktop.
ごく簡易な Playwright のテストシナリオのコード例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test, expect } from "@playwright/test"; | |
test("検索ワード無しで検索した場合に急上昇ワードが表示される", async ({ page }) => { | |
// 1. Yahoo!Japan のサイトを開く。 | |
await page.goto("https://www.yahoo.co.jp/"); | |
// 2. 「検索」というラベルが付いた要素を探し出してきて、クリックする。 | |
await page.getByRole("link", { name: "検索" }).click(); | |
// 3. 「ウェブ検索の急上昇ワード」という見出しがページ上にあることを確認。 | |
await expect(page.getByRole("heading", { name: "ウェブ検索の急上昇ワード" })).toBeVisible(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment