-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[docs]: add docs for page.waitForSelector()
#1605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# why missing docs for new `page.waitForSelector()` # what changed Add API reference documentation for page.waitForSelector() method including: - Method signature and parameter descriptions - All options: state, timeout, pierceShadow - Code examples for various use cases # test plan <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds API reference for page.waitForSelector(), with options, defaults, and practical examples. Addresses STG-1125 by filling the missing docs. - New Features - Method signature and parameters: state, timeout, pierceShadow. - Notes on defaults: state "visible", 30s timeout, shadow DOM piercing; supports iframe hop (>>). - Examples for visible/hidden/detached, iframe, shadow DOM, XPath, and custom timeouts. <sup>Written for commit 1e90c4a. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: Chromie Bot <chromie@browserbase.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
Greptile OverviewGreptile SummaryThis PR adds complete API reference documentation for the
The documentation is well-structured, accurate, and provides practical examples that align with the test cases in the codebase. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Documentation
participant Implementation
User->>Documentation: Read waitForSelector() API reference
Documentation->>User: Shows method signature with options
Documentation->>User: Shows state options (visible/hidden/attached/detached)
Documentation->>User: Shows defaults (state=visible, timeout=30000, pierceShadow=true)
Documentation->>User: Provides code examples
User->>Implementation: Calls page.waitForSelector(selector, options)
Implementation->>Implementation: Uses MutationObserver for efficiency
Implementation->>Implementation: Pierces shadow DOM if pierceShadow=true
Implementation->>Implementation: Supports iframe hop notation with >>
Implementation->>User: Returns true when condition met
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant User as User Script
participant API as Page.waitForSelector()
participant DOM as Browser DOM
Note over User,DOM: Visualization of the newly documented logic (No code changes)
User->>API: waitForSelector(selector, options)
Note right of User: New Docs cover:<br/>state, timeout, pierceShadow
API->>API: Apply Defaults
Note right of API: state: "visible"<br/>timeout: 30000ms<br/>pierceShadow: true
loop Until State Met or Timeout
API->>DOM: Query Selector
Note over API,DOM: Supports ">>" (iframe) & Shadow DOM
alt Condition Met (e.g. Visible)
DOM-->>API: Element Found
API-->>User: Returns true
else Condition Not Met
DOM-->>API: null
API->>API: Wait / MutationObserver
end
opt Timeout Exceeded
API-->>User: Throw Error
end
end
why
missing docs for new
page.waitForSelector()what changed
Add API reference documentation for page.waitForSelector() method including:
test plan
Summary by cubic
Adds API reference for page.waitForSelector(), with options, defaults, and practical examples. Addresses STG-1125 by filling the missing docs.
Written for commit 7df5f4b. Summary will update on new commits. Review in cubic
why
what changed
test plan