Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions e2e/project/connections/buttonPresence.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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) {
Expand All @@ -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);
Expand All @@ -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,
Expand All @@ -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();
});
}
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion src/constants/global.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading