From b6a5bcc79226435bf59d02bbf04bafe700aca8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 24 Feb 2026 18:14:56 +0100 Subject: [PATCH] nixos/tests/vaultwarden: fix web ui test, disable cli tests as they require internet now --- nixos/tests/vaultwarden.nix | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/nixos/tests/vaultwarden.nix b/nixos/tests/vaultwarden.nix index 18115d8a2259..329ee3fdf963 100644 --- a/nixos/tests/vaultwarden.nix +++ b/nixos/tests/vaultwarden.nix @@ -30,6 +30,7 @@ let libraries = [ pkgs.python3Packages.selenium ]; flakeIgnore = [ "E501" ]; } + # python '' from selenium.webdriver.common.by import By @@ -80,6 +81,13 @@ let wait.until_not(EC.title_contains("Set a strong password")) + wait.until_not(EC.title_contains("Join organization")) + + # NOTE: When testing this locally, the extensions must not be installed, otherwise this screen does not appear + click_when_unobstructed((By.XPATH, "//button[contains(., 'Add it later')]")) + + click_when_unobstructed((By.XPATH, "//a[contains(., 'Skip to web app')]")) + click_when_unobstructed((By.XPATH, "//button[contains(., 'New item')]")) driver.find_element(By.XPATH, '//input[@formcontrolname="name"]').send_keys( @@ -205,7 +213,7 @@ let testScript else '' - import json + # import json start_all() server.wait_for_unit("vaultwarden.service") @@ -222,18 +230,20 @@ let with subtest("use the web interface to sign up, log in, and save a password"): server.succeed("PYTHONUNBUFFERED=1 systemd-cat -t test-runner test-runner") - with subtest("log in with the cli"): - key = client.succeed( - "bw --nointeraction --raw login ${userEmail} ${userPassword}" - ).strip() + # Upstreams sees offline usage as a new feature... + # https://github.com/bitwarden/clients/issues/18110 + # with subtest("log in with the cli"): + # key = client.succeed( + # "bw --nointeraction --raw login ${userEmail} ${userPassword}" + # ).strip() - with subtest("sync with the cli"): - client.succeed(f"bw --nointeraction --raw --session {key} sync -f") + # with subtest("sync with the cli"): + # client.succeed(f"bw --nointeraction --raw --session {key} sync -f") - with subtest("get the password with the cli"): - output = json.loads(client.succeed(f"bw --nointeraction --raw --session {key} list items")) + # with subtest("get the password with the cli"): + # output = json.loads(client.succeed(f"bw --nointeraction --raw --session {key} list items")) - assert output[0]['login']['password'] == "${storedPassword}" + # assert output[0]['login']['password'] == "${storedPassword}" ''; } );