Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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 | student1@example.com |
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
    And I am on site homepage
34
    And I turn editing mode on
35
    And the following config values are set as admin:
36
      | unaddableblocks | | theme_boost|
37
    And I add the "Navigation" block if not present
38
    And I configure the "Navigation" block
39
    And I set the following fields to these values:
40
      | Page contexts | Display throughout the entire site |
41
    And I press "Save changes"
42
    And I log out
43
 
44
  @javascript
45
  Scenario: The plain list of enrolled courses is shown
46
    Given the following config values are set as admin:
47
      | navshowmycoursecategories | 0 |
48
    And I log in as "student1"
49
    When I click on "Dashboard" "link" in the "Navigation" "block"
50
    Then I should not see "cat1" in the "Navigation" "block"
51
    And I should not see "cat2" in the "Navigation" "block"
52
    And I should see "c1" in the "Navigation" "block"
53
    And I should see "c31" in the "Navigation" "block"
54
    And I should see "c331" in the "Navigation" "block"
55
    And I should not see "c2" in the "Navigation" "block"
56
    And I should not see "c32" in the "Navigation" "block"
57
    And I should not see "c332" in the "Navigation" "block"
58
 
59
  @javascript
60
  Scenario: The nested list of enrolled courses is shown
61
    Given the following config values are set as admin:
62
      | navshowmycoursecategories | 1 |
63
    And I log in as "student1"
64
    When I click on "Dashboard" "link" in the "Navigation" "block"
65
    Then I should see "cat1" in the "Navigation" "block"
66
    And I should see "cat3" in the "Navigation" "block"
67
    And I should not see "cat2" in the "Navigation" "block"
68
    And I expand "cat3" node
69
    And I should see "cat31" in the "Navigation" "block"
70
    And I should see "cat33" in the "Navigation" "block"
71
    And I should not see "cat32" in the "Navigation" "block"
72
    And I expand "cat31" node
73
    And I should see "c31" in the "Navigation" "block"
74
    And I expand "cat33" node
75
    And I should see "c331" in the "Navigation" "block"
76
    And I should not see "c332" in the "Navigation" "block"
77
 
78
  @javascript
79
  Scenario: I can expand categories and courses as guest
80
    Given the following config values are set as admin:
81
      | navshowmycoursecategories | 1 |
82
      | navshowallcourses         | 1 |
83
    And I expand "Courses" node
84
    And I should see "cat1" in the "Navigation" "block"
85
    And I should see "cat2" in the "Navigation" "block"
86
    And I should see "cat3" in the "Navigation" "block"
87
    And I should not see "cat31" in the "Navigation" "block"
88
    And I should not see "cat32" in the "Navigation" "block"
89
    And I should not see "cat331" in the "Navigation" "block"
90
    And I should not see "c1" in the "Navigation" "block"
91
    And I should not see "c2" in the "Navigation" "block"
92
    And I should not see "c31" in the "Navigation" "block"
93
    And I should not see "c32" in the "Navigation" "block"
94
    When I expand "cat3" node
95
    And I expand "cat31" node
96
    And I expand "cat1" node
97
    Then I should see "cat1" in the "Navigation" "block"
98
    And I should see "cat2" in the "Navigation" "block"
99
    And I should see "cat3" in the "Navigation" "block"
100
    And I should see "cat31" in the "Navigation" "block"
101
    And I should see "cat32" in the "Navigation" "block"
102
    And I should not see "cat331" in the "Navigation" "block"
103
    And I should see "c1" in the "Navigation" "block"
104
    And I should not see "c2" in the "Navigation" "block"
105
    And I should see "c31" in the "Navigation" "block"
106
    And I should not see "c32" in the "Navigation" "block"
107
 
108
  @javascript
109
  Scenario: The course limit setting is applied in the navigation block
110
    Given the following config values are set as admin:
111
      | navcourselimit | 2 |
112
    And I log in as "student1"
113
    And I should see "More..." in the "Navigation" "block"
114
    When I click on "More..." "link" in the "Navigation" "block"
115
    Then I should see "My courses" in the "page-header" "region"
116
 
117
  @javascript
118
  Scenario: The dashboard node is not displayed in the navigation block when it is disabled
119
    Given the following config values are set as admin:
120
      | enabledashboard | 0 |
121
    When I log in as "student1"
122
    Then I should not see "Dashboard" in the "Navigation" "block"
123
# Re-enable dashboard and check then it's displayed in the navigation block.
124
    And the following config values are set as admin:
125
      | enabledashboard | 1 |
126
    And I reload the page
127
    And I should see "Dashboard" in the "Navigation" "block"