mirrored from git://git.moodle.org/moodle.git
/
reset_wiki_comments_tags_files.feature
95 lines (91 loc) · 3.46 KB
/
reset_wiki_comments_tags_files.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@mod @mod_wiki @javascript
Feature: Teachers can reset wiki pages, tags and files
In order to remove wiki pages, tags and files
As a teacher
I need to be able to reset the pages, tags and files on the course level
Background: Create a wiki, add a page, tag and file, and reset them
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@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 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Wiki" to section "1" and I fill the form with:
| Wiki name | Test wiki |
| Description | Test wiki description |
| First page name | Test wiki page |
And I follow "Test wiki"
And I press "Create page"
And I set the following fields to these values:
| HTML format | Test wiki content |
| Tags | Test tag 1, Test tag 2, |
And I press "Save"
And I should see "Test tag 1" in the ".wiki-tags" "css_element"
And I should see "Test tag 2" in the ".wiki-tags" "css_element"
And I follow "Comments"
And I follow "Add comment"
And I set the following fields to these values:
| Comment | Test comment |
And I press "Save changes"
And I should see "Test comment"
And I follow "Files"
And I press "Edit wiki files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
And I should see "empty.txt"
And I navigate to "Reset" node in "Course administration"
Scenario: Reset page, tags and files
And I set the following fields to these values:
| Delete all wiki pages | 1 |
| Remove all wiki tags | 1 |
| reset_wiki_comments | 1 |
And I press "Reset course"
And I should see "Delete all wiki pages"
And I should see "Wiki tags have been deleted"
And I should see "Delete all comments"
And I press "Continue"
And I follow "Test wiki"
And I press "Create page"
When I follow "View"
Then I should not see "Test tag 1"
And I should not see "Test tag 2"
And I follow "Comments"
And I should not see "Test comment"
And I follow "Files"
And I should not see "empty.txt"
Scenario: Reset only tags
And I set the following fields to these values:
| Remove all wiki tags | 1 |
And I press "Reset course"
And I should not see "Delete all wiki pages"
And I should see "Wiki tags have been deleted"
And I should not see "Delete all comments"
And I press "Continue"
And I follow "Test wiki"
Then I should not see "Test tag 1"
And I should not see "Test tag 2"
And I follow "Comments"
And I should see "Test comment"
And I follow "Files"
And I should see "empty.txt"
Scenario: Reset only comments
And I set the following fields to these values:
| reset_wiki_comments | 1 |
And I press "Reset course"
And I should not see "Delete all wiki pages"
And I should not see "Wiki tags have been deleted"
And I should see "Delete all comments"
And I press "Continue"
When I follow "Test wiki"
Then I should see "Test tag 1"
And I should see "Test tag 2"
And I follow "Comments"
And I should not see "Test comment"
And I follow "Files"
And I should see "empty.txt"