Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to compare two different urls? #65

Open
AshCoolman opened this issue Jan 22, 2018 · 2 comments
Open

Possible to compare two different urls? #65

AshCoolman opened this issue Jan 22, 2018 · 2 comments

Comments

@AshCoolman
Copy link

I'd like to compare my homepage in my test environment directly against the live environment

Is that possible with the current API?

e.g. something like:

it('ensures TEST vs PROD is expected', () => {
   const testHomepage = await page.goto('http://test.domain.com').screenshot();
   const prodHomepage = await page.goto('http://www.domain.com').screenshot();
    expect(
        await target.toMatchImageSnapshot(testHomepage, prodHomepage)
    ).toEqual(true)
})

Note: I realise this isn't strictly what differencify is designed for i.e. snapshot testing. I'm trying to replicate something like wraith "capture" mode.

@NimaSoroush
Copy link
Owner

Hi @AshCoolman:
Differencify is designed to compare your reference snapshot with development snapshot. To me, your prodHomepage should be your reference snapshot which is already stored on the disk.

I am happy to investigate the feature which you are asking for. Feel free to put a PR and have a chat about it.

@Artmann
Copy link
Contributor

Artmann commented Jun 13, 2019

This is the use case that we are using differencify for. What we ended up doing was something like this.

  1. Create an instance of differencify for the first URL.
  2. Use it to take a screenshot and then call toMatchSnapshot with the image. This will create snapshots needed for the comparison
  3. Create a new instance of differencify.
  4. Use the new instance to take a screenshot of the second URL.
  5. Call toMatchSnapshot on the second instance with the second screenshot. This will compare the new screenshot with the snapshots you created from the first URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants