参照したページ
コード
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); }