enrolments.feature 5.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@tool @tool_uploadcourse @_file_upload
Feature: An admin can update courses enrolments using a CSV file
  In order to update courses enrolments using a CSV file
  As an admin
  I need to be able to upload a CSV file with enrolment methods for the courses

  Background:
    Given the following "courses" exist:
      | fullname | shortname | category |
      | Course 1 | C1        | 0        |
    And I log in as "admin"

  @javascript
  Scenario: Creating enrolment method by enable it
15
    Given I am on the "Course 1" "enrolment methods" page
16
17
18
19
20
21
22
23
24
25
26
    And I click on "Delete" "link" in the "Guest access" "table_row"
    And I click on "Continue" "button"
    And I should not see "Guest access" in the "generaltable" "table"
    And I navigate to "Courses > Upload courses" in site administration
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
    And I set the field "Upload mode" to "Only update existing courses"
    And I set the field "Update mode" to "Update with CSV data only"
    And I set the field "Allow deletes" to "Yes"
    And I click on "Preview" "button"
    When I click on "Upload courses" "button"
    Then I should see "Course updated"
27
    And I am on the "Course 1" "enrolment methods" page
28
29
30
31
    And "Disable" "icon" should exist in the "Guest access" "table_row"

  @javascript
  Scenario: Creating enrolment method by disabling it
32
    Given I am on the "Course 1" "enrolment methods" page
33
34
35
36
37
38
39
40
41
42
43
    And I click on "Delete" "link" in the "Guest access" "table_row"
    And I click on "Continue" "button"
    And I should not see "Guest access" in the "generaltable" "table"
    And I navigate to "Courses > Upload courses" in site administration
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
    And I set the field "Upload mode" to "Only update existing courses"
    And I set the field "Update mode" to "Update with CSV data only"
    And I set the field "Allow deletes" to "Yes"
    And I click on "Preview" "button"
    When I click on "Upload courses" "button"
    Then I should see "Course updated"
44
    And I am on the "Course 1" "enrolment methods" page
45
46
47
48
49
50
51
52
53
54
55
56
    And "Enable" "icon" should exist in the "Guest access" "table_row"

  @javascript
  Scenario: Enabling enrolment method
    Given I navigate to "Courses > Upload courses" in site administration
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
    And I set the field "Upload mode" to "Only update existing courses"
    And I set the field "Update mode" to "Update with CSV data only"
    And I set the field "Allow deletes" to "Yes"
    And I click on "Preview" "button"
    When I click on "Upload courses" "button"
    Then I should see "Course updated"
57
    And I am on the "Course 1" "enrolment methods" page
58
59
60
61
    And "Disable" "icon" should exist in the "Guest access" "table_row"

  @javascript
  Scenario: Disable an enrolment method
62
    Given I am on the "Course 1" "enrolment methods" page
63
64
65
66
67
68
69
70
71
72
    And I click on "Enable" "link" in the "Guest access" "table_row"
    And "Disable" "icon" should exist in the "Guest access" "table_row"
    And I navigate to "Courses > Upload courses" in site administration
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
    And I set the field "Upload mode" to "Only update existing courses"
    And I set the field "Update mode" to "Update with CSV data only"
    And I set the field "Allow deletes" to "Yes"
    And I click on "Preview" "button"
    When I click on "Upload courses" "button"
    Then I should see "Course updated"
73
    And I am on the "Course 1" "enrolment methods" page
74
75
76
77
78
79
80
81
82
83
84
85
    And "Enable" "icon" should exist in the "Guest access" "table_row"

  @javascript
  Scenario: Delete an enrolment method
    Given I navigate to "Courses > Upload courses" in site administration
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
    And I set the field "Upload mode" to "Only update existing courses"
    And I set the field "Update mode" to "Update with CSV data only"
    And I set the field "Allow deletes" to "Yes"
    And I click on "Preview" "button"
    When I click on "Upload courses" "button"
    Then I should see "Course updated"
86
    And I am on the "Course 1" "enrolment methods" page
87
88
89
90
    And I should not see "Guest access" in the "generaltable" "table"

  @javascript
  Scenario: Delete an unexistent enrolment method (nothing should change)
91
    Given I am on the "Course 1" "enrolment methods" page
92
93
94
95
96
97
98
99
100
101
102
    And I click on "Delete" "link" in the "Guest access" "table_row"
    And I click on "Continue" "button"
    And I should not see "Guest access" in the "generaltable" "table"
    And I navigate to "Courses > Upload courses" in site administration
    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
    And I set the field "Upload mode" to "Only update existing courses"
    And I set the field "Update mode" to "Update with CSV data only"
    And I set the field "Allow deletes" to "Yes"
    And I click on "Preview" "button"
    When I click on "Upload courses" "button"
    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"