Skip to content

Commit dd45a85

Browse files
committed
add limited answer tests
1 parent baa6e32 commit dd45a85

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

Diff for: tests/behat/limitedanswer.feature

+41-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
Then I should see "This is the answer message"
4747
And I should see "This is the question message"
4848

49-
Scenario: Setting up the limited answer mode, the times need to be in order and in the future.
49+
Scenario: Setting up the limited answer mode, the times need to be in the right order
5050
Given the following "activities" exist:
5151
| activity | name | intro | course | idnumber |
5252
| moodleoverflow | Test Moodleoverflow | Test moodleoverflow description | C1 | 1 |
@@ -55,5 +55,43 @@
5555
And I follow "Test Moodleoverflow"
5656
And I follow "Settings"
5757
And I follow "Limited Answer Mode"
58-
And
59-
And I pause
58+
And I click on "la_starttime[enabled]" "checkbox"
59+
And I set the following fields to these values:
60+
| id_la_starttime_day | ##tomorrow##%d## |
61+
| id_la_starttime_month | ##tomorrow##%B## |
62+
| id_la_starttime_year | ##tomorrow##%Y## |
63+
| id_la_starttime_hour | 12 |
64+
| id_la_starttime_minute | 30 |
65+
And I click on "la_endtime[enabled]" "checkbox"
66+
And I set the following fields to these values:
67+
| id_la_endtime_day | ##yesterday##%d## |
68+
| id_la_endtime_month | ##yesterday##%B## |
69+
| id_la_endtime_year | ##yesterday##%Y## |
70+
| id_la_endtime_hour | 12 |
71+
| id_la_endtime_minute | 30 |
72+
When I press "Save and display"
73+
And I follow "Limited Answer Mode"
74+
And I click on "#collapseElement-5" "css_element"
75+
Then I should see "End time must be in the future"
76+
And I should see "The end time must be after the start time"
77+
78+
Scenario: Setting up the limited answer mode, the start times need to be in the future
79+
Given the following "activities" exist:
80+
| activity | name | intro | course | idnumber |
81+
| moodleoverflow | Test Moodleoverflow | Test moodleoverflow description | C1 | 1 |
82+
And I log in as "teacher1"
83+
And I am on "Course 1" course homepage
84+
And I follow "Test Moodleoverflow"
85+
And I follow "Settings"
86+
And I follow "Limited Answer Mode"
87+
And I click on "la_starttime[enabled]" "checkbox"
88+
And I set the following fields to these values:
89+
| id_la_starttime_day | ##yesterday##%d## |
90+
| id_la_starttime_month | ##yesterday##%B## |
91+
| id_la_starttime_year | ##yesterday##%Y## |
92+
| id_la_starttime_hour | 12 |
93+
| id_la_starttime_minute | 30 |
94+
When I press "Save and display"
95+
And I follow "Limited Answer Mode"
96+
And I click on "#collapseElement-5" "css_element"
97+
Then I should see "Start time must be in the future"

0 commit comments

Comments
 (0)