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
5 I need to be able to upload a CSV file with enrolment methods for the courses
8 Given the following "courses" exist:
9 | fullname | shortname | category |
11 And I log in as "admin"
14 Scenario: Creating enrolment method by enable it
15 Given I am on "Course 1" course homepage
16 And I navigate to "Users > Enrolment methods" in current page administration
17 And I click on "Delete" "link" in the "Guest access" "table_row"
18 And I click on "Continue" "button"
19 And I should not see "Guest access" in the "generaltable" "table"
20 And I navigate to "Courses > Upload courses" in site administration
21 And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
22 And I set the field "Upload mode" to "Only update existing courses"
23 And I set the field "Update mode" to "Update with CSV data only"
24 And I set the field "Allow deletes" to "Yes"
25 And I click on "Preview" "button"
26 When I click on "Upload courses" "button"
27 Then I should see "Course updated"
28 And I am on "Course 1" course homepage
29 And I navigate to "Users > Enrolment methods" in current page administration
30 And "Disable" "icon" should exist in the "Guest access" "table_row"
33 Scenario: Creating enrolment method by disabling it
34 Given I am on "Course 1" course homepage
35 And I navigate to "Users > Enrolment methods" in current page administration
36 And I click on "Delete" "link" in the "Guest access" "table_row"
37 And I click on "Continue" "button"
38 And I should not see "Guest access" in the "generaltable" "table"
39 And I navigate to "Courses > Upload courses" in site administration
40 And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
41 And I set the field "Upload mode" to "Only update existing courses"
42 And I set the field "Update mode" to "Update with CSV data only"
43 And I set the field "Allow deletes" to "Yes"
44 And I click on "Preview" "button"
45 When I click on "Upload courses" "button"
46 Then I should see "Course updated"
47 And I am on "Course 1" course homepage
48 And I navigate to "Users > Enrolment methods" in current page administration
49 And "Enable" "icon" should exist in the "Guest access" "table_row"
52 Scenario: Enabling enrolment method
53 Given I navigate to "Courses > Upload courses" in site administration
54 And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
55 And I set the field "Upload mode" to "Only update existing courses"
56 And I set the field "Update mode" to "Update with CSV data only"
57 And I set the field "Allow deletes" to "Yes"
58 And I click on "Preview" "button"
59 When I click on "Upload courses" "button"
60 Then I should see "Course updated"
61 And I am on "Course 1" course homepage
62 And I navigate to "Users > Enrolment methods" in current page administration
63 And "Disable" "icon" should exist in the "Guest access" "table_row"
66 Scenario: Disable an enrolment method
67 Given I am on "Course 1" course homepage
68 And I navigate to "Users > Enrolment methods" in current page administration
69 And I click on "Enable" "link" in the "Guest access" "table_row"
70 And "Disable" "icon" should exist in the "Guest access" "table_row"
71 And I navigate to "Courses > Upload courses" in site administration
72 And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
73 And I set the field "Upload mode" to "Only update existing courses"
74 And I set the field "Update mode" to "Update with CSV data only"
75 And I set the field "Allow deletes" to "Yes"
76 And I click on "Preview" "button"
77 When I click on "Upload courses" "button"
78 Then I should see "Course updated"
79 And I am on "Course 1" course homepage
80 And I navigate to "Users > Enrolment methods" in current page administration
81 And "Enable" "icon" should exist in the "Guest access" "table_row"
84 Scenario: Delete an enrolment method
85 Given I navigate to "Courses > Upload courses" in site administration
86 And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
87 And I set the field "Upload mode" to "Only update existing courses"
88 And I set the field "Update mode" to "Update with CSV data only"
89 And I set the field "Allow deletes" to "Yes"
90 And I click on "Preview" "button"
91 When I click on "Upload courses" "button"
92 Then I should see "Course updated"
93 And I am on "Course 1" course homepage
94 And I navigate to "Users > Enrolment methods" in current page administration
95 And I should not see "Guest access" in the "generaltable" "table"
98 Scenario: Delete an unexistent enrolment method (nothing should change)
99 Given I am on "Course 1" course homepage
100 And I navigate to "Users > Enrolment methods" in current page administration
101 And I click on "Delete" "link" in the "Guest access" "table_row"
102 And I click on "Continue" "button"
103 And I should not see "Guest access" in the "generaltable" "table"
104 And I navigate to "Courses > Upload courses" in site administration
105 And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
106 And I set the field "Upload mode" to "Only update existing courses"
107 And I set the field "Update mode" to "Update with CSV data only"
108 And I set the field "Allow deletes" to "Yes"
109 And I click on "Preview" "button"
110 When I click on "Upload courses" "button"
111 Then I should see "Course updated"
112 And I am on "Course 1" course homepage
113 And I navigate to "Users > Enrolment methods" in current page administration
114 And I should not see "Guest access" in the "generaltable" "table"