Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_dash @dash_feature @javascript @_file_upload
2
Feature: Add a dash to an admin pages
3
  In order to check the dash featuers
4
  I can add the dash block to the dashboard
5
 
6
  Background:
7
    Given the following "categories" exist:
8
      | name        | category | idnumber |
9
      | Category 01 | 0        | CAT1     |
10
      | Category 02 | 0        | CAT2     |
11
    And the following "courses" exist:
12
      | fullname | shortname | category | enablecompletion |
13
      | Course 1 | C1        | CAT1     | 1                |
14
      | Course 2 | C2        | CAT1     | 0                |
15
      | Course 3 | C3        | CAT2     | 1                |
16
      | Course 4 | C4        | CAT2     | 1                |
17
    And the following "users" exist:
18
      | username | firstname | lastname | email                |
19
      | student1 | Student   | First    | student1@example.com |
20
      | teacher1 | Teacher   | First    | teacher1@example.com |
21
      | student2 | Student   | Two      | student2@example.com |
22
    And the following "activities" exist:
23
      | activity | course | idnumber | section | name             | intro                 | completion | completionview |
24
      | page     | C1     | page1    | 0       | Test page name   | Test page description | 2          | 1              |
25
      | page     | C1     | page2    | 1       | Test page name 2 | Test page description | 2          | 1              |
26
    And the following "course enrolments" exist:
27
      | user     | course | role    |
28
      | student1 | C1     | student |
29
      | student1 | C2     | student |
30
      | teacher1 | C1     | teacher |
31
      | teacher1 | C2     | teacher |
32
 
33
  Scenario: Global Settings : Show header feature
34
    And I log in as "admin"
35
    And I navigate to "Plugins > Blocks > Dash" in site administration
36
    Then I set the field "Show header" to "Hidden"
37
    Then I press "Save changes"
38
    And I navigate to "Appearance > Default Dashboard page" in site administration
39
    And I turn editing mode on
40
    And I create dash "Users" datasource
41
    Then I configure the "New Dash" block
42
    And I set the field "Block title" to "Datasource: Users"
43
    And I set the following fields to these values:
44
      | Region | content |
45
    And I press "Save changes"
46
    Then I should see "Datasource: Users"
47
    Then I turn editing mode off
48
    Then I should not see "Datasource: Users"
49
    And I click on "Reset Dashboard for all users" "button"
50
    Then I log in as "student1"
51
    Then I follow "Dashboard"
52
    Then I turn editing mode on
53
    Then I should see "Datasource: Users"
54
    Then I turn editing mode off
55
    Then I should not see "Datasource: Users"
56
    Then I log in as "admin"
57
    And I navigate to "Plugins > Blocks > Dash" in site administration
58
    Then I set the field "Show header" to "Visible"
59
    Then I press "Save changes"
60
    And I navigate to "Appearance > Default Dashboard page" in site administration
61
    And I turn editing mode on
62
    And I create dash "Users" datasource
63
    Then I configure the "New Dash" block
64
    And I set the field "Block title" to "Datasource: Users Report"
65
    And I set the following fields to these values:
66
      | Region | content |
67
    And I press "Save changes"
68
    Then I should see "Datasource: Users Report"
69
    Then I turn editing mode off
70
    Then I should see "Datasource: Users Report"
71
    And I click on "Reset Dashboard for all users" "button"
72
    Then I log in as "student1"
73
    Then I follow "Dashboard"
74
    Then I turn editing mode on
75
    Then I should see "Datasource: Users Report"
76
    Then I turn editing mode off
77
    Then I should see "Datasource: Users Report"
78
 
79
  Scenario: Block Settings : Show header feature
80
    And I log in as "admin"
81
    And I navigate to "Plugins > Blocks > Dash" in site administration
82
    Then I set the field "Show header" to "Hidden"
83
    Then I press "Save changes"
84
    And I navigate to "Appearance > Default Dashboard page" in site administration
85
    And I turn editing mode on
86
    And I create dash "Users" datasource
87
    Then I configure the "New Dash" block
88
    And I set the field "Block title" to "Datasource: Users"
89
    And I set the following fields to these values:
90
      | Region | content |
91
      | Show header | Hidden |
92
    And I press "Save changes"
93
    Then I should see "Datasource: Users"
94
    Then I turn editing mode off
95
    Then I should not see "Datasource: Users"
96
    And I click on "Reset Dashboard for all users" "button"
97
    Then I log in as "student1"
98
    Then I follow "Dashboard"
99
    Then I turn editing mode on
100
    Then I should see "Datasource: Users"
101
    Then I turn editing mode off
102
    Then I should not see "Datasource: Users"
103
 
104
  Scenario: Block Settings: Dash settings improvements
105
    And I log in as "admin"
106
    #General setting css classes
107
    And I navigate to "Plugins > Blocks > Dash" in site administration
108
    And I set the following fields to these values:
109
      | CSS classes | dash-card-block |
110
    And I press "Save changes"
111
 
112
    # Dash block setting css classes
113
    And I follow dashboard
114
    And I navigate to "Appearance > Default Dashboard page" in site administration
115
    And I turn dash block editing mode on
116
    And I add the "Dash" block
117
    And I configure the "New Dash" block
118
    And I expand all fieldsets
119
    And I set the following fields to these values:
120
      | CSS classes | dash-element, dash-card |
121
    And I press "Save changes"
122
    And I click on "Reset Dashboard for all users" "button"
123
    And I follow dashboard
124
    And ".dash-element.dash-card" "css_element" should exist in the ".block-region .block_dash" "css_element"
125
 
126
    # Gradient color
127
    And I navigate to "Appearance > Default Dashboard page" in site administration
128
    And I turn dash block editing mode on
129
    And I add the "Dash" block
130
    And I configure the "New Dash" block
131
    And I expand all fieldsets
132
    And I set the following fields to these values:
133
      | Background gradient | linear-gradient(90deg, rgba(255, 210, 0, .2) 0%, rgba(70, 210, 251, .2) 100%) |
134
    And I press "Save changes"
135
    And I click on "Reset Dashboard for all users" "button"
136
    And I follow dashboard
137
    And I check dash css "linear-gradient(90deg, rgba(255, 210, 0, 0.2) 0%, rgba(70, 210, 251, 0.2) 100%)" "section.block_dash:nth-of-type(2)" "background-image"
138
 
139
    # Font color picker
140
    And I navigate to "Appearance > Default Dashboard page" in site administration
141
    And I turn dash block editing mode on
142
    And I add the "Dash" block
143
    And I click on "Users" "radio"
144
    And I configure the "New Dash" block
145
    And I expand all fieldsets
146
    And I set the following fields to these values:
147
      | Block title | Users 01|
148
      | Font color | #c60061 |
149
    And I press "Save changes"
150
    And I click on "Reset Dashboard for all users" "button"
151
    And I follow dashboard
152
    And I check dash css "rgb(198, 0, 97)" "section.block_dash:nth-of-type(3) .card-title" "color"
153
 
154
    # Border color
155
    And I navigate to "Appearance > Default Dashboard page" in site administration
156
    And I turn dash block editing mode on
157
    And I add the "Dash" block
158
    And I configure the "New Dash" block
159
    And I expand all fieldsets
160
    And I set the following fields to these values:
161
      | Block title | Border settings |
162
      | Border | Visible |
163
    And I press "Save changes"
164
    And I click on "Reset Dashboard for all users" "button"
165
    And I follow dashboard
166
    And I check dash css "1px solid rgba(0, 0, 0, 0.125)" "section.block_dash:nth-of-type(4)" "border"
167
 
168
  Scenario: Default fields after selecting the data source
169
    And I log in as "admin"
170
    # Users data source
171
    And I navigate to "Appearance > Default Dashboard page" in site administration
172
    And I turn dash block editing mode on
173
    And I add the "Dash" block
174
    And I click on "Users" "radio"
175
    And I configure the "New Dash" block
176
    And I expand all fieldsets
177
    And I set the following fields to these values:
178
      | Block title | Users |
179
    And I press "Save changes"
180
    And I click on "Reset Dashboard for all users" "button"
181
    And I follow dashboard
182
    And I should see "Student"
183
    And I should see "First"
184
    And I should see "student1@example.com"