Fix E2E tests broken by redesigned navigation menu#18315
Conversation
Settings is now rendered as a button (NavigationDrawerItem with onClick)
instead of a link (NavigationDrawerItem with to), so update selectors
from getByRole('link') to getByRole('button'). Also fix create-record
test's Linkedin field interaction to match the working Emails pattern
(click label first to trigger hover portal, then click value).
Made-with: Cursor
Greptile SummaryUpdated E2E test selectors to match the redesigned navigation menu where Settings changed from an anchor link to a button element. The PR also fixed the LinkedIn URL field interaction by adding an initial label click to trigger the hover portal rendering, matching the existing pattern used for the Emails field.
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 3c88708 |
Made-with: Cursor
Add label click before Phone field value click (same pattern as Emails/Linkedin fix). Add networkidle wait before second goToSettings() in signup test to prevent flakiness after signup flow completes. Made-with: Cursor
networkidle hangs due to persistent connections (WebSocket/polling). Wait for the Settings button to be visible instead, which is the actual precondition for the click. Made-with: Cursor
Made-with: Cursor
| await ratingContainer.locator('svg').nth(3).click({force: true}); | ||
|
|
||
| // Fill phone field | ||
| await recordFieldList.getByText('Phones').first().click(); |
There was a problem hiding this comment.
Bug: The .click() call on line 119 is missing the await keyword. This is inconsistent with other asynchronous calls in the test file, creating potential flakiness.
Severity: MEDIUM
Suggested Fix
Add the await keyword before the .click() call on line 119 to ensure the asynchronous operation completes before the test proceeds. The line should be await recordFieldList.getByText('Work Preference').first().click({force: true});.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/twenty-e2e-testing/tests/create-record.spec.ts#L96
Potential issue: In the E2E test, a `.click()` call on line 119 is not awaited. Since
`click()` is an asynchronous Playwright function, failing to `await` it means the test
execution will not wait for the action to complete. This introduces a potential race
condition and can lead to flaky tests. While the subsequent operation is independent,
this violates the established pattern in the file and Playwright best practices. Any
errors thrown by the click action would also not be properly handled, potentially
masking issues.
|
Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
Summary
<button>(viaNavigationDrawerItemwithonClick) instead of an<a>link (withto). UpdatedleftMenu.tsPOM andcreate-kanban-view.spec.tsto usegetByRole('button', { name: 'Settings' }).recordFieldList.getByText('Linkedin').first().click()before the value click, matching the pattern used by the working Emails field.Test plan
signup_invite_email.spec.tspasses (usesleftMenu.goToSettings())create-kanban-view.spec.tspasses (uses Settings click directly)create-record.spec.tspasses (Linkedin URL field interaction)Made with Cursor