refactor: move test utils to package (#3206)

This commit is contained in:
Alex Yang
2023-07-13 17:05:01 +08:00
committed by GitHub
parent 4f5ed30298
commit 0230cea16e
61 changed files with 199 additions and 551 deletions

14
tests/kit/utils/utils.ts Normal file
View 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);
}
});
});
}