[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/blocks/navigation/tests/behat/ -> view_my_courses.feature (source)

   1  @block @block_navigation
   2  Feature: View my courses in navigation block
   3    In order to navigate to my courses
   4    As a student
   5    I need my courses displayed in the navigation block
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | student1 | Student | 1 | [email protected] |
  11      And the following "categories" exist:
  12        | name  | category | idnumber |
  13        | cat1  | 0        | cat1     |
  14        | cat2  | 0        | cat2     |
  15        | cat3  | 0        | cat3     |
  16        | cat31 | cat3     | cat31    |
  17        | cat32 | cat3     | cat32    |
  18        | cat33 | cat3     | cat33    |
  19      And the following "courses" exist:
  20        | fullname | shortname | category |
  21        | Course1  | c1        | cat1     |
  22        | Course2  | c2        | cat2     |
  23        | Course31 | c31       | cat31    |
  24        | Course32 | c32       | cat32    |
  25        | Course331| c331      | cat33    |
  26        | Course332| c332      | cat33    |
  27      And the following "course enrolments" exist:
  28        | user     | course | role    |
  29        | student1 | c1     | student |
  30        | student1 | c31    | student |
  31        | student1 | c331   | student |
  32      And I log in as "admin"
  33  
  34    @javascript
  35    Scenario: The plain list of enrolled courses is shown
  36      Given I set the following administration settings values:
  37        | Show my course categories | 0 |
  38      And I log out
  39      And I log in as "student1"
  40      When I click on "My home" "link" in the "Navigation" "block"
  41      Then I should not see "cat1" in the "Navigation" "block"
  42      And I should not see "cat2" in the "Navigation" "block"
  43      And I should see "c1" in the "Navigation" "block"
  44      And I should see "c31" in the "Navigation" "block"
  45      And I should see "c331" in the "Navigation" "block"
  46      And I should not see "c2" in the "Navigation" "block"
  47      And I should not see "c32" in the "Navigation" "block"
  48      And I should not see "c332" in the "Navigation" "block"
  49  
  50    @javascript
  51    Scenario: The nested list of enrolled courses is shown
  52      Given I set the following administration settings values:
  53        | Show my course categories | 1 |
  54      And I log out
  55      And I log in as "student1"
  56      When I click on "My home" "link" in the "Navigation" "block"
  57      Then I should see "cat1" in the "Navigation" "block"
  58      And I should see "cat3" in the "Navigation" "block"
  59      And I should not see "cat2" in the "Navigation" "block"
  60      And I expand "cat3" node
  61      And I should see "cat31" in the "Navigation" "block"
  62      And I should see "cat33" in the "Navigation" "block"
  63      And I should not see "cat32" in the "Navigation" "block"
  64      And I expand "cat31" node
  65      And I should see "c31" in the "Navigation" "block"
  66      And I expand "cat33" node
  67      And I should see "c331" in the "Navigation" "block"
  68      And I should not see "c332" in the "Navigation" "block"
  69  
  70    @javascript
  71    Scenario: I can expand categories and courses as guest
  72      Given I set the following administration settings values:
  73        | Show my course categories | 1 |
  74        | Show all courses          | 1 |
  75      And I log out
  76      And I expand "Courses" node
  77      And I should see "cat1" in the "Navigation" "block"
  78      And I should see "cat2" in the "Navigation" "block"
  79      And I should see "cat3" in the "Navigation" "block"
  80      And I should not see "cat31" in the "Navigation" "block"
  81      And I should not see "cat32" in the "Navigation" "block"
  82      And I should not see "cat331" in the "Navigation" "block"
  83      And I should not see "c1" in the "Navigation" "block"
  84      And I should not see "c2" in the "Navigation" "block"
  85      And I should not see "c31" in the "Navigation" "block"
  86      And I should not see "c32" in the "Navigation" "block"
  87      When I expand "cat3" node
  88      And I expand "cat31" node
  89      And I expand "cat1" node
  90      Then I should see "cat1" in the "Navigation" "block"
  91      And I should see "cat2" in the "Navigation" "block"
  92      And I should see "cat3" in the "Navigation" "block"
  93      And I should see "cat31" in the "Navigation" "block"
  94      And I should see "cat32" in the "Navigation" "block"
  95      And I should not see "cat331" in the "Navigation" "block"
  96      And I should see "c1" in the "Navigation" "block"
  97      And I should not see "c2" in the "Navigation" "block"
  98      And I should see "c31" in the "Navigation" "block"
  99      And I should not see "c32" in the "Navigation" "block"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1