MDL-62660 tool_dataprivacy: Add method for unit tests to run adhoc tasks
[moodle.git] / calendar / tests / behat / calendar_import.feature
bloba2c47cd5af2b854fc3767197372ab4f787132dad
1 @core @core_calendar @_file_upload @javascript
2 Feature: Import and edit calendar events
3   In order to manipulate imported calendar events
4   As an user
5   I need to import calendar events then edit them.
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 | format |
13       | Course 1 | C1 | topics |
14     And the following "course enrolments" exist:
15       | user | course | role |
16       | teacher1 | C1 | editingteacher |
18   Scenario: Import then edit a calendar event.
19     Given I log in as "teacher1"
20     And I view the calendar for "1" "2016"
21     And I press "Manage subscriptions"
22     And I set the following fields to these values:
23       | Calendar name  | Test Import |
24       | Import from    | Calendar file (.ics) |
25       | Type of event  | User |
26     And I upload "calendar/tests/fixtures/import.ics" file to "Calendar file (.ics)" filemanager
27     And I press "Add"
28     And I should see "Events imported: 2"
29     And I view the calendar for "2" "2017"
30     And I should see "February 2017"
31     And I should see "Event on 2-15-2017"
32     And I should see "Event on 2-25-2017"
33     And I click on "Event on 2-15-2017" "link"
34     And I should see "Some place"
35     And I click on "Edit" "button"
36     And I set the following fields to these values:
37       | Event title    | Event on 2-20-2017 |
38       | Description    | Event on 2-20-2017 |
39       | timestart[day] | 20 |
40     And I press "Save"
41     When I view the calendar for "2" "2017"
42     Then I should see "Event on 2-20-2017"
43     And I should see "Event on 2-25-2017"
44     And I should not see "Event on 2-15-2017"
45     And I press "Manage subscriptions"
46     And I press "Remove"
47     And I view the calendar for "2" "2017"
48     And I should not see "Event on 2-25-2017"
49     And I should not see "Event on 2-20-2017"