diff options
| author | Raúl Benencia <id@rbenencia.name> | 2026-06-04 11:47:22 -0300 |
|---|---|---|
| committer | Raul Benencia <46945030+raul-te@users.noreply.github.com> | 2026-06-04 16:54:47 -0300 |
| commit | 3907fcb858ccd85ada9255d0eabefb5f41f9da50 (patch) | |
| tree | ce47bbac65dc086f44ba64a094bf2242e8b7597f /test/integ-test/integ_test.py | |
| parent | 8fe49893010063ad2eb6846a7649f4f43b7fd964 (diff) | |
test: add frontend smoke js test
Diffstat (limited to 'test/integ-test/integ_test.py')
| -rwxr-xr-x | test/integ-test/integ_test.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/test/integ-test/integ_test.py b/test/integ-test/integ_test.py index fe3899e..ca1c90e 100755 --- a/test/integ-test/integ_test.py +++ b/test/integ-test/integ_test.py @@ -18,6 +18,7 @@ import os import signal +import shutil import subprocess import sys import time @@ -79,8 +80,8 @@ def shoelaces_instance(config_file): sys.stderr.write("\nDone\n") -def test_shoelaces_startup(shoelaces_instance): - """ Test API liveness """ +def wait_for_shoelaces(): + """Wait until the integration server is accepting requests.""" attempts = 0 while True: try: @@ -96,12 +97,29 @@ def test_shoelaces_startup(shoelaces_instance): time.sleep(1) +def test_shoelaces_startup(shoelaces_instance): + """ Test API liveness """ + wait_for_shoelaces() + + @pytest.mark.parametrize(("path"), [("/"), ("/events"), ("/mappings")]) def test_response_success(shoelaces_instance, path): r = requests.get("{}{}".format(API_URL, path)) r.raise_for_status() +def test_frontend_browser_smoke(shoelaces_instance): + """Exercise local.js in a real browser against the integration server.""" + if shutil.which("node") is None: + pytest.skip("node is required for the frontend smoke test") + if shutil.which("chromium") is None: + pytest.skip("chromium is required for the frontend smoke test") + + wait_for_shoelaces() + script = os.path.join(TEST_DIR, "frontend_smoke.js") + subprocess.check_call(["node", script, API_URL], cwd=BASE_DIR) + + REQUEST_RESPONSE_PAIRS = [("/static/", "static.html"), ("/configs/static/", "configs-static-default.txt"), ("/configs/static/rc.local-bootstrap", |
