mirrored from git://git.moodle.org/moodle.git
/
date_availability.feature
55 lines (52 loc) · 2.49 KB
/
date_availability.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@mod @mod_lesson
Feature: A teacher can set available from and deadline dates to access a lesson
In order to schedule lesson activities
As a teacher
I need to set available from and deadline dates
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | course | idnumber |
| lesson | Test lesson | C1 | lesson1 |
And the following "mod_lesson > page" exist:
| lesson | qtype | title | content |
| Test lesson | content | First page name | First page contents |
And the following "mod_lesson > answer" exist:
| page | answer | jumpto |
| First page name | Next page | Next page |
Scenario: Forbidding lesson accesses until a specified date
Given I am on the "Test lesson" "lesson activity editing" page logged in as teacher1
And I set the field "id_available_enabled" to "1"
And I set the following fields to these values:
| available[day] | 1 |
| available[month] | January |
| available[year] | 2030 |
| available[hour] | 08 |
| available[minute] | 00 |
And I press "Save and display"
When I am on the "Test lesson" "lesson activity" page logged in as student1
Then the activity date in "Test lesson" should contain "Opens: Tuesday, 1 January 2030, 8:00"
And I should not see "First page contents"
Scenario: Forbidding lesson accesses after a specified date
Given I am on the "Test lesson" "lesson activity editing" page logged in as teacher1
And I set the field "id_deadline_enabled" to "1"
And I set the following fields to these values:
| deadline[day] | 1 |
| deadline[month] | January |
| deadline[year] | 2000 |
| deadline[hour] | 08 |
| deadline[minute] | 00 |
And I press "Save and display"
When I am on the "Test lesson" "lesson activity" page logged in as student1
Then the activity date in "Test lesson" should contain "Closed: Saturday, 1 January 2000, 8:00"
And I should not see "First page contents"