lost-pixel / lost-pixel

Open source alternative to Percy, Chromatic, Applitools.

Home Page:https://lost-pixel.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manual screenshots

Techn1x opened this issue · comments

Mode

None

Feature description

I'm looking at alternatives to Percy, and Lost Pixel is looking decent

I already have a comprehensive test framework setup with scenarios etc. and with Percy we are able to take named screenshots at various points in each test for visual diff.

For example;

test('it clicks button', function () {
  await renderPage('/home')
  await percySnapshot('homepage')
  await click('button')
  await percySnapshot('homepage - after button click')
})

Is there a way to take snapshots manually with Lost Pixel? I can see there's a custom snapshots mode, but that seems to require me to take snapshots myself. It would be great if Lost Pixel exported a function to do that. How would you suggest I tackle this with LP?

Hey! Custom shots is exactly what you need, depending on the framework you use for testing making snapshots yourself could be very easy. In cypress and playwright it just a .screenshot("./lost-pixel")

Thanks! Makes sense, I'll give it a go.

Thinking I might be able to make use of this to generate screenshot files https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/captureVisibleTab

EDIT: nope, that seems to be the firefox extensions API

If you need help I am always at your service! You could come to our discord as well - would be able to help faster there!

Thanks for the offer, will join if I pursue further - closing the issue as the question was answered.