Skip to content

Commit 95f53fd

Browse files
committed
fix(e2e): disable dynamic parameters for updateWorkspace tests
The updateWorkspace tests were written for the classic parameter flow. With dynamic parameters now being the default, these tests need to explicitly disable dynamic parameters via the template settings page to continue working as expected. This fix: 1. Adds a disableDynamicParameters helper function 2. Modifies all updateWorkspace tests to disable dynamic parameters after template creation 3. Ensures tests use the classic parameter flow they were designed for Fixes the failing e2e test 'update workspace with ephemeral parameter enabled'.
1 parent c4f4fe5 commit 95f53fd

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

site/e2e/helpers.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,3 +1203,36 @@ export async function addUserToOrganization(
12031203
}
12041204
await page.mouse.click(10, 10); // close the popover by clicking outside of it
12051205
}
1206+
1207+
/**
1208+
* disableDynamicParameters navigates to the template settings page and disables
1209+
* dynamic parameters by unchecking the "Enable dynamic parameters" checkbox.
1210+
*/
1211+
export const disableDynamicParameters = async (
1212+
page: Page,
1213+
templateName: string,
1214+
orgName = defaultOrganizationName,
1215+
) => {
1216+
await page.goto(`/templates/${orgName}/${templateName}/settings`, {
1217+
waitUntil: "domcontentloaded",
1218+
});
1219+
1220+
// Find and uncheck the "Enable dynamic parameters" checkbox
1221+
const dynamicParamsCheckbox = page.getByRole("checkbox", {
1222+
name: /Enable dynamic parameters for workspace creation/,
1223+
});
1224+
1225+
// If the checkbox is checked, uncheck it
1226+
if (await dynamicParamsCheckbox.isChecked()) {
1227+
await dynamicParamsCheckbox.click();
1228+
}
1229+
1230+
// Save the changes
1231+
await page.getByRole("button", { name: /save/i }).click();
1232+
1233+
// Wait for the success message or page to update
1234+
await page.waitForSelector("text=Template updated successfully", {
1235+
state: "visible",
1236+
timeout: 10000,
1237+
});
1238+
};

site/e2e/tests/workspaces/updateWorkspace.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { users } from "../../constants";
33
import {
44
createTemplate,
55
createWorkspace,
6+
disableDynamicParameters,
67
echoResponsesWithParameters,
78
updateTemplate,
89
updateWorkspace,
@@ -34,6 +35,9 @@ test("update workspace, new optional, immutable parameter added", async ({
3435
echoResponsesWithParameters(richParameters),
3536
);
3637

38+
// Disable dynamic parameters to use classic parameter flow for this test
39+
await disableDynamicParameters(page, template);
40+
3741
await login(page, users.member);
3842
const workspaceName = await createWorkspace(page, template);
3943

@@ -77,6 +81,9 @@ test("update workspace, new required, mutable parameter added", async ({
7781
echoResponsesWithParameters(richParameters),
7882
);
7983

84+
// Disable dynamic parameters to use classic parameter flow for this test
85+
await disableDynamicParameters(page, template);
86+
8087
await login(page, users.member);
8188
const workspaceName = await createWorkspace(page, template);
8289

@@ -122,6 +129,9 @@ test("update workspace with ephemeral parameter enabled", async ({ page }) => {
122129
echoResponsesWithParameters(richParameters),
123130
);
124131

132+
// Disable dynamic parameters to use classic parameter flow for this test
133+
await disableDynamicParameters(page, template);
134+
125135
await login(page, users.member);
126136
const workspaceName = await createWorkspace(page, template);
127137

0 commit comments

Comments
 (0)