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

Co-authored-by: DarkSky <darksky2048@gmail.com>
This commit is contained in:
Akshaj Rawat
2026-01-27 02:16:16 +05:30
committed by GitHub
parent 3b4b0bad22
commit b8f626513f
9 changed files with 143 additions and 5 deletions
+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);