mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-27 18:53:43 +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);
|
|
}
|
|
});
|
|
});
|
|
}
|