1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: Delete activity and resource works correctly
|
|
|
3 |
As a teacher
|
|
|
4 |
I want to be able to delete an activity and resource
|
|
|
5 |
So that I can remove it from the course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | course | name | intro |
|
|
|
19 |
| label | C1 | Label 1 | Label 1 |
|
|
|
20 |
| glossary | C1 | Glossary 1 | Glossary 1 |
|
|
|
21 |
|
|
|
22 |
@javascript
|
|
|
23 |
Scenario: Activity and resource can be deleted properly
|
|
|
24 |
Given I am on the "Course 1" course page logged in as teacher1
|
|
|
25 |
And I turn editing mode on
|
|
|
26 |
And I open "Label 1" actions menu
|
|
|
27 |
When I click on "Delete" "link" in the "Label 1" activity
|
|
|
28 |
And I click on "Delete" "button" in the "Delete activity?" "dialogue"
|
|
|
29 |
# Confirm that label is successfully deleted
|
|
|
30 |
Then I should not see "Label 1"
|
|
|
31 |
And I open "Glossary 1" actions menu
|
|
|
32 |
And I click on "Delete" "link" in the "Glossary 1" activity
|
|
|
33 |
And I click on "Delete" "button" in the "Delete activity?" "dialogue"
|
|
|
34 |
# Confirm that glossary is successfully deleted.
|
|
|
35 |
And I should not see "Glossary 1"
|
|
|
36 |
# Reload the page and confirm that both the label and glossary are really deleted
|
|
|
37 |
And I reload the page
|
|
|
38 |
And I should not see "Label 1"
|
|
|
39 |
And I should not see "Glossary 1"
|