Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
MDL-46755 format_social: behat test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourget committed Jan 21, 2015
1 parent 0d67ac8 commit 7ce40bc
Showing 1 changed file with 113 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
@format @format_social
Feature: Change number of discussions displayed
In order to change the number of discussions displayed
As a teacher
I need to edit the course and change the number of sections displayed.

Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | 0 | social |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 10 |
| Message | This is forum post ten |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 9 |
| Message | This is forum post nine |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 8 |
| Message | This is forum post eight |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 7 |
| Message | This is forum post seven |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 6 |
| Message | This is forum post six |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 5 |
| Message | This is forum post five |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 4 |
| Message | This is forum post four |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 3 |
| Message | This is forum post three |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 2 |
| Message | This is forum post two |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 1 |
| Message | This is forum post one |
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"

Scenario: When number of discussions is decreased fewer discussions appear
Given I click on "Edit settings" "link" in the "Administration" "block"
And I set the following fields to these values:
| numdiscussions | 5 |
When I press "Save and display"
Then I should see "This is forum post five"
And I should not see "This is forum post six"

Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear
Given I click on "Edit settings" "link" in the "Administration" "block"
And I set the following fields to these values:
| numdiscussions | -1 |
When I press "Save and display"
Then I should see "This is forum post one"
And I should not see "This is forum post two"

Scenario: When number of discussions is increased more discussions appear
Given I click on "Edit settings" "link" in the "Administration" "block"
And I set the following fields to these values:
| numdiscussions | 9 |
When I press "Save and display"
Then I should see "This is forum post five"
And I should see "This is forum post nine"
And I should not see "This is forum post ten"

0 comments on commit 7ce40bc

Please sign in to comment.