Skip to content

Commit

Permalink
update webkit screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
jcscottiii committed Jan 3, 2025
1 parent 960a46e commit 6450687
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions e2e/tests/stats-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
* limitations under the License.
*/

import {test, expect} from '@playwright/test';
import {test, expect, Page} from '@playwright/test';
import {setupFakeNow} from './utils';

async function waitForAllChartsToLoad(page: Page) {
// Wait for all charts to finish loading.
for (const chartLoading of await page.getByText('Loading stats').all())
await expect(chartLoading).toBeHidden();
}

test.beforeEach(async ({page}) => {
await setupFakeNow(page);
});
Expand All @@ -27,8 +33,7 @@ test('matches the screenshot', async ({page}) => {
// Wait for the chart container to exist.
await page.waitForSelector('#global-feature-support-chart-container');

const locator = page.getByText('Loading stats');
await expect(locator).toBeHidden();
await waitForAllChartsToLoad(page);

const pageContainer = page.locator('.page-container');
await expect(pageContainer).toHaveScreenshot();
Expand All @@ -46,8 +51,7 @@ test('matches the screenshot with missing one implementation chart', async ({
// Wait for the missing one implementatoin chart container to exist.
await page.waitForSelector('#features-lagging');

const locator = page.getByText('Loading stats');
await expect(locator).toBeHidden();
await waitForAllChartsToLoad(page);

const pageContainer = page.locator('.page-container');
await expect(pageContainer).toHaveScreenshot();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6450687

Please sign in to comment.