functional tests: Upgrade dependencies selenium and splinter

Fixes an error in testing container where installing dependencies for
functional tests wants to uninstall system installed urllib3.

Also minor quotes fixes.

Note that dependencies are upgraded only in new dev environments where
geckodriver is not yet installed.

Tests performed, in both stable and testing containers:
- Run all tests, no upgrade related failures found. There were some
  seemingly unrelated test failures in apps: calibre, ejabberd, deluged,
  minetest, users, transmission , wordpress, zoph.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa authored and Sunil Mohan Adapa committed 2024-09-30 11:47:10 -07:00
1 parent ebe6ad7556
commit 3dfada85a6
4 files changed
+12 -12

No files matched your search

@@ -77,7 +77,7 @@ def _backup_download(session_browser, downloaded_file_info, archive_name):
def _backup_restore_from_upload(session_browser, app_name,
downloaded_file_info):
path = downloaded_file_info["path"]
path = downloaded_file_info['path']
try:
_upload_and_restore(session_browser, app_name, path)
except Exception as err:
@@ -155,11 +155,11 @@ def _backup_schedule_set(browser, enable, daily, weekly, monthly, run_at,
def _download_file_logged_in(browser, url, suffix=''):
"""Download a file from Plinth, pretend being logged in via cookies"""
if not url.startswith("http"):
if not url.startswith('http'):
current_url = urllib.parse.urlparse(browser.url)
url = "%s://%s%s" % (current_url.scheme, current_url.netloc, url)
url = '%s://%s%s' % (current_url.scheme, current_url.netloc, url)
cookies = browser.driver.get_cookies()
cookies = {cookie["name"]: cookie["value"] for cookie in cookies}
cookies = {cookie['name']: cookie['value'] for cookie in cookies}
response = requests.get(url, verify=False, cookies=cookies)
with tempfile.NamedTemporaryFile(delete=False, suffix=suffix) as temp_file:
for chunk in response.iter_content(chunk_size=128):
@@ -183,8 +183,8 @@ def _open_main_page(browser):
def _upload_and_restore(browser, app_name, downloaded_file_path):
functional.nav_to_module(browser, 'backups')
browser.links.find_by_href('/plinth/sys/backups/upload/').first.click()
fileinput = browser.driver.find_element_by_id('id_backups-file')
fileinput.send_keys(downloaded_file_path)
fileinput = browser.find_by_id('id_backups-file')
fileinput.fill(downloaded_file_path)
# submit upload form
functional.submit(browser, form_class='form-upload')
# submit restore form
@@ -63,6 +63,6 @@ def _profile_download_compare(session_browser, openvpn_profile):
def _download_profile(browser):
"""Return the content of the current user's OpenVPN profile."""
browser.visit(base_url)
browser.click_link_by_href(shortcut_href)
browser.links.find_by_href(shortcut_href).click()
profile_url = f'{base_url}/plinth/apps/openvpn/profile/'
return functional.download_file(browser, profile_url)
@@ -57,11 +57,11 @@ def _remove_all_torrents(browser):
torrents.first.click()
functional.eventually(browser.is_element_not_present_by_css,
args=['#toolbar-remove.disabled'])
browser.click_link_by_id('toolbar-remove')
browser.find_by_id('toolbar-remove').click()
functional.eventually(
browser.is_element_not_present_by_css,
args=['#dialog-container[style="display: none;"]'])
browser.click_link_by_id('dialog_confirm_button')
browser.find_by_id('dialog_confirm_button').click()
functional.eventually(browser.is_element_present_by_css,
args=['#toolbar-remove.disabled'])
@@ -71,11 +71,11 @@ def _upload_sample_torrent(browser):
functional.visit(browser, '/transmission')
file_path = os.path.join(os.path.dirname(__file__), 'data',
'sample.torrent')
browser.click_link_by_id('toolbar-open')
browser.find_by_id('toolbar-open').click()
functional.eventually(browser.is_element_not_present_by_css,
args=['#upload-container[style="display: none;"]'])
browser.attach_file('torrent_files[]', [file_path])
browser.click_link_by_id('upload_confirm_button')
browser.find_by_id('upload_confirm_button').click()
functional.eventually(browser.is_element_present_by_css,
args=['#torrent_list .torrent'])