Files
hockey_new/tests/test_build198_match_access_loading.py

34 lines
1.2 KiB
Python

"""Native access dialog remains usable before the real match loader takes focus."""
from pathlib import Path
import os
import shutil
import subprocess
import pytest
ROOT = Path(__file__).resolve().parents[1]
CASES = [
'viewer_choice_is_interactive',
'operator_choice_waits_for_mapping',
'claim_failure_can_continue_viewing',
'escape_continues_as_viewer',
'stale_choice_cannot_open_previous_match',
'existing_controller_needs_no_new_choice',
'viewer_incomplete_rosters_can_continue',
'missing_access_toolbar_does_not_hang',
'coalesced_default_selection_still_waits_for_choice',
]
@pytest.mark.parametrize('case', CASES)
def test_match_access_loading(case):
node = shutil.which('node')
assert node, 'Node is required for the match-access browser regression'
source = Path(os.environ.get('BUILD198_ACCESS_RUNTIME_ROOT', ROOT))
result = subprocess.run(
[node, str(ROOT / 'tests/build198_match_access_loading.cjs'), case, str(source)],
cwd=ROOT, capture_output=True, text=True, timeout=45,
)
assert result.returncode == 0, result.stdout + result.stderr
assert f'PASS access loading: {case}' in result.stdout, 'The browser scenario must finish every assertion'