NimaSoroush / differencify

Differencify is a library for visual regression testing
MIT License
634 stars 46 forks source link

page.focus() #64

Closed AshCoolman closed 6 years ago

AshCoolman commented 6 years ago

I'm having trouble getting puppetter to work - can anyone spot a problem with this test?

Thanks

import Differencify from '../index';

const differencify = new Differencify({ debug: true });

describe('Differencify', () => {
  beforeAll(async () => {
    await differencify.launchBrowser({ args: ['--no-sandbox', '--disable-setuid-sandbox'], headless: false });
  });
  afterAll(async () => {
    await differencify.cleanup();
  });
  it.only('simple', async () => {
    await differencify
      .init()
      .newPage()
      .setViewport({ width: 1024, height: 1024 })
      .goto('https://facebook.github.io/jest/docs/en/api.html')
      .page // tried without also
      .waitForSelector('footer')
      .focus('footer')
      .screenshot()
      .toMatchSnapshot()
      .close()
      .end();
  }, 20000);
NimaSoroush commented 6 years ago

Hi @AshCoolman : Can you post the output of debug log here? What is the actual error you are getting?

AshCoolman commented 6 years ago

Apologies!

I simply misread the docs (I conflated page.hover() with page.focus())

NimaSoroush commented 6 years ago

@AshCoolman : No worries 😉