File size: 814 Bytes
e40dce0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pathlib import Path


PROJECT_DIR = Path(__file__).resolve().parents[1]


def assert_results_has_next(app_dir: Path):
    results = app_dir / 'Results.html'
    assert results.exists(), f"Missing Results.html in {app_dir.name}"
    text = results.read_text(encoding='utf-8')
    assert '{{ next_button }}' in text, (
        f"Results.html in {app_dir.name} is missing '{{ next_button }}' — "
        "participants cannot proceed to the next app in a sequence"
    )


def test_classic_sequence_has_next_buttons():
    # Apps in classic_baseline sequence expected to have a next button on Results
    for app in ['prisoner', 'trust_simple', 'public_goods_simple']:
        app_dir = PROJECT_DIR / app
        assert app_dir.exists(), f"App folder not found: {app}"
        assert_results_has_next(app_dir)