Skip to content

Commit 6bc8b45

Browse files
Amaia Anabitarteilyatregubov
authored andcommitted
MDL-81601 core_course: Add course index completion status behats
1 parent 146821a commit 6bc8b45

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

completion/tests/behat/enable_completion_on_pass_grade.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ Feature: Students will be marked as completed if they have achieved a passing gr
3939
When I am on the "Course 1" course page logged in as student1
4040
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
4141
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
42-
And "Failed" "icon" should exist in the "courseindex-content" "region"
4342
And I am on the "Course 1" course page logged in as student2
4443
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
4544
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
46-
And "Done" "icon" should exist in the "courseindex-content" "region"

course/format/tests/behat/courseindex_completion.feature

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Feature: Course index completion icons
108108
| questioncategory | qtype | name | questiontext |
109109
| Test questions | truefalse | First question | Answer the first question |
110110
And the following "activities" exist:
111-
| activity | name | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpass | completionattemptsexhausted |
112-
| quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 1 | 1 |
111+
| activity | name | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionattemptsexhausted |
112+
| quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 1 | 1 |
113113
And quiz "Test quiz name" contains the following questions:
114114
| question | page |
115115
| First question | 1 |
@@ -118,3 +118,23 @@ Feature: Course index completion icons
118118
| 1 | True |
119119
When I am on the "C1" "Course" page logged in as "student1"
120120
And "Done" "icon" should exist in the "courseindex-content" "region"
121+
122+
@javascript
123+
Scenario: Completion done should appear in the course index when the requirement is any grade
124+
Given the following "question categories" exist:
125+
| contextlevel | reference | name |
126+
| Course | C1 | Test questions |
127+
And the following "questions" exist:
128+
| questioncategory | qtype | name | questiontext |
129+
| Test questions | truefalse | First question | Answer the first question |
130+
And the following "activities" exist:
131+
| activity | name | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionattemptsexhausted |
132+
| quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 0 | 1 |
133+
And quiz "Test quiz name" contains the following questions:
134+
| question | page |
135+
| First question | 1 |
136+
And user "student1" has attempted "Test quiz name" with responses:
137+
| slot | response |
138+
| 1 | False |
139+
When I am on the "C1" "Course" page logged in as "student1"
140+
And "Done" "icon" should exist in the "courseindex-content" "region"

0 commit comments

Comments
 (0)