Fix run_rule(): clicking the menu item only opens a confirmation modal, never runs anything
All checks were successful
Deploy / deploy (push) Successful in 25s

The user reported runs logged as "success" locally weren't showing up
in MassPrice's own Activity Log. Live-debugged directly against
production: clicking the dropdown's "Run Rule" item opens a
confirmation modal ("Are you sure you want to continue?") rather than
running the rule immediately. Confirmed by network capture — without
clicking the modal's #Confirmation_Run button, zero requests fire, no
error is thrown, and the rule silently never runs. Every prior
"success" in run_history.json for real production traffic was
therefore a false positive.

Verified the fix live: clicking through #ConfirmationModal's
#Confirmation_Run now fires a real POST /Rule/Run request.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6TgffxTvYhqxykAbVQg2v
This commit is contained in:
Barely Removable 2026-08-31 20:44:05 -07:00
parent 63e2296d1c
commit 988db5d5c4
4 changed files with 41 additions and 7 deletions

View file

@ -190,7 +190,21 @@ def run_rule(rule_id, rule_name=None):
run_link = row.first.locator(run_selector)
run_link.wait_for(state="visible", timeout=5000)
run_link.click()
page.wait_for_timeout(1500) # let the click's AJAX call fire
# Clicking the dropdown item only opens a confirmation modal
# ("You are about to run the rule ... Are you sure?") — it
# does not trigger the run itself. Confirmed by live testing:
# without this step, zero network requests ever fire and the
# rule silently never runs, despite the initial click
# "succeeding" with no error. #ConfirmationModal / its
# #Confirmation_Run button are used generically across the
# site (also for Delete Rule etc.), so scope the confirm
# click narrowly to this specific modal instance.
modal = page.locator("#ConfirmationModal")
modal.wait_for(state="visible", timeout=5000)
modal.locator("#Confirmation_Run").click()
modal.wait_for(state="hidden", timeout=10000)
page.wait_for_timeout(1000) # let the confirmed run's request land
status = "success"
message = "Run Rule clicked"