This commit is contained in:
2026-10-11 16:00:53 +07:00
parent 4f4857aa53
commit 818eeaa1ac
7 changed files with 100 additions and 12 deletions
+3 -3
View File
@@ -289,13 +289,13 @@ def check_browser_flow(stand, fixtures):
js("document.querySelector('.game-button-run').click();return true;")
wait("document.body.innerText.includes('TEST Place p1')", 'first move')
assert len(stand.apis['venue'].story(captain)['actions']) == 1, 'Double submission created duplicate moves'
stand.sql('venue', f"UPDATE teams SET password='revoked' WHERE id={int(captain['ID'])};")
stand.sql('venue', f"UPDATE teams SET password='revoked' WHERE id='{captain['ID']}';")
input_value('#run', 'p2')
click('Поехали')
wait("document.body.innerText.includes('команда не найдена')", 'refused move error')
assert js("return document.querySelector('#run').value==='p2'"), 'Refused move erased the input'
escaped_password = captain['password'].replace("'", "''")
stand.sql('venue', f"UPDATE teams SET password='{escaped_password}' WHERE id={int(captain['ID'])};")
stand.sql('venue', f"UPDATE teams SET password='{escaped_password}' WHERE id='{captain['ID']}';")
stand.delay_actions = 0
stand.apis['venue'].request(f'/api/games/{game}/pause', {}, 'PUT')
wait("document.querySelector('#run').disabled", 'pause polling')
@@ -375,7 +375,7 @@ def check_browser_flow(stand, fixtures):
corrected_results = download_results()
assert corrected_results != first_results, 'Results are not fresh'
login('prod')
stand.sql('prod', f"UPDATE team_answers SET answer='Online edit', score=9 WHERE team_id={captain['ID']};")
stand.sql('prod', f"UPDATE team_answers SET answer='Online edit', score=9 WHERE team_id='{captain['ID']}';")
apply_results(corrected_results)
scores = stand.apis['prod'].request(f'/api/games/{game}/results')['teams']
assert next(t for t in scores if t['team']['ID'] == captain['ID'])['totalScore'] == 0