1 |
efrain |
1 |
@mod @mod_wiki
|
|
|
2 |
Feature: Users can comment on wiki pages
|
|
|
3 |
In order to discuss wiki pages
|
|
|
4 |
As a user
|
|
|
5 |
I need to be able to comment on wiki pages as well as editing and deleting comments
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
| student2 | Student | 2 | student2@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
And the following "activity" exists:
|
|
|
22 |
| activity | wiki |
|
|
|
23 |
| course | C1 |
|
|
|
24 |
| name | Test wiki name |
|
|
|
25 |
| firstpagetitle | First page |
|
|
|
26 |
| wikimode | collaborative |
|
|
|
27 |
And I am on the "Test wiki name" "wiki activity" page logged in as teacher1
|
|
|
28 |
And I press "Create page"
|
|
|
29 |
And I set the following fields to these values:
|
|
|
30 |
| HTML format | First edition |
|
|
|
31 |
And I press "Save"
|
|
|
32 |
And I am on the "Test wiki name" "wiki activity" page logged in as student1
|
|
|
33 |
And I select "Comments" from the "jump" singleselect
|
|
|
34 |
And I follow "Add comment"
|
|
|
35 |
And I set the following fields to these values:
|
|
|
36 |
| Comment | student 1 original comment |
|
|
|
37 |
And I press "Save"
|
|
|
38 |
And I wait to be redirected
|
|
|
39 |
|
|
|
40 |
@javascript
|
|
|
41 |
Scenario: Student can edit and delete their own comment
|
|
|
42 |
When I click on "Edit" "link" in the "wiki-comments" "table"
|
|
|
43 |
And I set the following fields to these values:
|
|
|
44 |
| Comment | student 1 updated comment |
|
|
|
45 |
And I press "Save"
|
|
|
46 |
Then I should see "student 1 updated comment"
|
|
|
47 |
And "Edit" "link" should exist in the "wiki-comments" "table"
|
|
|
48 |
And "Delete" "link" should exist in the "wiki-comments" "table"
|
|
|
49 |
And I click on "Delete" "link" in the "wiki-comments" "table"
|
|
|
50 |
And I press "Continue"
|
|
|
51 |
And I should not see "student 1 updated comment"
|
|
|
52 |
|
|
|
53 |
@javascript
|
|
|
54 |
Scenario: Student cannot edit another student's comment
|
|
|
55 |
When I am on the "Test wiki name" "wiki activity" page logged in as student2
|
|
|
56 |
And I select "Comments" from the "jump" singleselect
|
|
|
57 |
Then "Edit" "link" should not exist in the "wiki-comments" "table"
|
|
|
58 |
And "Delete" "link" should not exist in the "wiki-comments" "table"
|
|
|
59 |
|
|
|
60 |
@javascript
|
|
|
61 |
Scenario: Teacher can delete a student comment
|
|
|
62 |
When I am on the "Test wiki name" "wiki activity" page logged in as teacher1
|
|
|
63 |
And I select "Comments" from the "jump" singleselect
|
|
|
64 |
Then "Edit" "link" should not exist in the "wiki-comments" "table"
|
|
|
65 |
And "Delete" "link" should exist in the "wiki-comments" "table"
|