Skip to content

The open alternative to Salesforce, designed for AI.

fix: E2E login test flakiness (#17233)

Félix Malfait0b3f243f24fc
diff --git a/packages/twenty-e2e-testing/lib/pom/loginPage.ts b/packages/twenty-e2e-testing/lib/pom/loginPage.ts
index f6903199757..9d5f8551226 100644
--- a/packages/twenty-e2e-testing/lib/pom/loginPage.ts
+++ b/packages/twenty-e2e-testing/lib/pom/loginPage.ts
@@ -1,4 +1,4 @@
-import { expect, Locator, Page } from '@playwright/test';
+import { type Locator, type Page } from '@playwright/test';
export class LoginPage {
private readonly loginWithGoogleButton: Locator;
@@ -86,9 +86,10 @@ export class LoginPage {
}
async clickLoginWithEmailIfVisible() {
- const isVisible = await this.loginWithEmailButton.isVisible();
- if (isVisible) {
+ try {
await this.loginWithEmailButton.click();
+ } catch {
+ // Button not found - email field might already be visible (SSO-only or different auth flow)
}
}
@@ -105,11 +106,7 @@ export class LoginPage {
}
async typeEmail(email: string) {
- // Wait for the email field to be visible before trying to interact
- await this.emailField.waitFor({ state: 'visible' });
- await expect(this.emailField).toBeVisible();
-
- await this.emailField.fill(email);
+ await this.emailField.fill(email, { timeout: 10000 });
}
async typePassword(email: string) {