Skip to content

chore(admin): Improve Playwright test speeds#8326

Merged
justin-tahara merged 3 commits intomainfrom
jtahara/admin-test-faster
Feb 11, 2026
Merged

chore(admin): Improve Playwright test speeds#8326
justin-tahara merged 3 commits intomainfrom
jtahara/admin-test-faster

Conversation

@justin-tahara
Copy link
Copy Markdown
Contributor

@justin-tahara justin-tahara commented Feb 11, 2026

Description

This is to just make the tests run faster. Purely optimizing the playwright tests to be faster.

How Has This Been Tested?

Ran playwright locally

Additional Options

  • [Required] I have considered whether this PR needs to be cherry-picked to the latest beta branch.
  • [Optional] Override Linear Check

Summary by cubic

Speeds up Playwright E2E tests by replacing sleeps with deterministic waits and using lighter load states. Cuts runtime and flakiness across chat, scroll behavior, and MCP OAuth flows.

  • Refactors
    • Use domcontentloaded instead of networkidle where full quiescence isn’t needed; remove post-send networkidle waits and fixed delays.
    • Replace waitForTimeout with state-based waits: locator/selector visibility (modals, inputs, tool toggles), waitForURL with regex, dialog visibility, and expect.poll for top-offset and scrollTop checks.
    • Harden MCP OAuth: faster polling (100→50ms, 250→100ms), wait for password field after username, shorter retry delays, assert toggles via data-state, and wait for auth modal fields instead of fixed sleeps.
    • Update auth/chat utils/tests to rely on URL regex + domcontentloaded and stable selectors; remove idle waits throughout.

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

@justin-tahara justin-tahara requested a review from a team as a code owner February 11, 2026 02:49
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR optimizes Playwright test execution speed by replacing arbitrary timeout waits with deterministic assertions and state checks. The changes replace page.waitForTimeout() calls with proper Playwright assertions (toBeVisible, waitForSelector, expect.poll), switch from networkidle to the faster domcontentloaded load state, and reorder selectors in the MCP OAuth flow to check more common patterns first. These improvements reduce test flakiness while significantly decreasing test runtime.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes follow Playwright best practices by replacing arbitrary timeouts with proper assertions, making tests both faster and more reliable. All modifications are confined to test files with no impact on production code.
  • No files require special attention

Important Files Changed

Filename Overview
web/tests/e2e/chat/default_assistant.spec.ts Replaced networkidle with domcontentloaded and replaced waitForTimeout with proper assertions using toBeVisible
web/tests/e2e/chat/message_edit_regenerate.spec.ts Removed arbitrary waitForTimeout calls and replaced with proper waitForSelector assertions
web/tests/e2e/chat/scroll_behavior.spec.ts Replaced waitForTimeout with expect.poll for scroll behavior and improved timeout handling for dynamic spacer
web/tests/e2e/mcp/mcp_oauth_flow.spec.ts Optimized selector ordering, reduced timeout values, and replaced arbitrary waits with proper assertions
web/tests/e2e/utils/auth.ts Changed from networkidle to domcontentloaded and improved URL regex pattern for signup redirect
web/tests/e2e/utils/chatActions.ts Removed networkidle wait after message sending, relying on existing message count assertion

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 6 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2026

Preview Deployment

Status Preview Commit Updated
https://onyx-preview-l4dj3vx4d-danswer.vercel.app bd724df 2026-02-11 19:53:04 UTC

@justin-tahara justin-tahara added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit f06465b Feb 11, 2026
121 of 126 checks passed
@justin-tahara justin-tahara deleted the jtahara/admin-test-faster branch February 11, 2026 20:19
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