FreedomBox/plinth/tests/functional/enable-all-apps
James Valleroy c7673e039d
tests: functional: Add enable-all-apps script
[sunil]

- Move the script to plinth/tests/functional directory as it is the right place
for it.

- Add HACKING.md entry to talk about the script.

- Update the pyproject.toml to ensure that functional tests config.ini is
installed along with functional tests python code.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2025-03-24 15:15:01 -07:00

32 lines
682 B
Python
Executable File

#!/usr/bin/python3
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Set FREEDOMBOX_URL to the URL of the FreedomBox on which
# all apps will be enabled.
from splinter import Browser
from plinth import app as app_module, module_loader
from plinth.tests.functional import app_enable, install, login
module_loader.load_modules()
app_module.apps_init()
browser = Browser('firefox')
login(browser)
for app in app_module.App.list():
app_name = app.app_id
try:
# Some apps cannot be installed.
install(browser, app_name)
except:
pass
try:
app_enable(browser, app_name)
except:
# Some apps cannot be enabled.
pass