MDL-38785 behat: New tests
[moodle.git] / blocks / comments / tests / behat / delete_comment.feature
blobf2368e5853fd50f597a7f6d708af4117a58dc863
1 @core_comment
2 Feature: Delete comment block messages
3   In order to refine comment block's contents
4   As a moodle teacher
5   In need to delete comments from courses
7   @javascript
8   Scenario: Delete comments with Javascript enabled
9     Given the following "courses" exists:
10       | fullname | shortname | category |
11       | Course 1 | C1 | 0 |
12     And the following "users" exists:
13       | username | firstname | lastname | email |
14       | teacher1 | Teacher | First | teacher1@asd.com |
15       | student1 | Student | First | student1@asd.com |
16     And the following "course enrolments" exists:
17       | user | course | role |
18       | teacher1 | C1 | editingteacher |
19       | student1 | C1 | student |
20     And I log in as "teacher1"
21     And I follow "Course 1"
22     And I turn editing mode on
23     And I add the "Comments" block
24     And I log out
25     And I log in as "student1"
26     And I follow "Course 1"
27     And I add "Comment from student1" comment to comments block
28     And I log out
29     And I log in as "teacher1"
30     And I follow "Course 1"
31     And I add "Comment from teacher1" comment to comments block
32     When I delete "Comment from student1" comment from comments block
33     Then I should not see "Comment from student1"
34     And I delete "Comment from teacher1" comment from comments block
35     And I should not see "Comment from teacher1"