nixos/tests/vaultwarden: update
New web builds required updated title information to look for. Rocket by default only listens on localhost, set to 0.0.0.0 to be reachable by the client. Selenium/Webdriver API changes required updates to function calls.
This commit is contained in:
parent
86e3f6a1ed
commit
bfb1246d29
@ -74,7 +74,10 @@ let
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
dbBackend = backend;
|
||||
config.rocketPort = 80;
|
||||
config = {
|
||||
rocketAddress = "0.0.0.0";
|
||||
rocketPort = 80;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
@ -85,6 +88,8 @@ let
|
||||
{
|
||||
libraries = [ pkgs.python3Packages.selenium ];
|
||||
} ''
|
||||
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver import Firefox
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
@ -101,40 +106,40 @@ let
|
||||
|
||||
wait.until(EC.title_contains("Create Account"))
|
||||
|
||||
driver.find_element_by_css_selector('input#email').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#email').send_keys(
|
||||
'${userEmail}'
|
||||
)
|
||||
driver.find_element_by_css_selector('input#name').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#name').send_keys(
|
||||
'A Cat'
|
||||
)
|
||||
driver.find_element_by_css_selector('input#masterPassword').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#masterPassword').send_keys(
|
||||
'${userPassword}'
|
||||
)
|
||||
driver.find_element_by_css_selector('input#masterPasswordRetype').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#masterPasswordRetype').send_keys(
|
||||
'${userPassword}'
|
||||
)
|
||||
|
||||
driver.find_element_by_xpath("//button[contains(., 'Submit')]").click()
|
||||
driver.find_element(By.XPATH, "//button[contains(., 'Submit')]").click()
|
||||
|
||||
wait.until_not(EC.title_contains("Create Account"))
|
||||
|
||||
driver.find_element_by_css_selector('input#masterPassword').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#masterPassword').send_keys(
|
||||
'${userPassword}'
|
||||
)
|
||||
driver.find_element_by_xpath("//button[contains(., 'Log In')]").click()
|
||||
driver.find_element(By.XPATH, "//button[contains(., 'Log In')]").click()
|
||||
|
||||
wait.until(EC.title_contains("My Vault"))
|
||||
wait.until(EC.title_contains("Bitwarden Web Vault"))
|
||||
|
||||
driver.find_element_by_xpath("//button[contains(., 'Add Item')]").click()
|
||||
driver.find_element(By.XPATH, "//button[contains(., 'Add Item')]").click()
|
||||
|
||||
driver.find_element_by_css_selector('input#name').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#name').send_keys(
|
||||
'secrets'
|
||||
)
|
||||
driver.find_element_by_css_selector('input#loginPassword').send_keys(
|
||||
driver.find_element(By.CSS_SELECTOR, 'input#loginPassword').send_keys(
|
||||
'${storedPassword}'
|
||||
)
|
||||
|
||||
driver.find_element_by_xpath("//button[contains(., 'Save')]").click()
|
||||
driver.find_element(By.XPATH, "//button[contains(., 'Save')]").click()
|
||||
'';
|
||||
in
|
||||
[ pkgs.firefox-unwrapped pkgs.geckodriver testRunner ];
|
||||
|
Loading…
Reference in New Issue
Block a user