This commit is contained in:
2026-08-20 00:38:07 +02:00
parent 516219513a
commit 2f26dbb1e7
6 changed files with 92 additions and 7 deletions
+28 -1
View File
@@ -68,6 +68,33 @@ def test_starting_opens_the_player(alice):
page.locator(".quiz-hud").wait_for(state="visible")
def test_the_player_shows_one_question_at_a_time(alice):
page, _ = alice
slug = _author_quiz("Player one at a time quiz")
_start(page, slug)
questions = page.locator(".quiz-question")
assert questions.nth(0).is_visible()
assert not questions.nth(1).is_visible()
page.locator(".quiz-slide-nav button:has-text('Next')").click()
assert not questions.nth(0).is_visible()
assert questions.nth(1).is_visible()
page.locator(".quiz-slide-nav button:has-text('Previous')").click()
assert questions.nth(0).is_visible()
assert not questions.nth(1).is_visible()
def test_answering_advances_to_the_next_question(alice):
page, _ = alice
slug = _author_quiz("Player advance quiz")
_start(page, slug)
questions = page.locator(".quiz-question")
questions.nth(0).locator("input[type='radio']").last.check()
questions.nth(0).locator("button:has-text('Submit answer')").click()
questions.nth(0).locator(".quiz-grade").wait_for(state="visible")
questions.nth(1).wait_for(state="visible")
assert not questions.nth(0).is_visible()
def test_the_player_renders_a_real_form_per_question(alice):
page, _ = alice
slug = _author_quiz("Player forms quiz")
@@ -129,7 +156,7 @@ def test_an_answered_question_cannot_be_resubmitted(alice):
def test_a_numeric_question_takes_a_typed_answer(alice):
page, _ = alice
slug = _author_quiz("Player numeric quiz")
slug = _author_quiz("Player numeric quiz", questions=(NUMERIC,))
_start(page, slug)
question = page.locator(".quiz-question-numeric").first
question.locator("input[name='answer_text']").fill("1024")