[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/forum/tests/behat/ -> edit_post_teacher.feature (source)

   1  @mod @mod_forum
   2  Feature: Teachers can edit or delete any forum post
   3    In order to refine the forum contents
   4    As a teacher
   5    I need to edit or delete any user's forum posts
   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      And the following "courses" exist:
  13        | fullname | shortname | category |
  14        | Course 1 | C1 | 0 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And I log in as "teacher1"
  20      And I follow "Course 1"
  21      And I turn editing mode on
  22      And I add a "Forum" to section "1" and I fill the form with:
  23        | Forum name | Test forum name |
  24        | Description | Test forum description |
  25      And I add a new discussion to "Test forum name" forum with:
  26        | Subject | Teacher post subject |
  27        | Message | Teacher post message |
  28      And I log out
  29      And I log in as "student1"
  30      And I follow "Course 1"
  31      And I reply "Teacher post subject" post from "Test forum name" forum with:
  32        | Subject | Student post subject |
  33        | Message | Student post message |
  34  
  35    @javascript
  36    Scenario: A teacher can delete another user's posts
  37      Given I log out
  38      And I log in as "teacher1"
  39      When I follow "Course 1"
  40      And I follow "Test forum name"
  41      And I follow "Teacher post subject"
  42      And I click on "Delete" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element"
  43      And I press "Continue"
  44      Then I should not see "Student post subject"
  45      And I should not see "Student post message"
  46  
  47    @javascript
  48    Scenario: A teacher can edit another user's posts
  49      Given I log out
  50      And I log in as "teacher1"
  51      When I follow "Course 1"
  52      And I follow "Test forum name"
  53      And I follow "Teacher post subject"
  54      And I click on "Edit" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element"
  55      And I set the following fields to these values:
  56        | Subject | Edited student subject |
  57      And I press "Save changes"
  58      And I wait to be redirected
  59      Then I should see "Edited student subject"
  60      And I should see "Edited by Teacher 1 - original submission"
  61  
  62    @javascript
  63    Scenario: A student can't edit or delete another user's posts
  64      When I follow "Teacher post subject"
  65      Then I should not see "Edit" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element"
  66      And I should not see "Delete" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element"


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