Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_uploadcourse @_file_upload
2
Feature: An admin can update courses enrolments using a CSV file
3
  In order to update courses enrolments using a CSV file
4
  As an admin
5
  I need to be able to upload a CSV file with enrolment methods for the courses
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course 1 | C1        | 0        |
11
    And I log in as "admin"
12
 
13
  @javascript
14
  Scenario: Creating enrolment method by enable it
15
    Given I am on the "Course 1" "enrolment methods" page
16
    And I click on "Delete" "link" in the "Guest access" "table_row"
17
    And I click on "Continue" "button"
18
    And I should not see "Guest access" in the "generaltable" "table"
19
    And I navigate to "Courses > Upload courses" in site administration
20
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
21
    And I set the field "Upload mode" to "Only update existing courses"
22
    And I set the field "Update mode" to "Update with CSV data only"
23
    And I set the field "Allow deletes" to "Yes"
24
    And I click on "Preview" "button"
25
    When I click on "Upload courses" "button"
26
    Then I should see "Course updated"
27
    And I am on the "Course 1" "enrolment methods" page
28
    And "Disable" "icon" should exist in the "Guest access" "table_row"
29
 
30
  @javascript
31
  Scenario: Creating enrolment method by disabling it
32
    Given I am on the "Course 1" "enrolment methods" page
33
    And I click on "Delete" "link" in the "Guest access" "table_row"
34
    And I click on "Continue" "button"
35
    And I should not see "Guest access" in the "generaltable" "table"
36
    And I navigate to "Courses > Upload courses" in site administration
37
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
38
    And I set the field "Upload mode" to "Only update existing courses"
39
    And I set the field "Update mode" to "Update with CSV data only"
40
    And I set the field "Allow deletes" to "Yes"
41
    And I click on "Preview" "button"
42
    When I click on "Upload courses" "button"
43
    Then I should see "Course updated"
44
    And I am on the "Course 1" "enrolment methods" page
45
    And "Enable" "icon" should exist in the "Guest access" "table_row"
46
 
47
  @javascript
48
  Scenario: Enabling enrolment method
49
    Given I navigate to "Courses > Upload courses" in site administration
50
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
51
    And I set the field "Upload mode" to "Only update existing courses"
52
    And I set the field "Update mode" to "Update with CSV data only"
53
    And I set the field "Allow deletes" to "Yes"
54
    And I click on "Preview" "button"
55
    When I click on "Upload courses" "button"
56
    Then I should see "Course updated"
57
    And I am on the "Course 1" "enrolment methods" page
58
    And "Disable" "icon" should exist in the "Guest access" "table_row"
59
 
60
  @javascript
61
  Scenario: Disable an enrolment method
62
    Given I am on the "Course 1" "enrolment methods" page
63
    And I click on "Enable" "link" in the "Guest access" "table_row"
64
    And "Disable" "icon" should exist in the "Guest access" "table_row"
65
    And I navigate to "Courses > Upload courses" in site administration
66
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
67
    And I set the field "Upload mode" to "Only update existing courses"
68
    And I set the field "Update mode" to "Update with CSV data only"
69
    And I set the field "Allow deletes" to "Yes"
70
    And I click on "Preview" "button"
71
    When I click on "Upload courses" "button"
72
    Then I should see "Course updated"
73
    And I am on the "Course 1" "enrolment methods" page
74
    And "Enable" "icon" should exist in the "Guest access" "table_row"
75
 
76
  @javascript
77
  Scenario: Delete an enrolment method
78
    Given I navigate to "Courses > Upload courses" in site administration
79
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
80
    And I set the field "Upload mode" to "Only update existing courses"
81
    And I set the field "Update mode" to "Update with CSV data only"
82
    And I set the field "Allow deletes" to "Yes"
83
    And I click on "Preview" "button"
84
    When I click on "Upload courses" "button"
85
    Then I should see "Course updated"
86
    And I am on the "Course 1" "enrolment methods" page
87
    And I should not see "Guest access" in the "generaltable" "table"
88
 
89
  @javascript
90
  Scenario: Delete an unexistent enrolment method (nothing should change)
91
    Given I am on the "Course 1" "enrolment methods" page
92
    And I click on "Delete" "link" in the "Guest access" "table_row"
93
    And I click on "Continue" "button"
94
    And I should not see "Guest access" in the "generaltable" "table"
95
    And I navigate to "Courses > Upload courses" in site administration
96
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
97
    And I set the field "Upload mode" to "Only update existing courses"
98
    And I set the field "Update mode" to "Update with CSV data only"
99
    And I set the field "Allow deletes" to "Yes"
100
    And I click on "Preview" "button"
101
    When I click on "Upload courses" "button"
102
    Then I should see "Course updated"
103
    And I am on the "Course 1" "enrolment methods" page
104
    And I should not see "Guest access" in the "generaltable" "table"
105
 
106
  @javascript
107
  Scenario: Re-upload a file using CSV data only after deleting the enrolments method
108
    Given I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration
109
    And I click on "Enable" "link" in the "Course meta link" "table_row"
110
    And the following "cohort" exists:
111
      | name     | Cohort1  |
112
      | idnumber | Cohort1  |
113
    And the following "category" exists:
114
      | name     | Cat 1 |
115
      | category | 0     |
116
      | idnumber | CAT1  |
117
    And I navigate to "Courses > Upload courses" in site administration
118
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_multiple.csv" file to "File" filemanager
119
    And I click on "Preview" "button"
120
    And I click on "Upload courses" "button"
121
    And I am on the "Course 2" "enrolment methods" page
122
    And I should see "Self enrolment (Student)" in the "generaltable" "table"
123
    And I should see "Cohort sync (Cohort1 - Student)" in the "generaltable" "table"
124
    And I should see "Guest access" in the "generaltable" "table"
125
    And I should see "Manual enrolments" in the "generaltable" "table"
126
    And I should see "Course meta link (Course 1)" in the "generaltable" "table"
127
    And I navigate to "Courses > Upload courses" in site administration
128
    # Delete all enrolment methods.
129
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_multiple_delete.csv" file to "File" filemanager
130
    And I set the field "Upload mode" to "Only update existing courses"
131
    And I set the field "Update mode" to "Update with CSV data only"
132
    And I set the field "Allow deletes" to "Yes"
133
    And I click on "Preview" "button"
134
    And I click on "Upload courses" "button"
135
    And I should see "Course updated"
136
    And I am on the "Course 2" "enrolment methods" page
137
    And I should not see "Self enrolment (Student)" in the "generaltable" "table"
138
    And I should not see "Cohort sync (Cohort1 - Student)" in the "generaltable" "table"
139
    And I should not see "Guest access" in the "generaltable" "table"
140
    And I should not see "Manual enrolments" in the "generaltable" "table"
141
    And I should not see "Course meta link (Course 1)" in the "generaltable" "table"
142
    # Re-upload again the CSV file, to add again the enrolment methods.
143
    And I navigate to "Courses > Upload courses" in site administration
144
    When I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_multiple.csv" file to "File" filemanager
145
    And I set the field "Upload mode" to "Only update existing courses"
146
    And I set the field "Update mode" to "Update with CSV data only"
147
    And I set the field "Allow deletes" to "Yes"
148
    And I click on "Preview" "button"
149
    And I click on "Upload courses" "button"
150
    And I am on the "Course 2" "enrolment methods" page
151
    Then I should see "Self enrolment (Student)" in the "generaltable" "table"
152
    And I should see "Cohort sync (Cohort1 - Student)" in the "generaltable" "table"
153
    And I should see "Guest access" in the "generaltable" "table"
154
    And I should see "Manual enrolments" in the "generaltable" "table"
155
    And I should see "Course meta link (Course 1)" in the "generaltable" "table"
156
    And I navigate to "Courses > Upload courses" in site administration