10 lines
491 B
Python
10 lines
491 B
Python
from pathlib import Path
|
|
ROOT=Path(__file__).resolve().parent.parent
|
|
for name in ['portal-stability-consumers-chromium.cjs','portal-stability-inspect-ui.cjs']:
|
|
file=ROOT/'tools'/name
|
|
text=file.read_text(encoding='utf-8')
|
|
before="await page.locator('input[name=\"code\"]').fill(otp(a.totp_secret??a.secret));"
|
|
after="await page.waitForTimeout(30500-(Date.now()%30000));"+before
|
|
assert text.count(before)==1
|
|
file.write_text(text.replace(before,after),encoding='utf-8')
|