2 Feature: Comment on a blog entry
3 In order to respond to a blog post
5 I need to be able to comment on a blog entry
8 Given the following "users" exists:
9 | username | firstname | lastname | email |
10 | testuser | Test | User | moodle@moodlemoodle.com |
11 | testuser2 | Test2 | User2 | moodle2@moodlemoodle.com |
12 And I log in as "testuser"
14 And I expand "My profile" node
15 And I expand "Blogs" node
16 And I follow "Add a new entry"
17 And I fill the moodle form with:
18 | Entry title | Blog post from user 1 |
19 | Blog entry body | User 1 blog post content |
20 And I press "Save changes"
24 Scenario: Commenting on my own blog entry
25 Given I am on homepage
26 And I log in as "testuser"
28 And I expand "My profile" node
29 And I expand "Blogs" node
30 And I follow "View all of my entries"
31 And I follow "Blog post from user 1"
32 And I should see "User 1 blog post content"
33 And I follow "Comments (0)"
34 When I fill in "content" with "$My own >nasty< \"string\"!"
35 And I follow "Save comment"
36 Then I should see "$My own >nasty< \"string\"!"
37 And I fill in "content" with "Another $Nasty <string?>"
38 And I follow "Save comment"
39 And I should see "Comments (2)" in the ".comment-link" "css_element"
42 Scenario: Deleting my own comment
43 Given I am on homepage
44 And I log in as "testuser"
46 And I expand "My profile" node
47 And I expand "Blogs" node
48 And I follow "View all of my entries"
49 And I follow "Blog post from user 1"
50 And I should see "User 1 blog post content"
51 And I follow "Comments (0)"
52 And I fill in "content" with "$My own >nasty< \"string\"!"
53 And I follow "Save comment"
54 When I click on ".comment-delete a" "css_element"
55 # Waiting for the animation to finish.
56 And I wait "2" seconds
57 Then I should not see "$My own >nasty< \"string\"!"
58 And I follow "Blog post from user 1"
59 And I click on ".comment-link" "css_element"
60 And I should not see "$My own >nasty< \"string\"!"
61 And I should see "Comments (0)" in the ".comment-link" "css_element"
64 Scenario: Commenting on someone's blog post
65 Given I am on homepage
66 And I log in as "testuser2"
68 And I expand "Site pages" node
69 And I follow "Site blogs"
70 And I follow "Blog post from user 1"
71 When I follow "Comments (0)"
72 And I fill in "content" with "$My own >nasty< \"string\"!"
73 And I follow "Save comment"
74 Then I should see "$My own >nasty< \"string\"!"