Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course @core_courseformat
2
Feature: Course index completion icons
3
  In order to quickly check my activities completions
4
  As a student
5
  I need to see the activity completion in the course index.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
11
      | student1 | Student   | 1        | student1@example.com |
12
    And the following "course" exists:
13
      | fullname         | Course 1 |
14
      | shortname        | C1       |
15
      | category         | 0        |
16
      | enablecompletion | 1        |
17
      | numsections      | 4        |
18
    And the following "activities" exist:
19
      | activity | name              | intro                       | course | idnumber | section | completion |
20
      | assign   | Activity sample 1 | Test assignment description | C1     | sample1  | 1       | 1          |
21
    And the following "course enrolments" exist:
22
      | user     | course | role           |
23
      | student1 | C1     | student        |
24
      | teacher1 | C1     | editingteacher |
25
    # The course index is hidden by default in small devices.
26
    And I change window size to "large"
27
 
28
  @javascript
29
  Scenario: Teacher does not see completion icons.
30
    When I am on the "C1" "Course" page logged in as "teacher1"
31
    Then I should see "New section" in the "courseindex-content" "region"
32
    And I should see "Activity sample 1" in the "courseindex-content" "region"
33
    And "To do" "icon" should not exist in the "courseindex-content" "region"
34
 
35
  @javascript
36
  Scenario: User should see the completion icons
37
    When I am on the "C1" "Course" page logged in as "student1"
38
    Then I should see "New section" in the "courseindex-content" "region"
39
    And I should see "Activity sample 1" in the "courseindex-content" "region"
40
    And "To do" "icon" should exist in the "courseindex-content" "region"
41
 
42
  @javascript
43
  Scenario: Manual completion should update the course index completion
44
    Given I am on the "C1" "Course" page logged in as "student1"
45
    And "To do" "icon" should exist in the "courseindex-content" "region"
1441 ariadna 46
    # Mark an uncompleted activity as completed.
1 efrain 47
    When I press "Mark as done"
48
    And I wait until "Done" "button" exists
49
    Then "Done" "icon" should exist in the "courseindex-content" "region"
50
    And I press "Done"
51
    And I wait until "Mark as done" "button" exists
52
    And "To do" "icon" should exist in the "courseindex-content" "region"
1441 ariadna 53
    # Mark an completed activity as uncompleted (to discard any possible JS dependency, see MDL-84243).
54
    And I press "Mark as done"
55
    And I wait until "Done" "button" exists
56
    And I reload the page
57
    And "Done" "icon" should exist in the "courseindex-content" "region"
58
    And I press "Done"
59
    And I wait until "Mark as done" "button" exists
60
    And "To do" "icon" should exist in the "courseindex-content" "region"
61
    And I press "Mark as done"
62
    And I wait until "Done" "button" exists
63
    Then "Done" "icon" should exist in the "courseindex-content" "region"
1 efrain 64
 
65
  @javascript
66
  Scenario: Manual completion in an activity page should update the course index
67
    Given I am on the "sample1" "Activity" page logged in as "student1"
68
    And "To do" "icon" should exist in the "courseindex-content" "region"
69
    When I press "Mark as done"
70
    And I wait until "Done" "button" exists
71
    Then "Done" "icon" should exist in the "courseindex-content" "region"
72
    And I press "Done"
73
    And I wait until "Mark as done" "button" exists
74
    And "To do" "icon" should exist in the "courseindex-content" "region"
75
 
76
  @javascript
77
  Scenario: Refresh the page should keep the completion consistent
78
    Given I am on the "C1" "Course" page logged in as "student1"
79
    And "To do" "icon" should exist in the "courseindex-content" "region"
80
    When I press "Mark as done"
81
    And I wait until "Done" "button" exists
82
    And I reload the page
83
    Then the manual completion button of "Activity sample 1" is displayed as "Done"
84
 
85
  @javascript
86
  Scenario: Auto completion should appear in the course index
87
    Given the following "activities" exist:
88
      | activity | name              | intro                       | course | idnumber | section | completion | completionview |
89
      | assign   | Activity sample 2 | Test assignment description | C1     | sample2  | 1       | 1          | 1              |
90
    When I am on the "sample2" "Activity" page logged in as "student1"
91
    And I am on the "C1" "Course" page
92
    Then "Done" "icon" should exist in the "courseindex-content" "region"
93
 
94
  @javascript
95
  Scenario: Completion failed should appear in the course index
96
    Given the following "question categories" exist:
97
      | contextlevel | reference | name           |
98
      | Course       | C1        | Test questions |
99
    And the following "questions" exist:
100
      | questioncategory | qtype     | name           | questiontext              |
101
      | Test questions   | truefalse | First question | Answer the first question |
102
    And the following "activities" exist:
103
      | activity | name           | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionattemptsexhausted |
104
      | quiz     | Test quiz name | C1     | quiz1    | 1        | 5.00      | 2          | 1                  | 1                   | 1                           |
105
    And quiz "Test quiz name" contains the following questions:
106
      | question       | page |
107
      | First question | 1    |
108
    And user "student1" has attempted "Test quiz name" with responses:
109
      | slot | response |
110
      | 1    | False    |
111
    When I am on the "C1" "Course" page logged in as "student1"
112
    And "Failed" "icon" should exist in the "courseindex-content" "region"
113
 
114
  @javascript
115
  Scenario: Completion passed should appear in the course index
116
    Given the following "question categories" exist:
117
      | contextlevel | reference | name           |
118
      | Course       | C1        | Test questions |
119
    And the following "questions" exist:
120
      | questioncategory | qtype     | name           | questiontext              |
121
      | Test questions   | truefalse | First question | Answer the first question |
122
    And the following "activities" exist:
123
      | activity | name           | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionattemptsexhausted |
124
      | quiz     | Test quiz name | C1     | quiz1    | 1        | 5.00      | 2          | 1                  | 1                   | 1                           |
125
    And quiz "Test quiz name" contains the following questions:
126
      | question       | page |
127
      | First question | 1    |
128
    And user "student1" has attempted "Test quiz name" with responses:
129
      | slot | response |
130
      | 1    | True    |
131
    When I am on the "C1" "Course" page logged in as "student1"
132
    And "Done" "icon" should exist in the "courseindex-content" "region"
133
 
134
  @javascript
135
  Scenario: Completion done should appear in the course index when the requirement is any grade
136
    Given the following "question categories" exist:
137
      | contextlevel | reference | name           |
138
      | Course       | C1        | Test questions |
139
    And the following "questions" exist:
140
      | questioncategory | qtype     | name           | questiontext              |
141
      | Test questions   | truefalse | First question | Answer the first question |
142
    And the following "activities" exist:
143
      | activity | name           | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade |
144
      | quiz     | Test quiz name | C1     | quiz1    | 1        | 5.00      | 2          | 1                  | 0                   |
145
    And quiz "Test quiz name" contains the following questions:
146
      | question       | page |
147
      | First question | 1    |
148
    And user "student1" has attempted "Test quiz name" with responses:
149
      | slot | response |
150
      | 1    | False    |
151
    When I am on the "C1" "Course" page logged in as "student1"
152
    And "Done" "icon" should exist in the "courseindex-content" "region"