Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_courseformat
2
Feature: Single section course page
3
  In order to improve the course page
4
  As a user
5
  I need to be able to see a section in a single page
6
 
7
  Background:
8
    Given the following "course" exists:
9
      | fullname         | Course 1 |
10
      | shortname        | C1       |
11
      | category         | 0        |
12
      | numsections      | 3        |
13
      | initsections     | 1        |
14
    And the following "activities" exist:
15
      | activity | name                | course | idnumber | section |
16
      | assign   | Activity sample 0.1 | C1     | sample1  | 0       |
17
      | assign   | Activity sample 1.1 | C1     | sample1  | 1       |
18
      | assign   | Activity sample 1.2 | C1     | sample2  | 1       |
19
      | assign   | Activity sample 1.3 | C1     | sample3  | 1       |
20
      | assign   | Activity sample 2.1 | C1     | sample3  | 2       |
21
      | assign   | Activity sample 2.2 | C1     | sample3  | 2       |
22
    And the following "users" exist:
23
      | username | firstname | lastname | email                |
24
      | teacher1 | Teacher   | 1        | teacher1@example.com |
25
    And the following "course enrolments" exist:
26
      | user     | course | role           |
27
      | teacher1 | C1     | editingteacher |
28
    Given I am on the "C1" "Course" page logged in as "teacher1"
29
 
30
  @javascript
31
  Scenario: Collapsed sections are always expanded in the single section page
32
    Given I press "Collapse all"
33
    And I should not see "Activity sample 1.1" in the "region-main" "region"
34
    When I am on the "Course 1 > Section 1" "course > section" page
35
    Then I should see "Activity sample 1.1"
36
    And I should see "Activity sample 1.2"
37
    And I should see "Activity sample 1.3"
38
    And I should not see "Activity sample 2.1" in the "region-main" "region"
39
    And I should not see "Activity sample 2.1" in the "region-main" "region"
40
 
41
  Scenario: General section is not displayed in the single section page
42
    When I am on the "Course 1 > Section 1" "course > section" page
43
    Then I should not see "General" in the "#section-1" "css_element"
44
    And I should not see "Activity sample 0.1" in the "region-main" "region"
45
    And I should see "Activity sample 1.1"
46
    And I should see "Activity sample 1.2"
47
    And I should see "Activity sample 1.3"
48
    And I should not see "Activity sample 2.1" in the "region-main" "region"
49
    And I should not see "Activity sample 2.1" in the "region-main" "region"
50
 
51
  @javascript
52
  Scenario: The view action for sections displays the single section page
53
    Given I turn editing mode on
54
    And I open section "1" edit menu
55
    When I click on "View" "link" in the "Section 1" "section"
56
    Then I should not see "General" in the "#section-1" "css_element"
57
    And I should not see "Activity sample 0.1" in the "region-main" "region"
58
    And I should see "Activity sample 1.1"
59
    And I should see "Activity sample 1.2"
60
    And I should see "Activity sample 1.3"
61
    And I should not see "Activity sample 2.1" in the "region-main" "region"
62
    And I should not see "Activity sample 2.1" in the "region-main" "region"
63
    And I am on "Course 1" course homepage
64
    And I open section "2" edit menu
65
    And I click on "View" "link" in the "Section 2" "section"
66
    And I should not see "General" in the "#section-2" "css_element"
67
    And I should not see "Activity sample 0.1" in the "region-main" "region"
68
    And I should not see "Activity sample 1.1"
69
    And I should not see "Activity sample 1.2"
70
    And I should not see "Activity sample 1.3"
71
    And I should see "Activity sample 2.1" in the "region-main" "region"
72
    And I should see "Activity sample 2.1" in the "region-main" "region"
73
    # The General section is also displayed in isolation.
74
    But I am on "Course 1" course homepage
75
    And I open section "0" edit menu
76
    And I click on "View" "link" in the "General" "section"
77
    And I should see "General" in the "page" "region"
78
    And I should see "Activity sample 0.1" in the "region-main" "region"
79
    And I should not see "Activity sample 1.1" in the "region-main" "region"
80
    And I should not see "Activity sample 1.2" in the "region-main" "region"
81
    And I should not see "Activity sample 1.3" in the "region-main" "region"
82
    And I should not see "Activity sample 2.1" in the "region-main" "region"
83
    And I should not see "Activity sample 2.1" in the "region-main" "region"
84
    # The section viewed has been trigered.
85
    And I am on "Course 1" course homepage
86
    And I navigate to "Reports > Live logs" in current page administration
87
    And I should see "Section viewed"
88
 
89
  Scenario: The add section button is not displayed in the single section page
90
    Given I turn editing mode on
91
    When I click on "View" "link" in the "Section 1" "section"
92
    Then "Add section" "link" should not exist in the "region-main" "region"
93
 
94
  @javascript
95
  Scenario: Change the section name inline
96
    # The course index is hidden by default in small devices.
97
    Given I change window size to "large"
98
    And I turn editing mode on
99
    And I open section "1" edit menu
100
    And I click on "View" "link" in the "Section 1" "section"
101
    When I set the field "Edit section name" in the "page-header" "region" to "Custom section name"
102
    Then "Custom section name" "text" should exist in the ".breadcrumb" "css_element"
103
 
104
  Scenario: Blocks are displayed in section page too
105
    Given I log out
106
    And the following "blocks" exist:
107
      | blockname    | contextlevel | reference | pagetypepattern | defaultregion |
108
      | online_users | Course       | C1        | course-view-*   | site-pre      |
109
    When I am on the "C1" "Course" page logged in as "teacher1"
110
    Then I should see "Online users"
111
    And I am on the "Course 1 > Section 1" "course > section" page
112
    And I should see "Online users"