Skip to content

Commit d9a38c7

Browse files
committed
test(ui): synchronize cloud worker settings saves
1 parent b1d5e78 commit d9a38c7

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎ui/src/e2e/cloud-workers-settings.e2e.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ suite.define(() => {
7777
await page.getByRole("button", { name: "Add profile" }).click();
7878
await page.getByLabel("Profile ID").fill("build-fleet");
7979
await page.getByLabel("Crabbox backend").fill("hetzner");
80+
await expect.poll(() => page.getByLabel("Profile ID").inputValue()).toBe("build-fleet");
81+
await expect.poll(() => page.getByLabel("Crabbox backend").inputValue()).toBe("hetzner");
8082
await gateway.deferNext("config.patch");
8183
const addRequestCount = (await gateway.getRequests("config.patch")).length;
8284
await page.getByRole("button", { name: "Save" }).click();
@@ -139,6 +141,19 @@ suite.define(() => {
139141
.locator("wa-switch")
140142
.click();
141143
await page.getByLabel("Crabbox binary").fill("/opt/bin/crabbox");
144+
await expect
145+
.poll(() => page.getByLabel("Machine class", { exact: true }).inputValue())
146+
.toBe("custom");
147+
await expect.poll(() => page.getByLabel("Custom machine class").inputValue()).toBe("ccx53");
148+
await expect.poll(() => page.getByLabel("Max lifetime").inputValue()).toBe("12h");
149+
await expect
150+
.poll(() =>
151+
page.getByRole("switch", { name: "Desktop", exact: true }).getAttribute("aria-checked"),
152+
)
153+
.toBe("true");
154+
await expect
155+
.poll(() => page.getByLabel("Crabbox binary").inputValue())
156+
.toBe("/opt/bin/crabbox");
142157
await gateway.deferNext("config.patch");
143158
const editRequestCount = (await gateway.getRequests("config.patch")).length;
144159
await page.getByRole("button", { name: "Save" }).click();
@@ -195,6 +210,8 @@ suite.define(() => {
195210
await page.getByRole("button", { name: "Add profile" }).click();
196211
await page.getByLabel("Profile ID").fill("pending");
197212
await page.getByLabel("Crabbox backend").fill("aws");
213+
await expect.poll(() => page.getByLabel("Profile ID").inputValue()).toBe("pending");
214+
await expect.poll(() => page.getByLabel("Crabbox backend").inputValue()).toBe("aws");
198215
await gateway.deferNext("config.patch");
199216
const pendingRequestCount = (await gateway.getRequests("config.patch")).length;
200217
await page.getByRole("button", { name: "Save" }).click();

0 commit comments

Comments
 (0)