mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-13 09:13:30 +01:00
feat(eosdash): add a setup assistant for the basic configuration
New users have to find the settings EOS needs among all configuration values on the Config page, without a hint which ones matter or what is still missing. The new Setup page takes the user through the configuration step by step. Each step explains a few settings, gives an example, reports what is still to do and shows the configuration cards of exactly these settings. The cards are the ones of the Config page; the code that creates a card and sends an update moved out of Configuration() into config_card() and config_update(). The assistant keeps no state: the step travels with the requests and the status is derived from the EOS configuration, which is read and written through the EOS server only. First steps: location, horizons and energy management, save the configuration. Signed-off-by: SchaafAlexander <86607129+SchaafAlexander@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Assisted-by: Claude Code (claude-fable-5-2)
This commit is contained in:
committed by
Bobby Noelte
co-authored by
Claude Fable 5.2
parent
3bcc902104
commit
7f4014c408
@@ -174,3 +174,30 @@ class TestEOSdashInBrowser:
|
||||
assert status == 200, f"{path}: HTTP {status}"
|
||||
assert dash.page_content().strip(), f"{path}: no content rendered"
|
||||
assert dash.errors == []
|
||||
|
||||
def test_setup_wizard_stays_on_step_after_config_update(self, dash: DashPage) -> None:
|
||||
"""A configuration card in the setup wizard updates the value and returns to the wizard."""
|
||||
assert dash.open_tab("/eosdash/wizard") == 200
|
||||
dash.page.click("#wizard-next")
|
||||
dash.page.wait_for_selector("#wizard-back")
|
||||
|
||||
dash.page.click("#wizard summary:has-text('general.latitude')")
|
||||
value_input = "#general-latitude-update-form input[type='text']"
|
||||
dash.page.fill(value_input, "48.137")
|
||||
with dash.page.expect_response(
|
||||
lambda response: (
|
||||
urlsplit(response.url).path == "/eosdash/configuration"
|
||||
and response.request.method == "PUT"
|
||||
)
|
||||
) as response_info:
|
||||
dash.page.press(value_input, "Enter")
|
||||
assert response_info.value.ok
|
||||
dash.page.wait_for_function(
|
||||
"selector => document.querySelector(selector)?.innerHTML.includes('48.137')",
|
||||
arg=PAGE_CONTENT_SELECTOR,
|
||||
)
|
||||
|
||||
# Still the location step of the wizard, not the Config page
|
||||
assert dash.page.locator("#wizard").count() == 1
|
||||
assert "Step 2 of" in dash.page_content()
|
||||
assert dash.errors == []
|
||||
|
||||
Reference in New Issue
Block a user