| 1 |
efrain |
1 |
@core @core_block
|
|
|
2 |
Feature: Block removal via modal
|
|
|
3 |
In order to remove blocks
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to use a modal to confirm the block to delete
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "blocks" exist:
|
| 1441 |
ariadna |
12 |
| blockname | contextlevel | reference | pagetypepattern | showinsubcontexts | defaultregion |
|
|
|
13 |
| search_forums | Course | C1 | course-view-* | 0 | side-pre |
|
|
|
14 |
| myprofile | System | | * | 1 | side-pre |
|
| 1 |
efrain |
15 |
And I log in as "admin"
|
|
|
16 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
17 |
|
|
|
18 |
@javascript
|
|
|
19 |
Scenario: Removing a block via modal should remove the block on the page
|
|
|
20 |
Given I open the "Search forums" blocks action menu
|
|
|
21 |
When I click on "Delete Search forums block" "link" in the "Search forums" "block"
|
| 1441 |
ariadna |
22 |
And I should see "This will delete the block Search forums." in the "Delete block?" "dialogue"
|
| 1 |
efrain |
23 |
And I click on "Delete" "button" in the "Delete block?" "dialogue"
|
|
|
24 |
And I wait to be redirected
|
| 1441 |
ariadna |
25 |
Then "Search forums" "block" should not exist
|
|
|
26 |
And I open the "Logged in user" blocks action menu
|
|
|
27 |
And I click on "Delete Logged in user block" "link" in the "Logged in user" "block"
|
|
|
28 |
And I should see "You are about to delete a block that appears elsewhere" in the "Delete block?" "dialogue"
|
|
|
29 |
And I should see "Original block location: System" in the "Delete block?" "dialogue"
|
|
|
30 |
And I should see "Display on page types: Any page" in the "Delete block?" "dialogue"
|
|
|
31 |
And I should see "Are you sure you want to continue?" in the "Delete block?" "dialogue"
|
|
|
32 |
And I click on "Delete" "button" in the "Delete block?" "dialogue"
|
|
|
33 |
And I wait to be redirected
|
|
|
34 |
And "Logged in user" "block" should not exist
|
| 1 |
efrain |
35 |
|
|
|
36 |
@javascript
|
|
|
37 |
Scenario: Cancel removing a block via modal should retain the block on the page
|
|
|
38 |
Given I open the "Search forums" blocks action menu
|
|
|
39 |
When I click on "Delete Search forums block" "link" in the "Search forums" "block"
|
|
|
40 |
And I click on "Cancel" "button" in the "Delete block?" "dialogue"
|
|
|
41 |
And I should not see "Delete block?"
|
| 1441 |
ariadna |
42 |
Then "Search forums" "block" should exist
|