Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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.
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 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 press "Import calendar"
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 "Import calendar" "text" should exist in the ".breadcrumb" "css_element"
28
    And I set the following fields to these values:
29
      | Calendar name  | Test Import |
30
      | Import from    | Calendar file (.ics) |
31
      | Type of event  | User |
32
    And I upload "calendar/tests/fixtures/import.ics" file to "Calendar file (.ics)" filemanager
33
    And I press "Import calendar"
34
    And I should see "2 events were imported"
35
    And I view the calendar for "2" "2017"
36
    And I should see "February 2017"
37
    And I should see "Event on 2-15-2017"
38
    And I should see "Event on 2-25-2017"
39
    And I click on "Event on 2-15-2017" "link"
40
    And I should see "Some place"
41
    And I click on "Edit" "button"
42
    And I set the following fields to these values:
43
      | Event title    | Event on 2-20-2017 |
44
      | Description    | Event on 2-20-2017 |
45
      | timestart[day] | 20 |
46
    And I press "Save"
47
    When I view the calendar for "2" "2017"
48
    Then I should see "Event on 2-20-2017"
49
    And I should see "Event on 2-25-2017"
50
    And I should not see "Event on 2-15-2017"
51
    And I click on "Import or export calendars" "link"
52
    And I click on "Delete" "link"
53
    And I should see "Are you sure you want to delete the \"Test Import\" calendar subscription?" in the ".modal .modal-body" "css_element"
54
    And I click on "Yes" "button" in the ".modal.show" "css_element"
55
    And I view the calendar for "2" "2017"
56
    And I should not see "Event on 2-25-2017"
57
    And I should not see "Event on 2-20-2017"
58
 
59
  Scenario: Import events using different event types.
60
    Given I log in as "admin"
61
    And I view the calendar for "1" "2016"
62
    And I click on "Import or export calendars" "link"
63
    And I press "Import calendar"
64
    And I set the following fields to these values:
65
      | Calendar name  | Test Import |
66
      | Import from    | Calendar file (.ics) |
67
      | Type of event  | User |
68
    And I upload "calendar/tests/fixtures/import.ics" file to "Calendar file (.ics)" filemanager
69
    And I press "Import calendar"
70
    And I should see "User events"
71
    And I press "Import calendar"
72
    And I set the following fields to these values:
73
      | Calendar name  | Test Import |
74
      | Import from    | Calendar file (.ics) |
75
      | Type of event  | Category             |
76
      | Category       | Category 1           |
77
    And I upload "calendar/tests/fixtures/import.ics" file to "Calendar file (.ics)" filemanager
78
    And I press "Import calendar"
79
    And I should see "Category events"
80
    And I press "Import calendar"
81
    And I set the following fields to these values:
82
      | Calendar name  | Test Import |
83
      | Import from    | Calendar file (.ics) |
84
      | Type of event  | Site             |
85
    And I upload "calendar/tests/fixtures/import.ics" file to "Calendar file (.ics)" filemanager
86
    And I press "Import calendar"
87
    And I should see "Site events"
88
 
89
  Scenario: Import iCalendar file with parameter.
90
    Given I log in as "admin"
91
    And I view the calendar for "7" "2022"
92
    And I click on "Import or export calendars" "link"
93
    And I press "Import calendar"
94
    And I set the following fields to these values:
95
      | Calendar name | Test Import          |
96
      | Import from   | Calendar file (.ics) |
97
      | Type of event | User                 |
98
    And I upload "calendar/tests/fixtures/import_with_parameters.ics" file to "Calendar file (.ics)" filemanager
99
    And I press "Import calendar"
100
    When I view the calendar for "1" "7" "2022"
101
    Then I should see "First event"
102
    And I should see "Description of the first event"
103
    And I should see "Second event"
104
    And I should see "Description of the second event"