From 4bb9287aa48502c1950fed7f8ba8b2fc7edf29c7 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Thu, 28 May 2026 23:17:17 +0200 Subject: [PATCH] home-assistant: fix login test --- modules/services/home-assistant.nix | 1 - test/services/home-assistant.nix | 38 ++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant.nix index b79e43a..b9aca1c 100644 --- a/modules/services/home-assistant.nix +++ b/modules/services/home-assistant.nix @@ -263,7 +263,6 @@ in config = { # Includes dependencies for a basic setup # https://www.home-assistant.io/integrations/default_config/ - default_config = { }; http = { use_x_forwarded_for = true; server_host = "127.0.0.1"; diff --git a/test/services/home-assistant.nix b/test/services/home-assistant.nix index f80f7fc..5afea59 100644 --- a/test/services/home-assistant.nix +++ b/test/services/home-assistant.nix @@ -40,6 +40,36 @@ let unit_system = "metric"; }; }; + services.home-assistant.extraComponents = [ + # this is effecitvely default_config (2026.5.0), but with components + # skipped that would cause ERRORs in the sandbox + "bluetooth" + "cloud" + "conversation" + "dhcp" + "energy" + "file" + # Requires go2rtc service + # "go2rtc" + "history" + # Requires DNS and HTTP queries + # "homeassistant_alerts" + "logbook" + "media_source" + "mobile_app" + "my" + "ssdp" + "stream" + "sun" + "usage_prediction" + "usb" + "webhook" + "zeroconf" + + # include some popular integrations, that absolutely shouldn't break + "knx" + "zha" + ]; }; clientLogin = @@ -63,10 +93,10 @@ let "page.get_by_role('button', name=re.compile('Create my smart home')).click()" "expect(page.get_by_text('Create user')).to_be_visible()" - "page.get_by_label(re.compile('Name')).fill('Admin')" - "page.get_by_label(re.compile('Username')).fill('admin')" - "page.get_by_label(re.compile('Password')).fill('adminpassword')" - "page.get_by_label(re.compile('Confirm password')).fill('adminpassword')" + ''page.get_by_role("textbox", name="Name*", exact=True).fill('Admin')'' + ''page.get_by_role("textbox", name="Username*").fill('admin')'' + ''page.get_by_role("textbox", name="Password*", exact=True).fill('adminpassword')'' + ''page.get_by_role("textbox", name="Confirm password*").fill('adminpassword')'' "page.get_by_role('button', name=re.compile('Create account')).click()" "expect(page.get_by_text('All set!')).to_be_visible()"