MDL-37624 calendar: Added location support
[moodle.git] / calendar / tests / behat / calendar_import.feature
CommitLineData
c3feaf26
SB
1@core @core_calendar @_file_upload @javascript
2Feature: 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.
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 | format |
13 | Course 1 | C1 | topics |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17
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) |
7d416f9c 25 | Type of event | User |
c3feaf26
SB
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"
c448e19b
SL
33 And I click on "Event on 2-15-2017" "link"
34 And I click on "Edit" "button"
35 And I set the following fields to these values:
36 | Event title | Event on 2-20-2017 |
37 | Description | Event on 2-20-2017 |
ef4e04ee 38 | Location | Some place |
c448e19b
SL
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"