feat(headless): render element locators before lookup - #7549
Conversation
Render locator arguments thru the action renderer for every element lookup mode (selector, regex, XPath, JavaScript, and search locators). Keep rendered values local and reuse selectors instead of rendering them twice. Render `waitvisible` locators on the owning page so Interactsh URLs remain attached to the request. Use a local URL source in tests to avoid network access. Closes #7542 Signed-off-by: Dwi Siswanto <git@dw1.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughHeadless element locators now render action arguments before lookup, return resolved selectors for relevant modes, propagate lookup errors, and use an Interactsh URL source interface. Tests cover template interpolation, Interactsh tracking, and dynamic selectors. ChangesHeadless locator rendering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant HeadlessAction
participant pageElementBy
participant getActionArg
participant RodPage
participant InteractshURLSource
HeadlessAction->>pageElementBy: provide action locator
pageElementBy->>getActionArg: render locator argument
getActionArg->>InteractshURLSource: generate Interactsh URL when referenced
InteractshURLSource-->>getActionArg: return OAST hostname
getActionArg-->>pageElementBy: return resolved locator
pageElementBy->>RodPage: locate element
RodPage-->>pageElementBy: return element and selector
pageElementBy-->>HeadlessAction: return lookup result or error
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Proposed changes
Render locator arguments thru the action renderer
for every element lookup mode (selector, regex,
XPath, JavaScript, and search locators). Keep
rendered values local and reuse selectors instead
of rendering them twice.
Render
waitvisiblelocators on the owning pageso Interactsh URLs remain attached to the request.
Use a local URL source in tests to avoid network
access.
Closes #7542
Proof
Checklist
Summary by CodeRabbit