webstatus.dev icon indicating copy to clipboard operation
webstatus.dev copied to clipboard

Figure out how to clear the google sign in for visual tests

Open jcscottiii opened this issue 1 year ago • 1 comments

In both the overview page and 404 playwright tests, the google sign in pop appears for both the webkit and firefox browsers. This issue to investigate and solve how to clear that before the screenshot is taken.

jcscottiii avatar Feb 16 '24 01:02 jcscottiii

You can mask it out, by specifying a mask property in the arguments to toHaveScreenshot(). Here is an example from ChromeStatus:

    await expect(page).toHaveScreenshot('create-origin-trial-stage-dialog.png', {
        mask: [page.locator('section[id="history"]')]
    });

But I thought this was just about the button. I don't think you can mask out the popup. For ChromeStatus, we just found a way to avoid getting the popup, though I think it didn't work for Firefox.

In chromedash-header.js, I added code like this:

      if (!window['isPlaywright']) {
        // Insert the google signin button first.
        // Only insert if not running playwright.
        this.initializeGoogleSignIn();
      }
      if (this.devMode == 'True') {
        // Insert the testing signin second, so it appears to the left
        // of the google signin button, with a large margin on the right.
        this.initializeTestingSignIn();
      }

dlaliberte avatar Feb 16 '24 02:02 dlaliberte

We won't be using Google sign in. Not relevant anymore.

jcscottiii avatar Sep 09 '24 15:09 jcscottiii