[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/course_overview/tests/behat/ -> block_course_overview.feature (source)

   1  @block @block_course_overview
   2  Feature: View the course overview block on the dashboard and test it's functionality
   3    In order to view the course overview block on the dashboard
   4    As an admin
   5    I can configure the course overview block
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email | idnumber |
  10        | student1 | Student | 1 | student1@example.com | S1 |
  11        | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
  12      And the following "categories" exist:
  13        | name        | category | idnumber |
  14        | Category 1  | 0        | CAT1     |
  15        | Category 2  | CAT1     | CAT2     |
  16      And the following "courses" exist:
  17        | fullname | shortname | category |
  18        | Course 1 | C1        | 0        |
  19        | Course 2 | C2        | CAT1     |
  20        | Course 3 | C3        | CAT2     |
  21  
  22    Scenario: View the block by a user without any enrolments
  23      Given I log in as "student1"
  24      Then I should see "No course information to show" in the "Course overview" "block"
  25  
  26    Scenario: View the block by a user with several enrolments
  27      Given the following "course enrolments" exist:
  28        | user | course | role |
  29        | student1 | C1 | student |
  30        | student1 | C2 | student |
  31      When I log in as "student1"
  32      Then I should see "Course 1" in the "Course overview" "block"
  33      And I should see "Course 2" in the "Course overview" "block"
  34  
  35    Scenario: View the block by a user with several enrolments and limit the number of courses.
  36      Given the following "course enrolments" exist:
  37        | user | course | role |
  38        | student1 | C1 | student |
  39        | student1 | C2 | student |
  40        | student1 | C3 | student |
  41      When I log in as "student1"
  42      And I press "Customise this page"
  43      And I select "1" from the "Number of courses to display:" singleselect
  44      Then I should see "Course 1" in the "Course overview" "block"
  45      And I should see "You have 2 hidden courses"
  46      And I should not see "Course 2" in the "Course overview" "block"
  47      And I should not see "Course 3" in the "Course overview" "block"
  48      And I follow "Show all courses"
  49      And I should see "Course 1" in the "Course overview" "block"
  50      And I should see "Course 2" in the "Course overview" "block"
  51      And I should see "Course 3" in the "Course overview" "block"
  52  
  53    Scenario: View the block by a user with several enrolments and an admin set default max courses.
  54      Given the following config values are set as admin:
  55        | defaultmaxcourses | 2 | block_course_overview |
  56      And the following "course enrolments" exist:
  57        | user | course | role |
  58        | student1 | C1 | student |
  59        | student1 | C2 | student |
  60        | student1 | C3 | student |
  61      When I log in as "student1"
  62      Then I should see "Course 1" in the "Course overview" "block"
  63      And I should see "Course 2" in the "Course overview" "block"
  64      And I should see "You have 1 hidden course"
  65      And I press "Customise this page"
  66      And I select "Always show all" from the "Number of courses to display:" singleselect
  67      And I should see "Course 3" in the "Course overview" "block"
  68      And I should not see "You have 1 hidden course"
  69  
  70    Scenario: View the block by a user with several enrolments and an admin enforced maximum displayed courses.
  71      Given the following config values are set as admin:
  72        | defaultmaxcourses      | 2 | block_course_overview |
  73        | forcedefaultmaxcourses | 1 | block_course_overview |
  74      And the following "course enrolments" exist:
  75        | user | course | role |
  76        | student1 | C1 | student |
  77        | student1 | C2 | student |
  78        | student1 | C3 | student |
  79      When I log in as "student1"
  80      Then I should see "Course 1" in the "Course overview" "block"
  81      And I should see "Course 2" in the "Course overview" "block"
  82      And I should see "You have 1 hidden course"
  83      And I press "Customise this page"
  84      And I should not see "Always show all"
  85  
  86    Scenario: View the block by a user with the welcome area enabled and messaging disabled.
  87      Given the following config values are set as admin:
  88        | showwelcomearea | 1 | block_course_overview |
  89        | messaging       | 0 |                       |
  90      When I log in as "student1"
  91      Then I should see "Welcome Student" in the "Course overview" "block"
  92      And I should not see "messages" in the "Course overview" "block"
  93  
  94    Scenario: View the block by a user with both the welcome area and messaging enabled.
  95      Given the following config values are set as admin:
  96        | showwelcomearea | 1 | block_course_overview |
  97      When I log in as "student1"
  98      Then I should see "Welcome Student" in the "Course overview" "block"
  99      And I should see "You have no unread messages" in the "Course overview" "block"
 100      And I follow "messages"
 101      And I should see "Contact list empty"
 102  
 103    Scenario: View the block by a user with the welcome area and the user having messages.
 104      Given the following config values are set as admin:
 105        | showwelcomearea | 1 | block_course_overview |
 106      And I log in as "student1"
 107      And I should see "Welcome Student" in the "Course overview" "block"
 108      And I should see "You have no unread messages" in the "Course overview" "block"
 109      And I follow "messages"
 110      And I send "This is message 1" message to "Teacher 1" user
 111      And I send "This is message 2" message to "Teacher 1" user
 112      When I log out
 113      And I log in as "teacher1"
 114      Then I should see "Welcome Teacher" in the "Course overview" "block"
 115      And I should see "You have 2 unread messages" in the "Course overview" "block"
 116  
 117    Scenario: View the block by a user with the parent categories displayed.
 118      Given the following config values are set as admin:
 119        | showcategories | Parent category only | block_course_overview |
 120      And the following "course enrolments" exist:
 121        | user | course | role |
 122        | student1 | C1 | student |
 123        | student1 | C2 | student |
 124        | student1 | C3 | student |
 125      When I log in as "student1"
 126      Then I should see "Miscellaneous" in the "Course overview" "block"
 127      And I should see "Category 1" in the "Course overview" "block"
 128      And I should see "Category 2" in the "Course overview" "block"
 129      And I should not see "Category 1 / Category 1" in the "Course overview" "block"
 130  
 131    Scenario: View the block by a user with the full categories displayed.
 132      Given the following config values are set as admin:
 133        | showcategories | 2 | block_course_overview |
 134      And the following "course enrolments" exist:
 135        | user | course | role |
 136        | student1 | C1 | student |
 137        | student1 | C2 | student |
 138        | student1 | C3 | student |
 139      When I log in as "student1"
 140      Then I should see "Miscellaneous" in the "Course overview" "block"
 141      And I should see "Category 1 / Category 2" in the "Course overview" "block"
 142  
 143    @javascript
 144    Scenario: View the block by a user with the show children option enabled.
 145      Given the following config values are set as admin:
 146        | showchildren | 1 | block_course_overview |
 147      And the following "course enrolments" exist:
 148        | user | course | role |
 149        | student1 | C1 | student |
 150      And I log in as "admin"
 151      And I navigate to "Manage enrol plugins" node in "Site administration > Plugins > Enrolments"
 152      And I click on "Enable" "link" in the "Course meta link" "table_row"
 153      And I am on site homepage
 154      And I follow "Course 2"
 155      And I navigate to "Enrolment methods" node in "Users"
 156      And I add "Course meta link" enrolment method with:
 157        | Link course | C1 |
 158      And I log out
 159      When I log in as "student1"
 160      Then I should see "Course 1" in the "Course overview" "block"
 161      And I should see "Course 2" in the "Course overview" "block"
 162      And I should see "Includes C1" in the "Course overview" "block"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1