Skip to content

e2e tests#16533

Merged
ijreilly merged 30 commits intomainfrom
fix--fix-e2e
Dec 17, 2025
Merged

e2e tests#16533
ijreilly merged 30 commits intomainfrom
fix--fix-e2e

Conversation

@ijreilly
Copy link
Copy Markdown
Contributor

@ijreilly ijreilly commented Dec 12, 2025

In this PR,

  • current basic E2E tests are fixed, and some were added, covering some basic scenarios
  • some tests avec been commented out, until we decide whether they are worth fixing

The next steps are

  • evaluate the flakiness of the tests. Once they've proved not to be flaky, we should add more tests + re-write the current ones not using aria-label (cf @lucasbordeau indication).
  • We will add them back to the development flow

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 12, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:13469

This environment will automatically shut down when the PR is closed or after 5 hours.

@lucasbordeau
Copy link
Copy Markdown
Contributor

lucasbordeau commented Dec 15, 2025

I'm concerned that aria-labels won't be maintained, much like comments, and that it risks bloating our codebase.

We could consider React locators : https://playwright.dev/docs/other-locators#react-locator

@ijreilly ijreilly marked this pull request as ready for review December 16, 2025 13:08
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 16, 2025

📊 API Changes Report

GraphQL Schema Changes

GraphQL Schema Changes

[error] Error: Unable to read JSON file: /home/runner/work/twenty/twenty/main-schema-introspection.json: Not valid JSON content
at JsonFileLoader.handleFileContent (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:147:19)
at /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:95:43
at async Promise.all (index 0)
at async JsonFileLoader.load (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:88:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
at async Promise.all (index 4)
at async loadFile (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:200:25
Error: Unable to read JSON file: /home/runner/work/twenty/twenty/main-schema-introspection.json: Not valid JSON content
at JsonFileLoader.handleFileContent (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:147:19)
at /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:95:43
at async Promise.all (index 0)
at async JsonFileLoader.load (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:88:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
at async Promise.all (index 4)
at async loadFile (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:200:25
⚠️ Breaking changes or errors detected in GraphQL schema

[error] Error: Unable to read JSON file: /home/runner/work/twenty/twenty/main-schema-introspection.json: Not valid JSON content
    at JsonFileLoader.handleFileContent (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:147:19)
    at /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:95:43
    at async Promise.all (index 0)
    at async JsonFileLoader.load (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:88:9)
    at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
    at async Promise.all (index 4)
    at async loadFile (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
    at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:200:25
Error generating diff

GraphQL Metadata Schema Changes

GraphQL Metadata Schema Changes

[error] Error: Unable to read JSON file: /home/runner/work/twenty/twenty/main-metadata-schema-introspection.json: Not valid JSON content
at JsonFileLoader.handleFileContent (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:147:19)
at /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:95:43
at async Promise.all (index 0)
at async JsonFileLoader.load (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:88:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
at async Promise.all (index 4)
at async loadFile (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:200:25
Error: Unable to read JSON file: /home/runner/work/twenty/twenty/main-metadata-schema-introspection.json: Not valid JSON content
at JsonFileLoader.handleFileContent (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:147:19)
at /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:95:43
at async Promise.all (index 0)
at async JsonFileLoader.load (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:88:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
at async Promise.all (index 4)
at async loadFile (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:200:25
⚠️ Breaking changes or errors detected in GraphQL metadata schema

[error] Error: Unable to read JSON file: /home/runner/work/twenty/twenty/main-metadata-schema-introspection.json: Not valid JSON content
    at JsonFileLoader.handleFileContent (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:147:19)
    at /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:95:43
    at async Promise.all (index 0)
    at async JsonFileLoader.load (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/json-file-loader/cjs/index.js:88:9)
    at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:15:39
    at async Promise.all (index 4)
    at async loadFile (/opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/load-file.js:13:9)
    at async /opt/hostedtoolcache/node/24.11.1/x64/lib/node_modules/@graphql-inspector/cli/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sources.js:200:25
Error generating diff

REST API Analysis Error

⚠️ Error occurred while analyzing REST API changes

Error Output

REST Metadata API Analysis Error

⚠️ Error occurred while analyzing REST Metadata API changes

Error Output

⚠️ Please review these API changes carefully before merging.

⚠️ Breaking Change Protocol

Breaking changes detected but PR title does not contain "breaking" - CI will pass but action needed.

🔄 Options:

  1. If this IS a breaking change: Add "breaking" to your PR title and add BREAKING CHANGE: to your commit message
  2. If this is NOT a breaking change: The API diff tool may have false positives - please review carefully

For breaking changes, add to commit message:

feat: add new API endpoint

BREAKING CHANGE: removed deprecated field from User schema

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.

8 issues found across 28 files

Prompt for AI agents (all 8 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-e2e-testing/tests/workflow-visualizer.spec.ts">

<violation number="1" location="packages/twenty-e2e-testing/tests/workflow-visualizer.spec.ts:1">
P2: Consider using Playwright&#39;s `test.skip()` or `test.fixme()` instead of commenting out entire tests. This keeps the code type-checked, shows skipped tests in reports, and makes it easier to track and re-enable them.

Example:
```ts
test.skip(&#39;Create workflow with every possible step&#39;, async ({ workflowVisualizer, page }) =&gt; {
  // test code remains parseable
});

Or with a reason:

test.fixme(&#39;Create workflow with every possible step&#39;, async ({ workflowVisualizer, page }) =&gt; {
  // ...
});
```</violation>
</file>

<file name="packages/twenty-e2e-testing/tests/create-kanban-view.spec.ts">

<violation number="1" location="packages/twenty-e2e-testing/tests/create-kanban-view.spec.ts:52">
P2: Race condition: In `Promise.all`, the click action is listed before `waitForRequest`, which may cause the request to be missed if it fires before the listener is set up. Following the pattern in `workflow-creation.spec.ts`, the wait should come first. Also consider using `waitForResponse` instead of `waitForRequest` for consistency with existing tests.</violation>
</file>

<file name="packages/twenty-e2e-testing/tests/create-record.spec.ts">

<violation number="1" location="packages/twenty-e2e-testing/tests/create-record.spec.ts:96">
P1: Missing `await` on Playwright click action. This can cause race conditions and flaky tests since the test won&#39;t wait for the click to complete.</violation>

<violation number="2" location="packages/twenty-e2e-testing/tests/create-record.spec.ts:112">
P1: Missing `await` on Playwright click action. This can cause race conditions and flaky tests since the test won&#39;t wait for the click to complete.</violation>
</file>

<file name="packages/twenty-e2e-testing/tests/workflow-creation.spec.ts">

<violation number="1" location="packages/twenty-e2e-testing/tests/workflow-creation.spec.ts:12">
P1: `page.goto(process.env.LINK)` will fail if `LINK` environment variable is not set, as it will pass `undefined`. The original `page.goto(&#39;/&#39;)` worked with the default baseURL. Consider providing a fallback.</violation>
</file>

<file name="packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx:40">
P2: `recordGroup.value` can be `null` (per `RecordGroupDefinition` type), resulting in aria labels like &quot;Hide group null&quot;. Consider using `recordGroup.title` instead, which is always a string and is already used for the Tag display text.</violation>
</file>

<file name="packages/twenty-e2e-testing/lib/utils/getAccessAuthToken.ts">

<violation number="1" location="packages/twenty-e2e-testing/lib/utils/getAccessAuthToken.ts:16">
P1: Bug: `Array.filter()` always returns an array (possibly empty), never `null` or `undefined`. This check will never throw even when no matching cookies exist. Should check `tokenCookies.length === 0` instead.</violation>

<violation number="2" location="packages/twenty-e2e-testing/lib/utils/getAccessAuthToken.ts:26">
P1: Bug: If no access token cookie is found, `JSON.parse(&#39;&#39;)` will throw a `SyntaxError`. Add a check for `accessTokenCookie` before parsing its value.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

}
await page.getByText('Options').click();
await page.getByText('Group', { exact: true }).click();
await Promise.all([page.getByRole('button', { name: 'Hide group null', exact: true }).click(),
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Race condition: In Promise.all, the click action is listed before waitForRequest, which may cause the request to be missed if it fires before the listener is set up. Following the pattern in workflow-creation.spec.ts, the wait should come first. Also consider using waitForResponse instead of waitForRequest for consistency with existing tests.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-e2e-testing/tests/create-kanban-view.spec.ts, line 52:

<comment>Race condition: In `Promise.all`, the click action is listed before `waitForRequest`, which may cause the request to be missed if it fires before the listener is set up. Following the pattern in `workflow-creation.spec.ts`, the wait should come first. Also consider using `waitForResponse` instead of `waitForRequest` for consistency with existing tests.</comment>

<file context>
@@ -0,0 +1,59 @@
+  }
+  await page.getByText(&#39;Options&#39;).click();
+  await page.getByText(&#39;Group&#39;, { exact: true }).click();
+  await Promise.all([page.getByRole(&#39;button&#39;, { name: &#39;Hide group null&#39;, exact: true }).click(),
+    page.waitForRequest((req) =&gt; {
+    return req.url().includes(&#39;/metadata&#39;) &amp;&amp;
</file context>
Fix with Cubic

await recordFieldList.getByText('Work Preference').nth(1).click({force: true});
const options = page.getByRole('listbox');
await options.getByText('Hybrid').first().click({force: true});
recordFieldList.getByText('Work Preference').first().click({force: true});
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Missing await on Playwright click action. This can cause race conditions and flaky tests since the test won't wait for the click to complete.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-e2e-testing/tests/create-record.spec.ts, line 112:

<comment>Missing `await` on Playwright click action. This can cause race conditions and flaky tests since the test won&#39;t wait for the click to complete.</comment>

<file context>
@@ -0,0 +1,163 @@
+    await recordFieldList.getByText(&#39;Work Preference&#39;).nth(1).click({force: true});
+    const options = page.getByRole(&#39;listbox&#39;);
+    await options.getByText(&#39;Hybrid&#39;).first().click({force: true});
+    recordFieldList.getByText(&#39;Work Preference&#39;).first().click({force: true});
+
+    // Fill company relation
</file context>
Fix with Cubic

await page.getByPlaceholder('URL').press('Enter');

// Click on 4th star to rate
recordFieldList.getByText('Performance Rating').first().click({ force: true });
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Missing await on Playwright click action. This can cause race conditions and flaky tests since the test won't wait for the click to complete.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-e2e-testing/tests/create-record.spec.ts, line 96:

<comment>Missing `await` on Playwright click action. This can cause race conditions and flaky tests since the test won&#39;t wait for the click to complete.</comment>

<file context>
@@ -0,0 +1,163 @@
+    await page.getByPlaceholder(&#39;URL&#39;).press(&#39;Enter&#39;);
+
+    // Click on 4th star to rate
+    recordFieldList.getByText(&#39;Performance Rating&#39;).first().click({ force: true });
+    const ratingContainer = recordFieldList.locator(&#39;div[aria-label=&quot;Rating&quot;]&#39;);
+    await ratingContainer.locator(&#39;svg&#39;).nth(3).click({force: true});
</file context>
Fix with Cubic

const NEW_WORKFLOW_NAME = 'Test Workflow';

await page.goto('/');
await page.goto(process.env.LINK);
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: page.goto(process.env.LINK) will fail if LINK environment variable is not set, as it will pass undefined. The original page.goto('/') worked with the default baseURL. Consider providing a fallback.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-e2e-testing/tests/workflow-creation.spec.ts, line 12:

<comment>`page.goto(process.env.LINK)` will fail if `LINK` environment variable is not set, as it will pass `undefined`. The original `page.goto(&#39;/&#39;)` worked with the default baseURL. Consider providing a fallback.</comment>

<file context>
@@ -1,11 +1,15 @@
   const NEW_WORKFLOW_NAME = &#39;Test Workflow&#39;;
 
-  await page.goto(&#39;/&#39;);
+  await page.goto(process.env.LINK);
 
   const workflowsLink = page.getByRole(&#39;link&#39;, { name: &#39;Workflows&#39; });
</file context>
Suggested change
await page.goto(process.env.LINK);
await page.goto(process.env.LINK ?? '/');

✅ Addressed in 96913d8

Comment on lines +40 to +41
? `Hide group ${recordGroup.value}`
: `Show group ${recordGroup.value}`,
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: recordGroup.value can be null (per RecordGroupDefinition type), resulting in aria labels like "Hide group null". Consider using recordGroup.title instead, which is always a string and is already used for the Tag display text.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx, line 40:

<comment>`recordGroup.value` can be `null` (per `RecordGroupDefinition` type), resulting in aria labels like &quot;Hide group null&quot;. Consider using `recordGroup.title` instead, which is always a string and is already used for the Tag display text.</comment>

<file context>
@@ -36,6 +36,9 @@ export const RecordGroupMenuItemDraggable = ({
       {
         Icon: recordGroup.isVisible ? IconEyeOff : IconEye,
+        ariaLabel: recordGroup.isVisible
+          ? `Hide group ${recordGroup.value}`
+          : `Show group ${recordGroup.value}`,
         onClick: () =&gt;
</file context>
Suggested change
? `Hide group ${recordGroup.value}`
: `Show group ${recordGroup.value}`,
? `Hide group ${recordGroup.title}`
: `Show group ${recordGroup.title}`,
Fix with Cubic

}
);

const token = JSON.parse(decodeURIComponent(accessTokenCookie?.value ?? '')).accessOrWorkspaceAgnosticToken
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Bug: If no access token cookie is found, JSON.parse('') will throw a SyntaxError. Add a check for accessTokenCookie before parsing its value.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-e2e-testing/lib/utils/getAccessAuthToken.ts, line 26:

<comment>Bug: If no access token cookie is found, `JSON.parse(&#39;&#39;)` will throw a `SyntaxError`. Add a check for `accessTokenCookie` before parsing its value.</comment>

<file context>
@@ -0,0 +1,30 @@
+    }
+  );
+
+  const token = JSON.parse(decodeURIComponent(accessTokenCookie?.value ?? &#39;&#39;)).accessOrWorkspaceAgnosticToken
+  .token;
+
</file context>
Fix with Cubic

const tokenCookies = storageState.cookies.filter(
(cookie) => cookie.name === 'tokenPair',
);
if (!tokenCookies) {
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Bug: Array.filter() always returns an array (possibly empty), never null or undefined. This check will never throw even when no matching cookies exist. Should check tokenCookies.length === 0 instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-e2e-testing/lib/utils/getAccessAuthToken.ts, line 16:

<comment>Bug: `Array.filter()` always returns an array (possibly empty), never `null` or `undefined`. This check will never throw even when no matching cookies exist. Should check `tokenCookies.length === 0` instead.</comment>

<file context>
@@ -0,0 +1,30 @@
+  const tokenCookies = storageState.cookies.filter(
+    (cookie) =&gt; cookie.name === &#39;tokenPair&#39;,
+  );
+  if (!tokenCookies) {
+    throw new Error(&#39;No auth cookie found&#39;);
+  }
</file context>
Fix with Cubic

@Devessier
Copy link
Copy Markdown
Contributor

I'm concerned that aria-labels won't be maintained, much like comments, and that it risks bloating our codebase.

We could consider React locators : https://playwright.dev/docs/other-locators#react-locator

I agree that we will likely never update the accessibility labels unless accessibility becomes a team concern. However, if we use React locators, the E2E tests will be dependent on implementation details.

We should think about the best compromise.

Copy link
Copy Markdown
Contributor

@Devessier Devessier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on bringing back meaningful end-to-end tests!

One main concern: I think we should use data-testid instead of aria-label.

If possible, it would be great to remove the use of process.env.LINK.

Comment on lines +53 to +56
page.waitForRequest((req) => {
return req.url().includes('/metadata') &&
req.method() === 'POST'
})]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this kind of assertion is that we can make dozens of calls to /metadata in a single navigation. This assertion proves nothing.

We can leave it as is, but since it doesn’t prove that the action we expect was performed, it could lead to flakiness.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we expect other POST requests in this setup, nor that for now we actually do any /metadata post requests while navigating only

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I intent to make sure this is not flaky so i m keeping that in mind

}}
>
<RecordDetailSectionContainer
ariaLabel={`${fieldDefinition.label} (relation)`}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be data-testid instead.

Comment on lines +40 to +41
? `Hide group ${recordGroup.value}`
: `Show group ${recordGroup.value}`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a proper use of aria-label 👍

// Generate a random email for testing
const randomEmail = `testuser_${Math.random().toString(36).substring(2, 10)}@example.com`;
// Fill first name and last name
const firstNameInput = page.getByRole('textbox', { name: 'F‌‌irst name' })
await page.getByRole('option', { name: 'Google' }).click({force: true})
]);

const body = await updatePersonResponse.json()
@socket-security
Copy link
Copy Markdown

@ijreilly ijreilly merged commit 0145920 into main Dec 17, 2025
72 checks passed
@ijreilly ijreilly deleted the fix--fix-e2e branch December 17, 2025 07:48
@twenty-eng-sync
Copy link
Copy Markdown

Hey @ijreilly! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

abdulrahmancodes pushed a commit that referenced this pull request Dec 18, 2025
In this PR, 
- current basic E2E tests are fixed, and some were added, covering some
basic scenarios
- some tests avec been commented out, until we decide whether they are
worth fixing

The next steps are
- evaluate the flakiness of the tests. Once they've proved not to be
flaky, we should add more tests + re-write the current ones not using
aria-label (cf @lucasbordeau indication).
- We will add them back to the development flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants