Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_course_list
2
Feature: Enable the course_list block on a course page and view it's contents
3
  In order to enable the course list block on an course page
4
  As a teacher
5
  I can add the course list block to a course page
6
 
7
  Background:
8
    Given the following "categories" exist:
9
      | name        | category | idnumber |
10
      | Category A  | 0        | CATA     |
11
      | Category B  | 0        | CATB     |
12
      | Category C  | CATB     | CATC     |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1        | 0        |
16
      | Course 2 | C2        | CATA     |
17
      | Course 3 | C3        | CATB     |
18
      | Course 4 | C4        | CATC     |
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 course page and navigate to the course listing
29
    Given I log in as "teacher1"
30
    And I am on "Course 1" course homepage with editing mode on
31
    And the following config values are set as admin:
32
      | unaddableblocks | | theme_boost|
33
    When I add the "Courses" block
34
    Then I should see "Course 1" in the "My courses" "block"
35
    And I should see "Course 2" in the "My courses" "block"
36
    And I should see "Course 3" in the "My courses" "block"
37
    And I should not see "Course 4" in the "My courses" "block"
38
    And I follow "All courses"
39
    And I should see "Category 1"
40
 
41
  Scenario: Add the course list block on course page and navigate to another course
42
    Given I log in as "teacher1"
43
    And I am on "Course 1" course homepage with editing mode on
44
    And the following config values are set as admin:
45
      | unaddableblocks | | theme_boost|
46
    When I add the "Courses" block
47
    Then I should see "Course 1" in the "My courses" "block"
48
    And I should see "Course 2" in the "My courses" "block"
49
    And I should see "Course 3" in the "My courses" "block"
50
    And I should not see "Course 4" in the "My courses" "block"
51
    And I am on "Course 3" course homepage
52
    And I should see "Course 3"
53
 
54
  Scenario: Add the course list block on course page and view as an admin
55
    Given I log in as "admin"
56
    And I am on "Course 1" course homepage with editing mode on
57
    And the following config values are set as admin:
58
      | unaddableblocks | | theme_boost|
59
    When I add the "Courses" block
60
    Then I should see "Category 1" in the "Course categories" "block"
61
    And I should see "Category A" in the "Course categories" "block"
62
    And I should see "Category B" in the "Course categories" "block"
63
    And I should not see "Category C" in the "Course categories" "block"
64
    And I should not see "Course 1" in the "Course categories" "block"
65
    And I should not see "Course 2" in the "Course categories" "block"
66
    And I follow "All courses"
67
    And I should see "Category 1"
68
 
69
  Scenario: View the course list block on course page with hide all courses link enabled
70
    Given the following config values are set as admin:
71
      | block_course_list_hideallcourseslink | 1 |            |
72
      | unaddableblocks                      |   | theme_boost|
73
    And I log in as "teacher1"
74
    And I am on "Course 1" course homepage with editing mode on
75
    When I add the "Courses" block
76
    Then I should not see "All courses" in the "My courses" "block"
77
 
78
  Scenario: View the course list block on course page with admin sees own course enabled
79
    Given the following config values are set as admin:
80
      | block_course_list_adminview | own |            |
81
      | unaddableblocks             |     | theme_boost|
82
    And the following "course enrolments" exist:
83
      | user | course | role           |
84
      | admin | C1 | editingteacher |
85
    And I log in as "admin"
86
    And I am on "Course 1" course homepage with editing mode on
87
    When I add the "Courses" block
88
    Then I should not see "Category 1" in the "My courses" "block"
89
    And I should not see "Category A" in the "My courses" "block"
90
    And I should not see "Category B" in the "My courses" "block"
91
    And I should not see "Category C" in the "My courses" "block"
92
    And I should see "Course 1" in the "My courses" "block"
93
    And I should not see "Course 2" in the "My courses" "block"
94
    And I follow "All courses"
95
    And I should see "Category 1"