AFFiNE/tests/kit/utils/utils.ts
2023-07-13 09:05:01 +00:00

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);
}
});
});
}