[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

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

   1  @mod @mod_forum
   2  Feature: Students can edit or delete their forum posts within a set time limit
   3    In order to refine forum posts
   4    As a user
   5    I need to edit or delete my forum posts within a certain period of time after posting
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | student1 | Student | 1 | [email protected] |
  11      And the following "courses" exist:
  12        | fullname | shortname | category |
  13        | Course 1 | C1 | 0 |
  14      And the following "course enrolments" exist:
  15        | user | course | role |
  16        | student1 | C1 | student |
  17      And I log in as "admin"
  18      And I expand "Site administration" node
  19      And I expand "Security" node
  20      And I follow "Site policies"
  21      And I set the field "Maximum time to edit posts" to "1 minutes"
  22      And I press "Save changes"
  23      And I am on homepage
  24      And I follow "Course 1"
  25      And I turn editing mode on
  26      And I add a "Forum" to section "1" and I fill the form with:
  27        | Forum name | Test forum name |
  28        | Forum type | Standard forum for general use |
  29        | Description | Test forum description |
  30      And I log out
  31      And I follow "Course 1"
  32      And I log in as "student1"
  33      And I add a new discussion to "Test forum name" forum with:
  34        | Subject | Forum post subject |
  35        | Message | This is the body |
  36  
  37    Scenario: Edit forum post
  38      When I follow "Forum post subject"
  39      And I follow "Edit"
  40      And I set the following fields to these values:
  41        | Subject | Edited post subject |
  42        | Message | Edited post body |
  43      And I press "Save changes"
  44      And I wait to be redirected
  45      Then I should see "Edited post subject"
  46      And I should see "Edited post body"
  47  
  48    @javascript
  49    Scenario: Delete forum post
  50      When I follow "Forum post subject"
  51      And I follow "Delete"
  52      And I press "Continue"
  53      Then I should not see "Forum post subject"
  54  
  55    @javascript
  56    Scenario: Time limit expires
  57      When I wait "70" seconds
  58      And I follow "Forum post subject"
  59      Then I should not see "Edit" in the "region-main" "region"
  60      And I should not see "Delete" in the "region-main" "region"


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