[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/blog/tests/behat/ -> comment.feature (source)

   1  @core @core_blog
   2  Feature: 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 | [email protected] |
  11        | testuser2 | Test2 | User2 | [email protected] |
  12      And I log in as "testuser"
  13      And I am on homepage
  14      And I expand "My profile" node
  15      And I expand "Blogs" node
  16      And I follow "Add a new entry"
  17      And I set the following fields to these values:
  18        | Entry title | Blog post from user 1 |
  19        | Blog entry body | User 1 blog post content |
  20      And I press "Save changes"
  21      And I log out
  22  
  23    @javascript
  24    Scenario: Commenting on my own blog entry
  25      Given I am on homepage
  26      And I log in as "testuser"
  27      And I am on homepage
  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 set the field "content" to "$My own >nasty< \"string\"!"
  35      And I follow "Save comment"
  36      Then I should see "$My own >nasty< \"string\"!"
  37      And I set the field "content" to "Another $Nasty <string?>"
  38      And I follow "Save comment"
  39      And I should see "Comments (2)" in the ".comment-link" "css_element"
  40  
  41    @javascript
  42    Scenario: Deleting my own comment
  43      Given I am on homepage
  44      And I log in as "testuser"
  45      And I am on homepage
  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 set the field "content" to "$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 "4" 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"
  62  
  63    @javascript
  64    Scenario: Commenting on someone's blog post
  65      Given I am on homepage
  66      And I log in as "testuser2"
  67      And I am on homepage
  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 set the field "content" to "$My own >nasty< \"string\"!"
  73      And I follow "Save comment"
  74      Then I should see "$My own >nasty< \"string\"!"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1