Motomichi Works Blog

モトミチワークスブログです。その日学習したことについて書いている日記みたいなものです。

Playwrightで画像の表示を待ってからスナップショットを取得する

参照したページ

コード

for (const img of await page.getByRole('img').all()) {
  await expect(img).toHaveJSProperty('complete', true);
  await expect(img).not.toHaveJSProperty('naturalWidth', 0);
}