1 |
efrain |
1 |
@core @core_calendar
|
|
|
2 |
Feature: Export calendar events
|
|
|
3 |
In order to be able to use my calendar events outside of Moodle
|
|
|
4 |
As a user
|
|
|
5 |
I need to export calendar events in iCalendar format
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | 1 | student1@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 |
| student1 | C1 | student |
|
|
|
17 |
And I log in as "student1"
|
|
|
18 |
|
|
|
19 |
Scenario: Viewing calendar export options
|
|
|
20 |
Given I follow "Full calendar"
|
|
|
21 |
When I click on "Import or export calendars" "link"
|
|
|
22 |
And "Calendar" "link" should exist in the ".breadcrumb" "css_element"
|
|
|
23 |
And "Import or export calendars" "text" should exist in the ".breadcrumb" "css_element"
|
|
|
24 |
And I click on "Export calendar" "button"
|
|
|
25 |
And "Calendar" "link" should exist in the ".breadcrumb" "css_element"
|
|
|
26 |
And "Import or export calendars" "link" should exist in the ".breadcrumb" "css_element"
|
|
|
27 |
And "Export calendar" "text" should exist in the ".breadcrumb" "css_element"
|
|
|
28 |
Then I should see "All events"
|
|
|
29 |
And I should see "Events related to courses"
|
|
|
30 |
And I should see "Events related to groups"
|
|
|
31 |
And I should see "My personal events"
|
|
|
32 |
|
|
|
33 |
@javascript
|
|
|
34 |
Scenario: Export calendar in ics format
|
|
|
35 |
And I follow "Full calendar"
|
|
|
36 |
And I press "New event"
|
|
|
37 |
And I set the following fields to these values:
|
|
|
38 |
| Event title | My event |
|
|
|
39 |
| id_timestart_hour | 13 |
|
|
|
40 |
| id_timestart_minute | 00 |
|
|
|
41 |
And I press "Save"
|
|
|
42 |
When I click on "Import or export calendars" "link"
|
|
|
43 |
And I click on "Export calendar" "button"
|
|
|
44 |
And I set the field "All events" to "1"
|
|
|
45 |
And I set the field "Recent and next 60 days" to "1"
|
|
|
46 |
And I press "Export"
|
|
|
47 |
And I should see "SUMMARY:My event"
|
|
|
48 |
# We need to split the step in two because Bennu library use days with leading zero and moodle removes it.
|
|
|
49 |
And I should see "##today##DTSTART:%Y%m##"
|
|
|
50 |
And I should see "##today##%dT050000Z##"
|
|
|
51 |
|
|
|
52 |
Scenario: Generating calendar URL for all events
|
|
|
53 |
Given I follow "Full calendar"
|
|
|
54 |
And I click on "Import or export calendars" "link"
|
|
|
55 |
And I click on "Export calendar" "button"
|
|
|
56 |
And I set the field "All events" to "1"
|
|
|
57 |
And I set the field "Recent and next 60 days" to "1"
|
|
|
58 |
When I click on "Get calendar URL" "button"
|
|
|
59 |
Then the "value" attribute of "Calendar URL" "field" should contain "&preset_what=all&"
|
|
|
60 |
|
|
|
61 |
Scenario: Generating calendar URL for course events
|
|
|
62 |
Given I follow "Full calendar"
|
|
|
63 |
And I click on "Import or export calendars" "link"
|
|
|
64 |
And I click on "Export calendar" "button"
|
|
|
65 |
And I set the field "Events related to courses" to "1"
|
|
|
66 |
And I set the field "Recent and next 60 days" to "1"
|
|
|
67 |
When I click on "Get calendar URL" "button"
|
|
|
68 |
Then the "value" attribute of "Calendar URL" "field" should contain "&preset_what=courses&"
|
|
|
69 |
|
|
|
70 |
Scenario: Generating calendar URL for group events
|
|
|
71 |
Given I follow "Full calendar"
|
|
|
72 |
And I click on "Import or export calendars" "link"
|
|
|
73 |
And I click on "Export calendar" "button"
|
|
|
74 |
And I set the field "Events related to groups" to "1"
|
|
|
75 |
And I set the field "Recent and next 60 days" to "1"
|
|
|
76 |
When I click on "Get calendar URL" "button"
|
|
|
77 |
Then the "value" attribute of "Calendar URL" "field" should contain "&preset_what=groups&"
|
|
|
78 |
|
|
|
79 |
Scenario: Generating calendar URL for category events
|
|
|
80 |
Given I follow "Full calendar"
|
|
|
81 |
And I click on "Import or export calendars" "link"
|
|
|
82 |
And I click on "Export calendar" "button"
|
|
|
83 |
And I set the field "Events related to categories" to "1"
|
|
|
84 |
And I set the field "Recent and next 60 days" to "1"
|
|
|
85 |
When I click on "Get calendar URL" "button"
|
|
|
86 |
Then the "value" attribute of "Calendar URL" "field" should contain "&preset_what=categories&"
|
|
|
87 |
|
|
|
88 |
Scenario: Generating calendar URL for user events
|
|
|
89 |
Given I follow "Full calendar"
|
|
|
90 |
And I click on "Import or export calendars" "link"
|
|
|
91 |
And I click on "Export calendar" "button"
|
|
|
92 |
And I set the field "My personal events" to "1"
|
|
|
93 |
And I set the field "Recent and next 60 days" to "1"
|
|
|
94 |
When I click on "Get calendar URL" "button"
|
|
|
95 |
Then the "value" attribute of "Calendar URL" "field" should contain "&preset_what=user&"
|