mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 10:42:00 +03:00
15 lines
307 B
TypeScript
15 lines
307 B
TypeScript
import type { Page } from '@playwright/test';
|
|
|
|
export async function waitForLogMessage(
|
|
page: Page,
|
|
log: string
|
|
): Promise<boolean> {
|
|
return new Promise(resolve => {
|
|
page.on('console', msg => {
|
|
if (msg.type() === 'log' && msg.text() === log) {
|
|
resolve(true);
|
|
}
|
|
});
|
|
});
|
|
}
|