Conversation
dfa0939 to
c0d2bdd
Compare
Greptile SummaryModernized Playwright test patterns by replacing deprecated
Note: File still contains several instances of the old Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test Runner
participant Page as Playwright Page
participant DOM as Browser DOM
Note over Test,DOM: Old Pattern (waitForSelector)
Test->>Page: waitForSelector('[data-testid="onyx-logo"]', timeout: 5000)
Page->>DOM: Poll for element (5s timeout)
alt Element found within 5s
DOM-->>Page: Element handle
Page-->>Test: ElementHandle
Test->>Test: expect(element).toBeTruthy()
else Timeout after 5s
DOM-->>Page: Timeout error
Page-->>Test: Error thrown
end
Note over Test,DOM: New Pattern (locator().waitFor())
Test->>Page: locator('[data-testid="onyx-logo"]').waitFor()
Page->>DOM: Poll for element (10s default timeout)
alt Element found within 10s
DOM-->>Page: Element visible
Page-->>Test: Promise resolved
else Timeout after 10s
DOM-->>Page: Timeout error
Page-->>Test: Error thrown
end
|
There was a problem hiding this comment.
Additional Comments (2)
-
web/tests/e2e/chat/default_assistant.spec.ts, line 102-106 (link)style: Inconsistent pattern - should also be updated to use
locator().waitFor()like the changes in the same fileNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
web/tests/e2e/chat/default_assistant.spec.ts, line 133-137 (link)style: Same pattern should be updated for consistency
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
2 files reviewed, 2 comments
Description
this test constantly is flaky
targeted changes:
waitForSelector is deprecated and default waitFor is 10 seconds. so updated the action toggle command specifically to use this pattern and switching to some explicit expect.locator().toBeVisible() for some others.
How Has This Been Tested?
ci
Additional Options
Summary by cubic
Deflaked the Default Assistant E2E by replacing deprecated waits with locator-based waits and explicit visibility checks. Uses Playwright’s default 10s auto-wait to reduce CI flakiness.
Written for commit dfa0939. Summary will update on new commits.