Skip to content

Commit

Permalink
MDL-81601 core_course: Add course index completion status behats
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaia Anabitarte authored and ilyatregubov committed May 9, 2024
1 parent 146821a commit 6bc8b45
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Feature: Students will be marked as completed if they have achieved a passing gr
When I am on the "Course 1" course page logged in as student1
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
And "Failed" "icon" should exist in the "courseindex-content" "region"
And I am on the "Course 1" course page logged in as student2
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
And "Done" "icon" should exist in the "courseindex-content" "region"
24 changes: 22 additions & 2 deletions course/format/tests/behat/courseindex_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ Feature: Course index completion icons
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | First question | Answer the first question |
And the following "activities" exist:
| activity | name | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpass | completionattemptsexhausted |
| quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 1 | 1 |
| activity | name | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionattemptsexhausted |
| quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 1 | 1 |
And quiz "Test quiz name" contains the following questions:
| question | page |
| First question | 1 |
Expand All @@ -118,3 +118,23 @@ Feature: Course index completion icons
| 1 | True |
When I am on the "C1" "Course" page logged in as "student1"
And "Done" "icon" should exist in the "courseindex-content" "region"

@javascript
Scenario: Completion done should appear in the course index when the requirement is any grade
Given the following "question categories" exist:
| contextlevel | reference | name |
| Course | C1 | Test questions |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | First question | Answer the first question |
And the following "activities" exist:
| activity | name | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionattemptsexhausted |
| quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 0 | 1 |
And quiz "Test quiz name" contains the following questions:
| question | page |
| First question | 1 |
And user "student1" has attempted "Test quiz name" with responses:
| slot | response |
| 1 | False |
When I am on the "C1" "Course" page logged in as "student1"
And "Done" "icon" should exist in the "courseindex-content" "region"

0 comments on commit 6bc8b45

Please sign in to comment.