wireguard: Update functional tests to handle Start Server button

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
James Valleroy 2026-01-21 20:47:21 -05:00
parent 53f7c75d8e
commit 0614b5e509
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 6 additions and 1 deletions

View File

@ -59,7 +59,7 @@
{% if not server.public_key %}
<form method="post" action="{% url 'wireguard:enable-server' %}">
{% csrf_token %}
<button type="submit" class="btn btn-primary"
<button type="submit" class="btn btn-primary btn-start-server"
title="{% trans 'Start WireGuard Server' %}">
<span class="fa fa-rocket" aria-hidden="true"></span>
{% trans "Start WireGuard Server" %}

View File

@ -67,6 +67,11 @@ class TestWireguardApp(functional.BaseAppTests):
def _add_client(browser, key):
"""Add a client."""
functional.nav_to_module(browser, 'wireguard')
# Start the server on FreedomBox, if needed.
start_server_button = browser.find_by_css('.btn-start-server')
if start_server_button:
start_server_button.first.click()
browser.find_by_css('.btn-add-client').first.click()
browser.find_by_id('id_public_key').fill(key)
functional.submit(browser, form_class='form-add-client')