nextcloud: tests: functional: Fix test for modified structure of UI

- The DOM structure of the nextcloud UI seems to have changed.

Tests:

- In functional tests, with the updated code, test_create_folder test passes.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-01-06 13:54:44 -08:00 committed by James Valleroy
parent b15bca2fe4
commit 861796d21b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -112,7 +112,8 @@ def _class(klass):
def _create_folder(browser, folder_name):
"""Create a folder in the Nextcloud files app."""
# Click on the '+ New' button in the header
xpath = f'//div[{_class("action-item")} and @menu-title="New"]//button'
xpath = f'//div[{_class("action-item")}]' \
'//button[.//*[contains(text(),"New")]]'
browser.find_by_xpath(xpath).first.click()
# Click on the 'New folder' pop down menu item