mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
feat(core): add an option to throttle cpu in e2e (#5803)
To debug e2e flakyness locally
This commit is contained in:
@@ -67,6 +67,15 @@ export const test = baseTest.extend<{
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
page: async ({ page, context }, use) => {
|
||||||
|
if (process.env.CPU_THROTTLE) {
|
||||||
|
const cdpSession = await context.newCDPSession(page);
|
||||||
|
await cdpSession.send('Emulation.setCPUThrottlingRate', {
|
||||||
|
rate: parseInt(process.env.CPU_THROTTLE),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await use(page);
|
||||||
|
},
|
||||||
context: async ({ context }, use) => {
|
context: async ({ context }, use) => {
|
||||||
// workaround for skipping onboarding redirect on the web
|
// workaround for skipping onboarding redirect on the web
|
||||||
await skipOnboarding(context);
|
await skipOnboarding(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user