[ Index ]

PHP Cross Reference of Unnamed Project

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 | teacher1@example.com |
  11        | student1 | Student | 1 | student1@example.com |
  12        | student2 | Student | 2 | student2@example.com |
  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      And I wait to be redirected
  44  
  45    @javascript
  46    Scenario: Student can edit and delete their own comment
  47      When I click on "Edit" "link" in the "wiki-comments" "table"
  48      And I set the following fields to these values:
  49        | Comment | student 1 updated comment |
  50      And I press "Save"
  51      Then I should see "student 1 updated comment"
  52      And "Edit" "link" should exist in the "wiki-comments" "table"
  53      And "Delete" "link" should exist in the "wiki-comments" "table"
  54      And I click on "Delete" "link" in the "wiki-comments" "table"
  55      And I press "Yes"
  56      And I should not see "student 1 updated comment"
  57  
  58    @javascript
  59    Scenario: Student cannot edit another student's comment
  60      When I log out
  61      And I log in as "student2"
  62      And I follow "Course 1"
  63      And I follow "Test wiki name"
  64      And I follow "Comments"
  65      Then "Edit" "link" should not exist in the "wiki-comments" "table"
  66      And "Delete" "link" should not exist in the "wiki-comments" "table"
  67  
  68    @javascript
  69    Scenario: Teacher can delete a student comment
  70      When I log out
  71      And I log in as "teacher1"
  72      And I follow "Course 1"
  73      And I follow "Test wiki name"
  74      And I follow "Comments"
  75      Then "Edit" "link" should not exist in the "wiki-comments" "table"
  76      And "Delete" "link" should exist in the "wiki-comments" "table"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1