Playwrightで画像の表示を待ってからスナップショットを取得する
参照したページ
コード
for (const img of await page.getByRole('img').all()) {
await expect(img).toHaveJSProperty('complete', true);
await expect(img).not.toHaveJSProperty('naturalWidth', 0);
}
for (const img of await page.getByRole('img').all()) {
await expect(img).toHaveJSProperty('complete', true);
await expect(img).not.toHaveJSProperty('naturalWidth', 0);
}