Figure out how to clear the google sign in for visual tests
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.
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();
}
We won't be using Google sign in. Not relevant anymore.