1 |
efrain |
1 |
@mod @mod_chat
|
|
|
2 |
Feature: Chat reset
|
|
|
3 |
In order to reuse past chat activities
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to remove all previous data.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Tina | Teacher1 | teacher1@example.com |
|
|
|
11 |
| student1 | Sam | Student1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And I enable "chat" "mod" plugin
|
|
|
20 |
And the following "activities" exist:
|
|
|
21 |
| activity | name | Description | course | idnumber |
|
|
|
22 |
| chat | Test chat name | Test chat description | C1 | chat1 |
|
|
|
23 |
|
|
|
24 |
Scenario: Use course reset to update chat start date
|
|
|
25 |
And I log in as "teacher1"
|
|
|
26 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
27 |
And I navigate to "Settings" in current page administration
|
|
|
28 |
And I set the following fields to these values:
|
|
|
29 |
| startdate[day] | 1 |
|
|
|
30 |
| startdate[month] | January |
|
|
|
31 |
| startdate[year] | 2020 |
|
|
|
32 |
And I press "Save and display"
|
|
|
33 |
And I follow "Test chat name"
|
|
|
34 |
And I navigate to "Settings" in current page administration
|
|
|
35 |
And I set the following fields to these values:
|
|
|
36 |
| chattime[day] | 1 |
|
|
|
37 |
| chattime[month] | January |
|
|
|
38 |
| chattime[year] | 2020 |
|
|
|
39 |
| chattime[hour] | 12 |
|
|
|
40 |
| chattime[minute] | 00 |
|
|
|
41 |
And I press "Save and display"
|
|
|
42 |
And I am on the "Course 1" "reset" page
|
|
|
43 |
And I set the following fields to these values:
|
|
|
44 |
| reset_start_date[enabled] | 1 |
|
|
|
45 |
| reset_start_date[day] | 1 |
|
|
|
46 |
| reset_start_date[month] | January |
|
|
|
47 |
| reset_start_date[year] | 2030 |
|
|
|
48 |
And I press "Reset course"
|
|
|
49 |
And I should see "Date changed" in the "Chats" "table_row"
|
|
|
50 |
And I press "Continue"
|
|
|
51 |
Then I am on "Course 1" course homepage
|
|
|
52 |
And I follow "Test chat name"
|
|
|
53 |
And I navigate to "Settings" in current page administration
|
|
|
54 |
And I expand all fieldsets
|
|
|
55 |
And the "chattime[year]" select box should contain "2030"
|