mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor: move test utils to package (#3206)
This commit is contained in:
14
tests/kit/utils/utils.ts
Normal file
14
tests/kit/utils/utils.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user