Skip to content

fix(playwright): waitFor instead of waitForSelector for action popover button#7464

Merged
nmgarza5 merged 2 commits intomainfrom
nikg/pw/fix-sendMessage
Jan 16, 2026
Merged

fix(playwright): waitFor instead of waitForSelector for action popover button#7464
nmgarza5 merged 2 commits intomainfrom
nikg/pw/fix-sendMessage

Conversation

@nmgarza5
Copy link
Copy Markdown
Contributor

@nmgarza5 nmgarza5 commented Jan 16, 2026

Description

For action popover, use locator.waitFor instead of page.waitForSelector

the latter is deprecated. we should make this switch across the playwright suite generally. my theory is the test runner is stalling and that issue is exacerbated by waitForSelector.

How Has This Been Tested?

existing

Additional Options

  • [Optional] Override Linear Check

Summary by cubic

Removed networkidle wait in sendMessage and a redundant AI response check to reduce flakiness with streaming/background requests. Stabilized Action Management by waiting on locators before clicking, making tests faster and more reliable.

Written for commit c01f943. Summary will update on new commits.

@nmgarza5 nmgarza5 requested a review from a team as a code owner January 16, 2026 18:23
@nmgarza5 nmgarza5 changed the title remove networkidle check fix(playwright): remove networkidle check in sendMesage Jan 16, 2026
@nmgarza5 nmgarza5 changed the title fix(playwright): remove networkidle check in sendMesage fix(playwright): remove networkidle check in sendMessage Jan 16, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

Removed the waitForLoadState("networkidle") check from the sendMessage() E2E test utility function. The function already has explicit waits for the AI message to appear (30s timeout) and for the URL to update with chatId= (10s timeout), making the networkidle check redundant.

  • Simplified test synchronization by removing potentially flaky networkidle wait
  • Relies on more specific, explicit waits that directly verify expected behavior
  • Change is isolated to test infrastructure and doesn't affect application code

Confidence Score: 4/5

  • This PR is safe to merge with low risk
  • The change removes a potentially unreliable wait condition while keeping two explicit, targeted waits that verify the actual expected behavior. The function already waits for the AI message to appear and the URL to update, making the networkidle check redundant. However, there's a slight concern about whether the networkidle wait was catching edge cases that the explicit waits might miss, though the existing waits appear comprehensive.
  • No files require special attention

Important Files Changed

Filename Overview
web/tests/e2e/utils/chatActions.ts Removed waitForLoadState("networkidle") check after message sending - relies on existing explicit waits for AI message and URL change instead

Sequence Diagram

sequenceDiagram
    participant Test as E2E Test
    participant sendMessage as sendMessage()
    participant Page as Browser Page
    participant UI as Chat UI
    
    Test->>sendMessage: Call with message text
    sendMessage->>Page: Count existing AI messages
    Page-->>sendMessage: existingMessageCount
    sendMessage->>Page: Click chat input textarea
    sendMessage->>Page: Fill message text
    sendMessage->>Page: Click send button
    sendMessage->>Page: Wait for AI message count to increase
    Note over sendMessage,Page: Timeout: 30 seconds
    Page->>UI: Monitor for new AI message
    UI-->>Page: New AI message appears
    Page-->>sendMessage: Count increased
    sendMessage->>Page: Wait for URL to contain 'chatId='
    Note over sendMessage,Page: Timeout: 10 seconds
    Page-->>sendMessage: URL updated
    Note over sendMessage: REMOVED: waitForLoadState("networkidle")
    sendMessage-->>Test: Message sent successfully
Loading

@nmgarza5 nmgarza5 changed the title fix(playwright): remove networkidle check in sendMessage fix(playwright): waitFor instead of waitForSelector for action popover button Jan 16, 2026
@nmgarza5 nmgarza5 added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 6cdeb71 Jan 16, 2026
95 checks passed
@nmgarza5 nmgarza5 deleted the nikg/pw/fix-sendMessage branch January 16, 2026 20:14
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.

2 participants