1 |
efrain |
1 |
@block @core_block @javascript
|
|
|
2 |
Feature: Add a block when main feature is disabled
|
|
|
3 |
In order to add a block to my course
|
|
|
4 |
As a teacher
|
|
|
5 |
Some blocks should be only added to courses if the main feature they are based on is enabled.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | format |
|
|
|
10 |
| Course 1 | C1 | topics |
|
|
|
11 |
And I am on the "C1" "course" page logged in as "admin"
|
|
|
12 |
|
|
|
13 |
Scenario Outline: The block is displayed even when main feature is disabled
|
|
|
14 |
Given the following config values are set as admin:
|
|
|
15 |
| <settingname1> | 1 | <settingplugin1> |
|
|
|
16 |
And I turn editing mode on
|
|
|
17 |
And I add the "<blockname>" block
|
|
|
18 |
When the following config values are set as admin:
|
|
|
19 |
| <settingname1> | 0 | <settingplugin1> |
|
|
|
20 |
Then I should see "<blockname>"
|
|
|
21 |
|
|
|
22 |
Examples:
|
|
|
23 |
| blockname | settingname1 | settingplugin1 |
|
|
|
24 |
| Accessibility review | enableaccessibilitytools | |
|
|
|
25 |
| Blog menu | enableblogs | |
|
|
|
26 |
| Recent blog entries | enableblogs | |
|
|
|
27 |
| Comments | usecomments | |
|
|
|
28 |
| Course completion status | enablecompletion | |
|
|
|
29 |
| Global search | enableglobalsearch | |
|
|
|
30 |
| Latest badges | enablebadges | |
|
|
|
31 |
| Tags | usetags | |
|
|
|
32 |
| Learning plans | enabled | core_competency |
|
|
|
33 |
|
|
|
34 |
Scenario Outline: The block is displayed even when main feature is disabled (2 settings)
|
|
|
35 |
Given the following config values are set as admin:
|
|
|
36 |
| <settingname1> | 1 |
|
|
|
37 |
| <settingname2> | 1 |
|
|
|
38 |
And I turn editing mode on
|
|
|
39 |
And I add the "<blockname>" block
|
|
|
40 |
When the following config values are set as admin:
|
|
|
41 |
| <settingname1> | 0 |
|
|
|
42 |
| <settingname2> | 0 |
|
|
|
43 |
Then I should see "<blockname>"
|
|
|
44 |
|
|
|
45 |
Examples:
|
|
|
46 |
| blockname | settingname1 | settingname2 |
|
|
|
47 |
| Blog tags | enableblogs | usetags |
|
|
|
48 |
|
|
|
49 |
Scenario Outline: The block can be removed even when main feature is disabled
|
|
|
50 |
Given the following config values are set as admin:
|
|
|
51 |
| <settingname1> | 1 | <settingplugin1> |
|
|
|
52 |
And I turn editing mode on
|
|
|
53 |
And I add the "<blockname>" block
|
|
|
54 |
And I open the "<blockname>" blocks action menu
|
|
|
55 |
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
|
|
|
56 |
And "Delete block?" "dialogue" should exist
|
|
|
57 |
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
|
|
|
58 |
And I should see "<blockname>"
|
|
|
59 |
When the following config values are set as admin:
|
|
|
60 |
| <settingname1> | 0 | <settingplugin1> |
|
|
|
61 |
And I open the "<blockname>" blocks action menu
|
|
|
62 |
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
|
|
|
63 |
And "Delete block?" "dialogue" should exist
|
|
|
64 |
And I click on "Delete" "button" in the "Delete block?" "dialogue"
|
|
|
65 |
Then I should not see "<blockname>"
|
|
|
66 |
|
|
|
67 |
Examples:
|
|
|
68 |
| blockname | settingname1 | settingplugin1 |
|
|
|
69 |
| Accessibility review | enableaccessibilitytools | |
|
|
|
70 |
| Blog menu | enableblogs | |
|
|
|
71 |
| Recent blog entries | enableblogs | |
|
|
|
72 |
| Comments | usecomments | |
|
|
|
73 |
| Course completion status | enablecompletion | |
|
|
|
74 |
| Global search | enableglobalsearch | |
|
|
|
75 |
| Latest badges | enablebadges | |
|
|
|
76 |
| Tags | usetags | |
|
|
|
77 |
| Learning plans | enabled | core_competency |
|
|
|
78 |
|
|
|
79 |
Scenario Outline: The block can be removed even when main feature is disabled (2 settings)
|
|
|
80 |
Given the following config values are set as admin:
|
|
|
81 |
| <settingname1> | 1 |
|
|
|
82 |
| <settingname2> | 1 |
|
|
|
83 |
And I turn editing mode on
|
|
|
84 |
And I add the "<blockname>" block
|
|
|
85 |
And I open the "<blockname>" blocks action menu
|
|
|
86 |
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
|
|
|
87 |
And "Delete block?" "dialogue" should exist
|
|
|
88 |
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
|
|
|
89 |
And I should see "<blockname>"
|
|
|
90 |
When the following config values are set as admin:
|
|
|
91 |
| <settingname1> | 0 |
|
|
|
92 |
| <settingname2> | 0 |
|
|
|
93 |
And I open the "<blockname>" blocks action menu
|
|
|
94 |
And I click on "Delete <blockname> block" "link" in the "<blockname>" "block"
|
|
|
95 |
And "Delete block?" "dialogue" should exist
|
|
|
96 |
And I click on "Delete" "button" in the "Delete block?" "dialogue"
|
|
|
97 |
Then I should not see "<blockname>"
|
|
|
98 |
|
|
|
99 |
Examples:
|
|
|
100 |
| blockname | settingname1 | settingname2 |
|
|
|
101 |
| Blog tags | enableblogs | usetags |
|