Skip to content

Fix TRW login by targeting submit button element#42

Merged
palm-octo-chainsaw merged 4 commits into
masterfrom
fix/trw-login-button-selector
May 21, 2026
Merged

Fix TRW login by targeting submit button element#42
palm-octo-chainsaw merged 4 commits into
masterfrom
fix/trw-login-button-selector

Conversation

@palm-octo-chainsaw
Copy link
Copy Markdown
Owner

Summary

  • TRW signal polling has been failing on every cycle (57+ consecutive errors before container restart) with Could not find TOTP input field.
  • Debug screenshot showed the page still parked on the login form (email filled, "Log In" button still visible) at the moment the scraper jumped to the TOTP step — meaning the form was never submitted.
  • Root cause: page.get_by_text("Log In", exact=False).first matched the modal heading "Log In To The Real World" (which contains "Log In") in DOM order before the actual submit button. Clicking a heading is a no-op, so the form stayed put.
  • Fix: target the button element specifically (button:has-text(...)) for both Log In and Confirm so heading text can't collide.

Test plan

  • Tag v1.5.2 to trigger Docker publish + self-hosted deploy
  • Within 15 min of deploy, observe data.scraper - INFO - [TRW] Found N message elements in container logs (instead of TOTP-input error)
  • /status shows healthy signal polling

The "Log In" submit was being located with a loose text match, which
collided with the modal heading "Log In To The Real World" — the heading
appears first in DOM order, so the click went to a heading element and
the form was never submitted. Subsequent TOTP-input lookup then failed
because the page was still showing the password form, producing 57+
consecutive poll failures.

Switch both Log In and Confirm to button-element selectors so the
heading text can't be matched.
@palm-octo-chainsaw palm-octo-chainsaw self-assigned this May 21, 2026
When TRW shows the TOTP modal the previous login form remains in the DOM
behind it. A generic button[type=submit] fallback selected the hidden Log
In button first, so the Confirm click landed on the wrong element and the
TOTP form was never submitted.
The chat input element overlays the messages-list area, so Playwright's
pre-click actionability check fails with 'subtree intercepts pointer
events' and times out. Use force=True to bypass the check; the banner
itself is still visible and stable.
@sonarqubecloud
Copy link
Copy Markdown

@palm-octo-chainsaw palm-octo-chainsaw merged commit 975b091 into master May 21, 2026
5 checks passed
@palm-octo-chainsaw palm-octo-chainsaw deleted the fix/trw-login-button-selector branch May 21, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant