From 485107604fe24591472a7776942e2e5d9c5298e8 Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Sun, 19 Mar 2023 19:55:29 +0200 Subject: [PATCH] tests: functional: Fix setting first ethernet connection as internal Tested that all samba tests pass in testing container. Also checked that connection type texts are not translated, thus safe to use in xpath search. Fixes #2333. Signed-off-by: Veiko Aasa Reviewed-by: James Valleroy --- plinth/tests/functional/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index ecf939dfe..edcc133b6 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -555,7 +555,10 @@ def backup_restore(browser, app_name, archive_name=None): def networks_set_firewall_zone(browser, zone): """"Set the network device firewall zone as internal or external.""" nav_to_module(browser, 'networks') + # First active Ethernet connection device = browser.find_by_xpath( + '//span[contains(@class, "connection-type-label") and ' + 'contains(., "Ethernet") ]/../..' '//span[contains(@class, "badge-success") ' 'and contains(@class, "connection-status-label")]/following::a').first network_id = device['href'].split('/')[-3]