[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/blocks/course_list/tests/behat/ -> block_course_list_frontpage.feature (source)

   1  @block @block_course_list
   2  Feature: Enable the course_list block on the frontpage and view it's contents
   3    In order to enable the course list block on the frontpage
   4    As an admin
   5    I can add the course list block to the frontpage
   6  
   7    Background:
   8      Given the following "categories" exist:
   9        | name        | category | idnumber |
  10        | Category 1  | 0        | CAT1     |
  11        | Category 2  | 0        | CAT2     |
  12        | Category 3  | CAT2     | CAT3     |
  13      And the following "courses" exist:
  14        | fullname | shortname | category |
  15        | Course 1 | C1        | 0        |
  16        | Course 2 | C2        | CAT1     |
  17        | Course 3 | C3        | CAT2     |
  18        | Course 4 | C4        | CAT3     |
  19      And the following "users" exist:
  20        | username | firstname | lastname | email                |
  21        | teacher1 | Teacher   | First    | teacher1@example.com |
  22      And the following "course enrolments" exist:
  23        | user | course | role           |
  24        | teacher1 | C1 | editingteacher |
  25        | teacher1 | C2 | editingteacher |
  26        | teacher1 | C3 | editingteacher |
  27  
  28    Scenario: Add the course list block on the frontpage and navigate to the course listing
  29      Given I log in as "admin"
  30      And I am on site homepage
  31      And I navigate to "Turn editing on" node in "Front page settings"
  32      And I add the "Courses" block
  33      And I log out
  34      When I log in as "teacher1"
  35      And I am on site homepage
  36      Then I should see "Course 1" in the "My courses" "block"
  37      And I should see "Course 2" in the "My courses" "block"
  38      And I should see "Course 3" in the "My courses" "block"
  39      And I should not see "Course 4" in the "My courses" "block"
  40      And I follow "All courses"
  41      And I should see "Miscellaneous"
  42  
  43    Scenario: Add the course list block on the frontpage page and navigate to another course
  44      Given I log in as "admin"
  45      And I am on site homepage
  46      And I navigate to "Turn editing on" node in "Front page settings"
  47      And I add the "Courses" block
  48      And I log out
  49      When I log in as "teacher1"
  50      And I am on site homepage
  51      Then I should see "Course 1" in the "My courses" "block"
  52      And I should see "Course 2" in the "My courses" "block"
  53      And I should see "Course 3" in the "My courses" "block"
  54      And I should not see "Course 4" in the "My courses" "block"
  55      And I follow "Course 3"
  56      And I should see "Course 3"
  57  
  58    Scenario: Add the course list block on the frontpage page and view as an admin
  59      Given I log in as "admin"
  60      And I am on site homepage
  61      And I navigate to "Turn editing on" node in "Front page settings"
  62      When I add the "Courses" block
  63      Then I should see "Miscellaneous" in the "Course categories" "block"
  64      And I should see "Category 1" in the "Course categories" "block"
  65      And I should see "Category 2" in the "Course categories" "block"
  66      And I should not see "Category 3" in the "Course categories" "block"
  67      And I should not see "Course 1" in the "Course categories" "block"
  68      And I should not see "Course 2" in the "Course categories" "block"
  69      And I follow "All courses"
  70      And I should see "Miscellaneous"
  71  
  72    Scenario: Add the course list block on the frontpage page and view as a guest
  73      Given I log in as "admin"
  74      And I am on site homepage
  75      And I navigate to "Turn editing on" node in "Front page settings"
  76      And I add the "Courses" block
  77      And I log out
  78      When I log in as "guest"
  79      Then I should see "Miscellaneous" in the "Course categories" "block"
  80      And I should see "Category 1" in the "Course categories" "block"
  81      And I should see "Category 2" in the "Course categories" "block"
  82      And I should not see "Category 3" in the "Course categories" "block"
  83      And I should not see "Course 1" in the "Course categories" "block"
  84      And I should not see "Course 2" in the "Course categories" "block"
  85      And I follow "All courses"
  86      And I should see "Miscellaneous"


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