Skip to content

Commit

Permalink
MDL-38439 behat: New test
Browse files Browse the repository at this point in the history
According to MDLQA-3, a teacher can
set one of 3 possible options for
tracking read forum posts.
  • Loading branch information
David Monllao committed Mar 27, 2013
1 parent e6cb6ae commit 9449cf8
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions mod/forum/tests/behat/track_read_posts.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
@mod_forum
Feature: A teacher can set one of 3 possible options for tracking read forum posts
In order to ease the forum posts follow up
As a moodle user
I need to distinct the unread posts from the read ones

Background:
Given the following "users" exists:
| username | firstname | lastname | email | trackforums |
| student1 | Student | 1 | student1@asd.com | 1 |
And the following "courses" exists:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exists:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I follow "Course 1"
And I turn editing mode on

@javascript
Scenario: Tracking forum posts on
Given I add a "forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Read tracking for this forum | On |
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I wait "6" seconds
And I log out
When I log in as "student1"
And I follow "Course 1"
Then I should see "1 unread post"
And I follow "1 unread post"
And I should not see "Don't track unread posts"
And I follow "Test post subject"
And I follow "Course 1"
And I should not see "1 unread post"

@javascript
Scenario: Tracking forum posts off
Given I add a "forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Read tracking for this forum | Off |
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I wait "6" seconds
And I log out
When I log in as "student1"
And I follow "Course 1"
Then I should not see "1 unread post"
And I follow "Test forum name"
And I should not see "Track unread posts"

@javascript
Scenario: Tracking forum posts optional
Given I add a "forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Read tracking for this forum | Optional |
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I wait "6" seconds
And I log out
When I log in as "student1"
And I follow "Course 1"
Then I should see "1 unread post"
And I follow "Test forum name"
And I follow "Don't track unread posts"
And I wait "4" seconds
And I follow "Course 1"
And I should not see "1 unread post"
And I follow "Test forum name"
And I follow "Track unread posts"
And I wait "4" seconds
And I follow "1"
And I follow "Course 1"
And I should not see "1 unread post"

0 comments on commit 9449cf8

Please sign in to comment.