[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/wiki/tests/behat/ -> wiki_comments.feature (source)

   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 | [email protected] |
  11        | student1 | Student | 1 | [email protected] |
  12        | student2 | Student | 2 | [email protected] |
  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 I log in as "teacher1"
  22      And I follow "Course 1"
  23      And I turn editing mode on
  24      And I add a "Wiki" to section "1" and I fill the form with:
  25        | Wiki name | Test wiki name |
  26        | Description | Test wiki description |
  27        | First page name | First page |
  28        | Wiki mode | Collaborative wiki |
  29      And I follow "Test wiki name"
  30      And I press "Create page"
  31      And I set the following fields to these values:
  32        | HTML format | First edition |
  33      And I press "Save"
  34      And I log out
  35      And I log in as "student1"
  36      And I follow "Course 1"
  37      And I follow "Test wiki name"
  38      And I follow "Comments"
  39      And I follow "Add comment"
  40      And I set the following fields to these values:
  41        | Comment | student 1 original comment |
  42      And I press "Save"
  43  
  44    @javascript
  45    Scenario: Student can edit and delete their own comment
  46      When I click on "Edit" "link" in the "wiki-comments" "table"
  47      And I set the following fields to these values:
  48        | Comment | student 1 updated comment |
  49      And I press "Save"
  50      Then I should see "student 1 updated comment"
  51      And "Edit" "link" should exist in the "wiki-comments" "table"
  52      And "Delete" "link" should exist in the "wiki-comments" "table"
  53      And I click on "Delete" "link" in the "wiki-comments" "table"
  54      And I press "Yes"
  55      And I should not see "student 1 updated comment"
  56  
  57    @javascript
  58    Scenario: Student cannot edit another student's comment
  59      When I log out
  60      And I log in as "student2"
  61      And I follow "Course 1"
  62      And I follow "Test wiki name"
  63      And I follow "Comments"
  64      Then "Edit" "link" should not exist in the "wiki-comments" "table"
  65      And "Delete" "link" should not exist in the "wiki-comments" "table"
  66  
  67    @javascript
  68    Scenario: Teacher can delete a student comment
  69      When I log out
  70      And I log in as "teacher1"
  71      And I follow "Course 1"
  72      And I follow "Test wiki name"
  73      And I follow "Comments"
  74      Then "Edit" "link" should not exist in the "wiki-comments" "table"
  75      And "Delete" "link" should exist in the "wiki-comments" "table"


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