feat: disable high power consumption without charger (#14281)

Co-authored-by: DarkSky <darksky2048@gmail.com>
This commit is contained in:
Akshaj RawatandDarkSky authored and GitHub committed 2026-01-27 04:46:16 +08:00
1 parent 3b4b0bad22
commit b8f626513f
9 files changed
+143 -5

No files matched your search

+8
View File
@@ -71,6 +71,14 @@ export const test = baseTest.extend<{
await use(page);
},
context: async ({ context }, use) => {
// Force-mark the body so global.css knows we are in a test.
// This keeps animations ON (0.1s) for tests, but OFF (0ms) for battery users.
await context.addInitScript(() => {
window.addEventListener('DOMContentLoaded', () => {
document.body.classList.add('playwright-test');
});
});
// workaround for skipping onboarding redirect on the web
await skipOnboarding(context);