question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] implement `await expect(page).toHaveScreenshot()`

See original GitHub issue

introduce a web-first assertion for Visual regression testing.

Today:

expect(await page.screenshot()).toMatchSnapshot('foo.png');

After this:

await expect(page).toHaveScreenshot('foo.png');

toHaveScreenshot should auto-retry screenshot until golden is reached.

toHaveScreenshot should also have:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
aslushnikovcommented, Apr 28, 2022

toHaveScreenshot is now scheduled for 1.21 that’ll happen in April toHaveScreenshot is now scheduled for 1.22 that’ll happen in May

3reactions
0xIslamTahacommented, Feb 16, 2022

@aslushnikov here is an example of the chart that I would like to verify visually. The network is ideal while the graph is still rendering.

Peek 2022-02-16 18-51

Read more comments on GitHub >

github_iconTop Results From Across the Web

How should I be using playwright's toHaveScreenshot() within ...
I'm wanting to implement visual regression testing into a ReactJS app. I already have playwright setup called through cucumber for some ...
Read more >
Visual regression testing with Playwright - Qxperts
await page.goto('http://localhost:3000');. await expect(page). ... The toHaveScreenshot function will compare the visual differences with an ...
Read more >
Visual testing in Playwright - Reflect.run
click("text=AGREE"); // visually comparing two screenshots await expect(page).toHaveScreenshot(); });. This simple test navigates to https:// ...
Read more >
Five Playwright Tips to Level Up Your Testing Game
Only run a specific test test.only() // Skip a test and mark it as ... toHaveClass(/selected/) await expect(page.locator('.my-element')).
Read more >
How To Get Started With Playwright Component Testing
We can even take screenshots of our components to do some visual testing! await expect(page.locator("header>h1")).toHaveScreenshot() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found