1 |
efrain |
1 |
@format @format_weeks
|
|
|
2 |
Feature: Sections can be edited and deleted in weekly sections format
|
|
|
3 |
In order to rearrange my course contents
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to edit and delete sections
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | format | coursedisplay | numsections | startdate |
|
|
|
13 |
| Course 1 | C1 | weeks | 0 | 5 | 957139200 |
|
|
|
14 |
And the following "activities" exist:
|
|
|
15 |
| activity | name | intro | course | idnumber | section |
|
|
|
16 |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
|
|
|
17 |
| book | Test book name | | C1 | book1 | 1 |
|
|
|
18 |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 | 4 |
|
|
|
19 |
| choice | Test choice name | Test choice description | C1 | choice1 | 5 |
|
|
|
20 |
And the following "course enrolments" exist:
|
|
|
21 |
| user | course | role |
|
|
|
22 |
| teacher1 | C1 | editingteacher |
|
|
|
23 |
And I log in as "teacher1"
|
|
|
24 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
25 |
|
|
|
26 |
Scenario: View the default name of the general section in weeks format
|
|
|
27 |
When I edit the section "0"
|
|
|
28 |
Then the field "Section name" matches value ""
|
|
|
29 |
And I should see "General"
|
|
|
30 |
|
|
|
31 |
Scenario: Edit the default name of the general section in weeks format
|
|
|
32 |
When I edit the section "0" and I fill the form with:
|
|
|
33 |
| Section name | This is the general section |
|
|
|
34 |
Then I should see "This is the general section" in the "page" "region"
|
|
|
35 |
|
|
|
36 |
Scenario: View the default name of the second section in weeks format
|
|
|
37 |
When I edit the section "2"
|
|
|
38 |
Then the field "Section name" matches value ""
|
|
|
39 |
And I should see "8 May - 14 May"
|
|
|
40 |
|
|
|
41 |
Scenario: Edit section summary in weeks format
|
|
|
42 |
When I edit the section "2" and I fill the form with:
|
|
|
43 |
| Description | Welcome to section 2 |
|
|
|
44 |
Then I should see "Welcome to section 2" in the "page" "region"
|
|
|
45 |
|
|
|
46 |
Scenario: Edit section default name in weeks format
|
|
|
47 |
Given I should see "8 May - 14 May" in the "8 May - 14 May" "section"
|
|
|
48 |
When I edit the section "2" and I fill the form with:
|
|
|
49 |
| Section name | This is the second week |
|
|
|
50 |
Then I should see "This is the second week" in the "page" "region"
|
|
|
51 |
And I should not see "8 May - 14 May"
|
|
|
52 |
|
|
|
53 |
@javascript
|
|
|
54 |
Scenario: Inline edit section name in weeks format
|
|
|
55 |
When I set the field "Edit section name" in the "1 May - 7 May" "section" to "Midterm evaluation"
|
|
|
56 |
Then I should not see "1 May - 7 May" in the "region-main" "region"
|
|
|
57 |
And "New name for week" "field" should not exist
|
|
|
58 |
And I should see "Midterm evaluation" in the "Midterm evaluation" "section"
|
|
|
59 |
And I am on "Course 1" course homepage
|
|
|
60 |
And I should not see "1 May - 7 May" in the "region-main" "region"
|
|
|
61 |
And I should see "Midterm evaluation" in the "Midterm evaluation" "section"
|
|
|
62 |
|
|
|
63 |
Scenario: Deleting the last section in weeks format
|
|
|
64 |
Given I should see "29 May - 4 June" in the "29 May - 4 June" "section"
|
|
|
65 |
When I delete section "5"
|
|
|
66 |
Then I should see "Are you absolutely sure you want to completely delete \"29 May - 4 June\" and all the activities it contains?"
|
|
|
67 |
And I press "Delete"
|
|
|
68 |
And I should not see "29 May - 4 June"
|
|
|
69 |
And I should see "22 May - 28 May"
|
|
|
70 |
|
|
|
71 |
Scenario: Deleting the middle section in weeks format
|
|
|
72 |
Given I should see "29 May - 4 June" in the "29 May - 4 June" "section"
|
|
|
73 |
When I delete section "4"
|
|
|
74 |
And I press "Delete"
|
|
|
75 |
Then I should not see "29 May - 4 June"
|
|
|
76 |
And I should not see "Test lesson name"
|
|
|
77 |
And I should see "Test choice name" in the "22 May - 28 May" "section"
|
|
|
78 |
And I should see "22 May - 28 May"
|
|
|
79 |
|
|
|
80 |
@javascript
|
|
|
81 |
Scenario: Adding sections in weeks format
|
|
|
82 |
When I follow "Add week"
|
|
|
83 |
Then I should see "5 June - 11 June" in the "5 June - 11 June" "section"
|