diff --git a/mod/forum/tests/behat/edit_post_student.feature b/mod/forum/tests/behat/edit_post_student.feature index af0cdddb1e9..0a92b9f0318 100644 --- a/mod/forum/tests/behat/edit_post_student.feature +++ b/mod/forum/tests/behat/edit_post_student.feature @@ -17,14 +17,13 @@ Feature: Students can edit or delete their forum posts within a set time limit And the following "activities" exist: | activity | name | course | idnumber | | forum | Test forum name | C1 | forum | - And I am on the "Course 1" course page logged in as student1 - And the following "mod_forum > discussions" exist: - | user | forum | name | message | - | student1 | forum | Forum post subject | This is the body | - And I am on the "Test forum name" "forum activity" page Scenario: Edit forum post - Given I follow "Forum post subject" + Given the following "mod_forum > discussions" exist: + | user | forum | name | message | + | student1 | forum | Forum post subject | This is the body | + And I am on the "Test forum name" "forum activity" page logged in as "student1" + And I follow "Forum post subject" And I follow "Edit" When I set the following fields to these values: | Subject | Edited post subject | @@ -35,18 +34,25 @@ Feature: Students can edit or delete their forum posts within a set time limit And I should see "Edited post body" Scenario: Delete forum post - Given I follow "Forum post subject" + Given the following "mod_forum > discussions" exist: + | user | forum | name | message | + | student1 | forum | Forum post subject | This is the body | + And I am on the "Test forum name" "forum activity" page logged in as "student1" + And I follow "Forum post subject" When I follow "Delete" And I press "Continue" Then I should not see "Forum post subject" - @javascript @block_recent_activity + @block_recent_activity Scenario: Time limit expires Given the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | recent_activity | Course | C1 | course-view-* | side-pre | And the following config values are set as admin: | maxeditingtime | 1 | + And the following "mod_forum > discussions" exist: + | user | forum | name | message | timemodified | + | student1 | forum | Forum post subject | This is the body | ##now +1 second## | And I am on the "Course 1" course page logged in as student1 And I should see "New forum posts:" in the "Recent activity" "block" And I should see "Forum post subject" in the "Recent activity" "block"