Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_course @core_courseformatFeature: Course index completion iconsIn order to quickly check my activities completionsAs a studentI need to see the activity completion in the course index.Background:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || student1 | Student | 1 | student1@example.com |And the following "course" exists:| fullname | Course 1 || shortname | C1 || category | 0 || enablecompletion | 1 || numsections | 4 |And the following "activities" exist:| activity | name | intro | course | idnumber | section | completion || assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 | 1 |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student || teacher1 | C1 | editingteacher |# The course index is hidden by default in small devices.And I change window size to "large"@javascriptScenario: Teacher does not see completion icons.When I am on the "C1" "Course" page logged in as "teacher1"Then I should see "New section" in the "courseindex-content" "region"And I should see "Activity sample 1" in the "courseindex-content" "region"And "To do" "icon" should not exist in the "courseindex-content" "region"@javascriptScenario: User should see the completion iconsWhen I am on the "C1" "Course" page logged in as "student1"Then I should see "New section" in the "courseindex-content" "region"And I should see "Activity sample 1" in the "courseindex-content" "region"And "To do" "icon" should exist in the "courseindex-content" "region"@javascriptScenario: Manual completion should update the course index completionGiven I am on the "C1" "Course" page logged in as "student1"And "To do" "icon" should exist in the "courseindex-content" "region"When I press "Mark as done"And I wait until "Done" "button" existsThen "Done" "icon" should exist in the "courseindex-content" "region"And I press "Done"And I wait until "Mark as done" "button" existsAnd "To do" "icon" should exist in the "courseindex-content" "region"@javascriptScenario: Manual completion in an activity page should update the course indexGiven I am on the "sample1" "Activity" page logged in as "student1"And "To do" "icon" should exist in the "courseindex-content" "region"When I press "Mark as done"And I wait until "Done" "button" existsThen "Done" "icon" should exist in the "courseindex-content" "region"And I press "Done"And I wait until "Mark as done" "button" existsAnd "To do" "icon" should exist in the "courseindex-content" "region"@javascriptScenario: Refresh the page should keep the completion consistentGiven I am on the "C1" "Course" page logged in as "student1"And "To do" "icon" should exist in the "courseindex-content" "region"When I press "Mark as done"And I wait until "Done" "button" existsAnd I reload the pageThen the manual completion button of "Activity sample 1" is displayed as "Done"@javascriptScenario: Auto completion should appear in the course indexGiven the following "activities" exist:| activity | name | intro | course | idnumber | section | completion | completionview || assign | Activity sample 2 | Test assignment description | C1 | sample2 | 1 | 1 | 1 |When I am on the "sample2" "Activity" page logged in as "student1"And I am on the "C1" "Course" pageThen "Done" "icon" should exist in the "courseindex-content" "region"@javascriptScenario: Completion failed should appear in the course indexGiven 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 | 1 | 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 "Failed" "icon" should exist in the "courseindex-content" "region"@javascriptScenario: Completion passed should appear in the course indexGiven 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 | 1 | 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 | True |When I am on the "C1" "Course" page logged in as "student1"And "Done" "icon" should exist in the "courseindex-content" "region"@javascriptScenario: Completion done should appear in the course index when the requirement is any gradeGiven 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 || quiz | Test quiz name | C1 | quiz1 | 1 | 5.00 | 2 | 1 | 0 |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"@javascriptScenario: Activities with custom completion rules could failGiven the following "activity" exists:| activity | scorm || course | C1 || name | Music history || packagefilepath | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip || maxattempt | 1 || latattemptlock | 1 |# Add requirements| completion | 2 || completionscorerequired | 90 |Given I am on the "Music history" "scorm activity" page logged in as student1# We need a little taller window because Firefox is, apparently, unable to auto-scroll within# an iframe, so we need to ensure that the "Save changes" button is visible in the viewport.And I change window size to "large"And I press "Enter"And I switch to the main frameAnd I click on "Par?" "list_item"And I switch to "scorm_object" iframeAnd I wait until the page is readyAnd I switch to the main frameAnd I click on "Keeping Score" "list_item"And I switch to "scorm_object" iframeAnd I wait until the page is readyAnd I switch to the main frameAnd I click on "Other Scoring Systems" "list_item"And I switch to "scorm_object" iframeAnd I wait until the page is readyAnd I switch to the main frameAnd I click on "The Rules of Golf" "list_item"And I switch to "scorm_object" iframeAnd I wait until the page is readyAnd I switch to the main frameAnd I click on "Playing Golf Quiz" "list_item"And I switch to "scorm_object" iframeAnd I wait until the page is readyAnd I click on "[id='question_com.scorm.golfsamples.interactions.playing_1_1']" "css_element"And I press "Submit Answers"And I wait until "Score: 20" "text" existsAnd I switch to the main frameAnd I click on "Exit activity" "link"And "Failed" "icon" should exist in the "courseindex-content" "region"