Optimizer: add static grid export limit (#32541)
This commit is contained in:
parent
f2c45b0d84
commit
3093539af5
25 changed files with 373 additions and 44 deletions
|
|
@ -112,6 +112,64 @@ maxconsumptionpower:
|
|||
await expectModalHidden(hemsModal);
|
||||
});
|
||||
|
||||
test("grid export limit", async ({ page }) => {
|
||||
await start(CONFIG);
|
||||
await page.goto("/#/config");
|
||||
|
||||
const hemsModal = page.getByTestId("hems-modal");
|
||||
const section = hemsModal.getByTestId("grid-export-limit");
|
||||
|
||||
// hidden without experimental
|
||||
await page.getByTestId("hems").getByRole("button", { name: "edit" }).click();
|
||||
await expectModalVisible(hemsModal);
|
||||
await expect(section).not.toBeVisible();
|
||||
await hemsModal.getByRole("button", { name: "Close" }).click();
|
||||
await expectModalHidden(hemsModal);
|
||||
|
||||
// enable experimental
|
||||
await page.getByTestId("generalconfig-experimental").getByRole("button", { name: "edit" }).click();
|
||||
const experimentalModal = page.getByTestId("experimental-modal");
|
||||
await expectModalVisible(experimentalModal);
|
||||
await experimentalModal.getByLabel("Enable experimental features.").click();
|
||||
await experimentalModal.getByRole("button", { name: "Close" }).click();
|
||||
await expectModalHidden(experimentalModal);
|
||||
|
||||
await page.getByTestId("hems").getByRole("button", { name: "edit" }).click();
|
||||
await expectModalVisible(hemsModal);
|
||||
const toggle = section.getByRole("switch", { name: "Grid export limit" });
|
||||
const input = section.getByRole("spinbutton", { name: "Grid export limit" });
|
||||
const staticTab = hemsModal.getByRole("link", { name: "Static limits" });
|
||||
|
||||
await staticTab.click();
|
||||
|
||||
// initially off, input collapsed
|
||||
await expect(toggle).not.toBeChecked();
|
||||
await expect(input).not.toBeVisible();
|
||||
|
||||
// enable, set value, commit via Enter
|
||||
await toggle.click();
|
||||
await expect(input).toBeVisible();
|
||||
await input.fill("7000");
|
||||
await input.press("Enter");
|
||||
await expect(section.getByText("Saved.")).toBeVisible();
|
||||
|
||||
await hemsModal.getByRole("button", { name: "Close" }).click();
|
||||
await expectModalHidden(hemsModal);
|
||||
|
||||
// persisted across restart
|
||||
await restart(CONFIG);
|
||||
await page.reload();
|
||||
await page.getByTestId("hems").getByRole("button", { name: "edit" }).click();
|
||||
await expectModalVisible(hemsModal);
|
||||
await staticTab.click();
|
||||
await expect(toggle).toBeChecked();
|
||||
await expect(input).toHaveValue("7000");
|
||||
|
||||
// switch off removes limit, collapse is the feedback
|
||||
await toggle.click();
|
||||
await expect(input).not.toBeVisible();
|
||||
});
|
||||
|
||||
test("user-defined relay drives external limit without circuits", async ({ page }) => {
|
||||
const GRID_CONFIG = "hems-grid.evcc.yaml";
|
||||
await startSimulator();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue