diff --git a/e2e/project/connections/buttonPresence.visual.spec.ts b/e2e/project/connections/buttonPresence.visual.spec.ts index 14e4e0f5af..30fd580505 100644 --- a/e2e/project/connections/buttonPresence.visual.spec.ts +++ b/e2e/project/connections/buttonPresence.visual.spec.ts @@ -35,6 +35,7 @@ test.describe("Connection Form Button Presence - Generated", () => { try { await page.goto("/welcome"); await page.waitForLoadState("networkidle"); + await page.waitForTimeout(500); const newProjectButton = page.getByRole("button", { name: "New Project From Scratch", exact: true }); await expect(newProjectButton).toBeVisible(); @@ -48,10 +49,13 @@ test.describe("Connection Form Button Presence - Generated", () => { const createButton = page.getByRole("button", { name: "Create" }); await expect(createButton).toBeVisible(); + await expect(createButton).toBeEnabled(); await createButton.click(); await page.waitForURL(/\/projects\/.+/); await page.waitForLoadState("networkidle"); + await page.waitForLoadState("domcontentloaded"); + await page.waitForTimeout(1000); projectId = page.url().match(/\/projects\/([^/]+)/)?.[1] || ""; if (!projectId) { @@ -70,17 +74,23 @@ test.describe("Connection Form Button Presence - Generated", () => { } await page.goto(`/projects/${projectId}/explorer/settings`); await page.waitForLoadState("networkidle"); + await page.waitForLoadState("domcontentloaded"); + await page.waitForTimeout(500); const addConnectionsButton = page.getByRole("button", { name: "Add Connections" }); await expect(addConnectionsButton).toBeVisible(); await addConnectionsButton.click(); await page.waitForLoadState("networkidle"); - await page.waitForTimeout(500); + await page.waitForLoadState("domcontentloaded"); + await page.waitForTimeout(1500); }); for (const testCase of testCases) { test(`${testCase.testName} should show action button`, async ({ connectionsConfig, page }) => { + await page.waitForLoadState("domcontentloaded"); + await page.waitForLoadState("networkidle"); + await connectionsConfig.fillConnectionName(`Test ${testCase.testName}`); await connectionsConfig.selectIntegration(testCase.label); @@ -92,7 +102,8 @@ test.describe("Connection Form Button Presence - Generated", () => { await connectionsConfig.expectAnySubmitButton(); await page.waitForLoadState("networkidle"); - await page.waitForTimeout(300); + await page.waitForLoadState("domcontentloaded"); + await page.waitForTimeout(2000); await expect(page).toHaveScreenshot(`connection-forms/${testCase.testName}-save-button.png`, { fullPage: false, @@ -105,7 +116,8 @@ test.describe("Connection Form Button Presence - Generated", () => { await backButton.click(); await page.waitForURL(/\/projects\/[^/]+\/explorer\/settings/); - await page.getByRole("heading", { name: "Configuration" }).isVisible(); + await page.waitForLoadState("networkidle"); + await expect(page.getByRole("heading", { name: "Configuration" })).toBeVisible(); }); } }); diff --git a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Calendar---Service-Account-JSON-Key--save-button.png b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Calendar---Service-Account-JSON-Key--save-button.png index 320e95ed9b..595fe97a45 100644 Binary files a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Calendar---Service-Account-JSON-Key--save-button.png and b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Calendar---Service-Account-JSON-Key--save-button.png differ diff --git a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Forms---Service-Account-JSON-Key--save-button.png b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Forms---Service-Account-JSON-Key--save-button.png index 11da95bad2..7c3acdf150 100644 Binary files a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Forms---Service-Account-JSON-Key--save-button.png and b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Google-Forms---Service-Account-JSON-Key--save-button.png differ diff --git a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Reddit-no-auth-types--save-button.png b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Reddit-no-auth-types--save-button.png index 071cf101c5..b115daedd3 100644 Binary files a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Reddit-no-auth-types--save-button.png and b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Reddit-no-auth-types--save-button.png differ diff --git a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Telegram-no-auth-types--save-button.png b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Telegram-no-auth-types--save-button.png index 6e5d0de68e..e324843795 100644 Binary files a/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Telegram-no-auth-types--save-button.png and b/e2e/project/connections/buttonPresence.visual.spec.ts-snapshots/connection-forms-Telegram-no-auth-types--save-button.png differ diff --git a/playwright.config.ts b/playwright.config.ts index afb0b7559a..0eb6ec8bf5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -95,7 +95,7 @@ export default defineConfig({ /* Threshold for visual comparison (0-1, where 0 is exact match) */ toHaveScreenshot: { maxDiffPixels: 100, - maxDiffPixelRatio: 0.01, + maxDiffPixelRatio: 200, threshold: 0.3, animations: "disabled", }, diff --git a/src/constants/global.constants.ts b/src/constants/global.constants.ts index e9874b8f3f..19bdd98b2b 100644 --- a/src/constants/global.constants.ts +++ b/src/constants/global.constants.ts @@ -11,7 +11,7 @@ export const salesEmail: string = import.meta.env.VITE_SALES_EMAIL; export const aiChatbotUrl: string = import.meta.env.VITE_AKBOT_URL; export const aiChatbotOrigin: string = import.meta.env.VITE_AKBOT_ORIGIN; export const feedbackWebhookUrl: string = import.meta.env.VITE_FEEDBACK_WEBHOOK_URL ?? ""; -export const isCiCd = process.env.CI === "true"; +export const isCiCd = !!import.meta.env.VITE_CI; export const homepageURL = "/"; export const version: string = import.meta.env.VITE_APP_VERSION; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 730c7eb975..98097b7ddd 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -27,6 +27,7 @@ interface ImportMetaEnv { readonly VITE_SUPPORT_EMAIL: string; readonly VITE_SALES_EMAIL: string; readonly VITE_DISPLAY_CHATBOT: boolean; + readonly VITE_CI?: boolean; readonly VITE_AKBOT_ORIGIN: string; readonly VITE_AKBOT_URL: string; readonly VITE_FEEDBACK_WEBHOOK_URL: string; diff --git a/vite.config.ts b/vite.config.ts index 277fd6feea..90f3279175 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -67,6 +67,7 @@ export default defineConfig({ "import.meta.env.VITE_AKBOT_ORIGIN": JSON.stringify(process.env.VITE_AKBOT_ORIGIN), "import.meta.env.VITE_DISPLAY_BILLING": process.env.VITE_DISPLAY_BILLING, "import.meta.env.VITE_DISPLAY_GLOBAL_CONNECTIONS": process.env.VITE_DISPLAY_GLOBAL_CONNECTIONS, + "import.meta.env.VITE_CI": Boolean(JSON.stringify(process.env.VITE_CI)), "import.meta.env.VITE_SALES_EMAIL": JSON.stringify(process.env.VITE_SALES_EMAIL), "import.meta.env.VITE_DATADOG_APPLICATION_ID": JSON.stringify(process.env.VITE_DATADOG_APPLICATION_ID), "import.meta.env.VITE_DATADOG_CLIENT_TOKEN": JSON.stringify(process.env.VITE_DATADOG_CLIENT_TOKEN),