1 |
efrain |
1 |
@core @core_block
|
|
|
2 |
Feature: Block appearances
|
|
|
3 |
In order to configure blocks appearance
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to add and modify block configuration for the page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | teacher | 1 | teacher1@example.com |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | name | course | idnumber |
|
|
|
19 |
| assign | Test assign name | C1 | assign1 |
|
|
|
20 |
| book | Test book name | C1 | book1 |
|
|
|
21 |
And the following "mod_book > chapter" exists:
|
|
|
22 |
| book | Test book name |
|
|
|
23 |
| title | Book title |
|
|
|
24 |
| content | Book content test test |
|
|
|
25 |
And the following "blocks" exist:
|
|
|
26 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
27 |
| comments | Course | C1 | course-view-* | side-pre |
|
|
|
28 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
29 |
And I turn editing mode on
|
|
|
30 |
And I configure the "Comments" block
|
|
|
31 |
And I set the following fields to these values:
|
|
|
32 |
| Display on page types | Any page |
|
|
|
33 |
And I press "Save changes"
|
|
|
34 |
|
|
|
35 |
Scenario: Block settings can be modified so that a block apprears on any page
|
|
|
36 |
When I click on "Test assign name" "link" in the "region-main" "region"
|
|
|
37 |
Then I should see "Comments" in the "Comments" "block"
|
|
|
38 |
And I am on "Course 1" course homepage
|
|
|
39 |
And I configure the "Comments" block
|
|
|
40 |
And I set the following fields to these values:
|
|
|
41 |
| Display on page types | Any course page |
|
|
|
42 |
And I press "Save changes"
|
|
|
43 |
And I turn editing mode off
|
|
|
44 |
And I click on "Test assign name" "link" in the "region-main" "region"
|
|
|
45 |
And I should not see "Comments"
|
|
|
46 |
|
|
|
47 |
Scenario: Block settings can be modified so that a block can be hidden
|
|
|
48 |
When I click on "Test book name" "link" in the "region-main" "region"
|
|
|
49 |
And I configure the "Comments" block
|
|
|
50 |
And I set the following fields to these values:
|
|
|
51 |
| Visible | No |
|
|
|
52 |
And I press "Save changes"
|
|
|
53 |
And I am on "Course 1" course homepage with editing mode off
|
|
|
54 |
And I click on "Test book name" "link" in the "region-main" "region"
|
|
|
55 |
Then I should not see "Comments"
|