source: moodle/trunk/fuentes/blog/tests/behat/comment.feature @ 1331

Last change on this file since 1331 was 1331, checked in by jrpelegrina, 3 years ago

Updated to moodle 3.0.3

File size: 2.5 KB
Line 
1@core @core_blog
2Feature: Comment on a blog entry
3  In order to respond to a blog post
4  As a user
5  I need to be able to comment on a blog entry
6
7  Background:
8    Given the following "users" exist:
9      | username | firstname | lastname | email |
10      | testuser | Test | User | moodle@example.com |
11      | testuser2 | Test2 | User2 | moodle2@example.com |
12    And I log in as "testuser"
13    And I expand "Site pages" node
14    And I follow "Site blogs"
15    And I follow "Add a new entry"
16    And I set the following fields to these values:
17      | Entry title | Blog post from user 1 |
18      | Blog entry body | User 1 blog post content |
19    And I press "Save changes"
20    And I log out
21
22  @javascript
23  Scenario: Commenting on my own blog entry
24    Given I am on site homepage
25    And I log in as "testuser"
26    And I expand "Site pages" node
27    And I follow "Site blogs"
28    And I follow "Blog post from user 1"
29    And I should see "User 1 blog post content"
30    And I follow "Comments (0)"
31    When I set the field "content" to "$My own >nasty< \"string\"!"
32    And I follow "Save comment"
33    Then I should see "$My own >nasty< \"string\"!"
34    And I set the field "content" to "Another $Nasty <string?>"
35    And I follow "Save comment"
36    And I should see "Comments (2)" in the ".comment-link" "css_element"
37
38  @javascript
39  Scenario: Deleting my own comment
40    Given I am on site homepage
41    And I log in as "testuser"
42    And I expand "Site pages" node
43    And I follow "Site blogs"
44    And I follow "Blog post from user 1"
45    And I should see "User 1 blog post content"
46    And I follow "Comments (0)"
47    And I set the field "content" to "$My own >nasty< \"string\"!"
48    And I follow "Save comment"
49    When I click on ".comment-delete a" "css_element"
50    # Waiting for the animation to finish.
51    And I wait "4" seconds
52    Then I should not see "$My own >nasty< \"string\"!"
53    And I follow "Blog post from user 1"
54    And I click on ".comment-link" "css_element"
55    And I should not see "$My own >nasty< \"string\"!"
56    And I should see "Comments (0)" in the ".comment-link" "css_element"
57
58  @javascript
59  Scenario: Commenting on someone's blog post
60    Given I am on site homepage
61    And I log in as "testuser2"
62    And I am on site homepage
63    And I expand "Site pages" node
64    And I follow "Site blogs"
65    And I follow "Blog post from user 1"
66    When I follow "Comments (0)"
67    And I set the field "content" to "$My own >nasty< \"string\"!"
68    And I follow "Save comment"
69    Then I should see "$My own >nasty< \"string\"!"
Note: See TracBrowser for help on using the repository browser.