Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_user
2
Feature: Bulk enrolments
3
  In order to manage a course site
4
  As a teacher
5
  I need to be able to bulk edit enrolments
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | student1 | Student | 1 | student1@example.com |
11
      | student2 | Student | 2 | student2@example.com |
12
      | teacher1 | Teacher | 1 | teacher1@example.com |
13
    And the following "courses" exist:
14
      | fullname | shortname | format |
15
      | Course 1 | C1 | topics |
16
    And the following "course enrolments" exist:
17
      | user | course | role |
18
      | student1 | C1 | student |
19
      | student2 | C1 | student |
20
      | teacher1 | C1 | editingteacher |
21
    And the following "cohorts" exist:
22
      | name   | idnumber  |
23
      | Cohort | cohortid1 |
24
 
25
  @javascript
26
  Scenario: Bulk edit enrolments
27
    When I log in as "admin"
28
    And I am on "Course 1" course homepage
29
    And I navigate to course participants
30
    And I click on "Select all" "checkbox"
31
    And I set the field "With selected users..." to "Edit selected user enrolments"
32
    And I set the field "Alter status" to "Suspended"
33
    And I press "Save changes"
34
    Then I should see "Suspended" in the "Teacher 1" "table_row"
35
    And I should see "Suspended" in the "Student 1" "table_row"
36
    And I should see "Suspended" in the "Student 2" "table_row"
37
 
38
  @javascript
39
  Scenario: Bulk delete enrolments
40
    When I log in as "admin"
41
    And I am on "Course 1" course homepage
42
    And I navigate to course participants
43
    And I click on "Select all" "checkbox"
44
    And I set the field "With selected users..." to "Delete selected user enrolments"
45
    And I press "Unenrol users"
46
    Then I should not see "Student 1"
47
    And I should not see "Student 2"
48
    And I should not see "Teacher 1"
49
    And I should see "3 unenrolled users"
50
 
51
  @javascript
52
  Scenario: Bulk delete enrolments when user is themselves enrolled
53
    When I log in as "teacher1"
54
    And I am on "Course 1" course homepage
55
    And I navigate to course participants
56
    And I click on "Select all" "checkbox"
57
    And I set the field "With selected users..." to "Delete selected user enrolments"
58
    Then I should see "User \"Teacher 1\" was removed from the selection."
59
    And the following should exist in the "generaltable" table:
60
      | Name      | Status |
61
      | Student 1 | Active |
62
      | Student 2 | Active |
63
    And I should not see "Teacher 1" in the "generaltable" "table"
64
    And I press "Unenrol users"
65
    And I should see "2 unenrolled users"
66
    And I should see "User \"Teacher 1\" was removed from the selection."
67
    And I should see "Teacher 1" in the "participants" "table"
68
    And I should not see "Student 1" in the "participants" "table"
69
    And I should not see "Student 2" in the "participants" "table"
70
 
71
  @javascript
72
  Scenario: Bulk edit enrolment for deleted user
73
    When I log in as "admin"
74
    And I navigate to "Users > Accounts > Bulk user actions" in site administration
75
    And I set the field "Available" to "Student 1"
76
    And I press "Add to selection"
77
    And I set the field "Available" to "Student 2"
78
    And I press "Add to selection"
79
    And I navigate to "Users > Accounts > Browse list of users" in site administration
80
    And I press "Delete" action in the "Student 1" report row
81
    And I click on "Delete" "button" in the "Delete user" "dialogue"
82
    And I navigate to "Users > Accounts > Bulk user actions" in site administration
83
    And I set the field "id_action" to "Add to cohort"
84
    And I press "Go"
85
    And I set the field "id_cohort" to "Cohort [cohortid1]"
86
    And I press "Add to cohort"
87
    And I navigate to "Users > Accounts > Cohorts" in site administration
88
    And I press "Assign" action in the "cohortid1" report row
89
    Then the "removeselect" select box should contain "Student 2 (student2@example.com)"
90
    And the "removeselect" select box should not contain "Student 1 (student1@example.com)"