Fill current password in UI smoke tests after removing autofill for PR #7140

This commit is contained in:
danielhanchen 2026-07-15 14:04:00 +00:00
commit 7e11dc6f36
4 changed files with 20 additions and 3 deletions

View file

@ -255,17 +255,21 @@ jobs:
jq -e '.status == "healthy"' /tmp/health3.json
- name: Pass bootstrap pw for IME / i18n test
# IME smoke does the change-password against the bootstrap that
# Studio's frontend injects into the page, so it only needs the
# NEW password.
# IME smoke does its own change-password through the UI. The page no
# longer autofills the seed, so the test needs the current (bootstrap)
# password to fill the Current password field plus the NEW password.
run: |
OLD=$(cat ~/.unsloth/studio/auth/.bootstrap_password)
NEW="CIIme-$(python -c 'import secrets; print(secrets.token_urlsafe(16))')"
echo "::add-mask::$OLD"
echo "::add-mask::$NEW"
echo "STUDIO_IME_OLD_PW=$OLD" >> "$GITHUB_ENV"
echo "STUDIO_IME_NEW_PW=$NEW" >> "$GITHUB_ENV"
- name: Drive IME + multilingual paste regression with Playwright
env:
BASE_URL: http://127.0.0.1:18896
STUDIO_OLD_PW: ${{ env.STUDIO_IME_OLD_PW }}
STUDIO_NEW_PW: ${{ env.STUDIO_IME_NEW_PW }}
PW_ART_DIR: logs/playwright_ime
STUDIO_UI_STRICT: '1'

View file

@ -28,6 +28,7 @@ from _playwright_robust import ( # noqa: E402
)
BASE = os.environ["BASE_URL"]
OLD = os.environ["STUDIO_OLD_PW"]
NEW = os.environ["STUDIO_NEW_PW"]
ART_DIR = os.environ.get("PW_ART_DIR", "logs/playwright_ime")
ART = Path(ART_DIR)
@ -161,6 +162,10 @@ with sync_playwright() as p:
pass
pw_field = page.locator("#new-password")
pw_field.wait_for(state = "visible", timeout = 60_000)
# Served page no longer autofills the seed; fill Current password when shown.
cur_pw = page.locator("#current-password")
if cur_pw.count():
cur_pw.fill(OLD, timeout = 60_000)
pw_field.fill(NEW, timeout = 60_000)
page.fill("#confirm-password", NEW, timeout = 60_000)
shoot("01-change-password-filled")

View file

@ -236,6 +236,10 @@ with sync_playwright() as p:
pass # best-effort -- proceed even if network never idles
pw_field = page.locator("#new-password")
pw_field.wait_for(state = "visible", timeout = 60_000)
# Served page no longer autofills the seed; fill Current password when shown.
cur_pw = page.locator("#current-password")
if cur_pw.count():
cur_pw.fill(OLD, timeout = 60_000)
# Do NOT shoot() between wait_for and fill -- the screenshot's
# font-load wait can let a background poll detach the form.
pw_field.fill(NEW, timeout = 60_000)

View file

@ -134,6 +134,10 @@ with sync_playwright() as p:
pass
pw_field = page.locator("#new-password")
pw_field.wait_for(state = "visible", timeout = 60_000)
# Served page no longer autofills the seed; fill Current password when shown.
cur_pw = page.locator("#current-password")
if cur_pw.count():
cur_pw.fill(OLD, timeout = 60_000)
pw_field.fill(NEW, timeout = 60_000)
page.fill("#confirm-password", NEW, timeout = 60_000)
# Click submit AND wait for the POST response together so a server-side reject