From f0dbf61e47abe28de588c9da564794da9a1431d6 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 14 Mar 2024 10:17:09 +0800 Subject: [PATCH] MDL-80479 behat: improve new test for quiz timer --- .../behat/quiz_activity_availability.feature | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mod/quiz/tests/behat/quiz_activity_availability.feature b/mod/quiz/tests/behat/quiz_activity_availability.feature index 20b1c3b8321..bb07940006d 100644 --- a/mod/quiz/tests/behat/quiz_activity_availability.feature +++ b/mod/quiz/tests/behat/quiz_activity_availability.feature @@ -42,7 +42,7 @@ Feature: Quiz availability can be set | opentext | timeopen | attemptvisibility | quizavailability | # Case 1 - open is set to future date, close is disabled. | Opens | ##tomorrow## | should not | should | - # Case 4 - open is set to past date, close is disabled. + # Case 4 - open is set to past date, close is disabled. | Opened | ##yesterday## | should | should not | Scenario Outline: Set quiz closing time while opening time is disabled @@ -110,22 +110,18 @@ Feature: Quiz availability can be set @javascript Scenario Outline: Timer is displayed when quiz closes in less than an hour Given the following "activities" exist: - | activity | course | name | - | quiz | C1 | Quiz 1 | + | activity | course | name | timeclose | + | quiz | C1 | Quiz 1 | | And quiz "Quiz 1" contains the following questions: | question | page | | TF1 | 1 | - Given I am on the "Quiz 1" "quiz activity editing" page logged in as teacher1 - And I set the following fields to these values: - | timeclose[enabled] | 1 | - | Close the quiz | | - And I press "Save and display" + And I am on the "Quiz 1" "quiz activity" page logged in as "teacher1" When I press "Preview quiz" # Confirm timer visibility for teacher Then I see "Time left" - # Confirm timer visibility for student - And I am on the "Quiz 1" "quiz activity" page logged in as student1 + And I am on the "Quiz 1" "quiz activity" page logged in as "student1" And I press "Attempt quiz" + # Confirm timer visibility for student And I see "Time left" Examples: