mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 15:16:14 +00:00
Try to preload fonts in visual tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {BrowserContext} from '@playwright/test';
|
||||
import {BrowserContext, Page} from '@playwright/test';
|
||||
import * as fs from 'fs';
|
||||
|
||||
/**
|
||||
@@ -40,3 +40,10 @@ export async function setupGedcomRoute(context: BrowserContext): Promise<void> {
|
||||
await mockGedcomResponse(context, gedcomContent);
|
||||
await blockTracking(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures all custom web fonts are fully loaded and rendered.
|
||||
*/
|
||||
export async function waitForFonts(page: Page): Promise<void> {
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user