|
| 1 | +@addon_mod_page @app @mod @mod_page @javascript @core_completion |
| 2 | +Feature: View activity completion information in the Page resource |
| 3 | + In order to have visibility of page completion requirements |
| 4 | + As a student |
| 5 | + I need to be able to view my page completion progress |
| 6 | + |
| 7 | + Background: |
| 8 | + Given the following "users" exist: |
| 9 | + | username | firstname | lastname | email | |
| 10 | + | student1 | Vinnie | Student1 | student1@example.com | |
| 11 | + | teacher1 | Darrell | Teacher1 | teacher1@example.com | |
| 12 | + And the following "courses" exist: |
| 13 | + | fullname | shortname | category | enablecompletion | showcompletionconditions | |
| 14 | + | Course 1 | C1 | 0 | 1 | 1 | |
| 15 | + | Course 2 | C2 | 0 | 1 | 0 | |
| 16 | + And the following "course enrolments" exist: |
| 17 | + | user | course | role | |
| 18 | + | student1 | C1 | student | |
| 19 | + | student1 | C2 | student | |
| 20 | + | teacher1 | C1 | editingteacher | |
| 21 | + | teacher1 | C2 | editingteacher | |
| 22 | + |
| 23 | + Scenario: A teacher can view a page resource automatic completion items |
| 24 | + Given the following "activity" exists: |
| 25 | + | activity | page | |
| 26 | + | course | C1 | |
| 27 | + | idnumber | page1 | |
| 28 | + | name | Music history | |
| 29 | + | intro | A lesson learned in life | |
| 30 | + | completion | 2 | |
| 31 | + | completionview | 1 | |
| 32 | + When I entered the course "Course 1" as "teacher1" in the app |
| 33 | + And I press "Completion" within "Music history" "ion-card" in the app |
| 34 | + Then I should not find "To do:" in the app |
| 35 | + And I should find "View" in the app |
| 36 | + When I close the popup in the app |
| 37 | + And I press "Music history" in the app |
| 38 | + Then the header should be "Music history" in the app |
| 39 | + When I press "Completion" in the app |
| 40 | + Then I should not find "To do:" in the app |
| 41 | + And I should find "View" in the app |
| 42 | + |
| 43 | + Scenario: A student can complete a page resource by viewing it |
| 44 | + Given the following "activity" exists: |
| 45 | + | activity | page | |
| 46 | + | course | C1 | |
| 47 | + | idnumber | page1 | |
| 48 | + | name | Music history | |
| 49 | + | intro | A lesson learned in life | |
| 50 | + | completion | 2 | |
| 51 | + | completionview | 1 | |
| 52 | + When I entered the course "Course 1" as "student1" in the app |
| 53 | + And I press "To do" within "Music history" "ion-card" in the app |
| 54 | + Then I should find "To do:" in the app |
| 55 | + And I should find "View" in the app |
| 56 | + When I close the popup in the app |
| 57 | + And I press "Music history" in the app |
| 58 | + Then the header should be "Music history" in the app |
| 59 | + When I press "Done" in the app |
| 60 | + Then I should find "Done:" in the app |
| 61 | + And I should find "View" in the app |
| 62 | + When I close the popup in the app |
| 63 | + And I go back in the app |
| 64 | + And I press "Done" within "Music history" "ion-card" in the app |
| 65 | + Then I should find "Done:" in the app |
| 66 | + And I should find "View" in the app |
| 67 | + |
| 68 | + Scenario: A teacher cannot manually mark the page activity as done |
| 69 | + Given the following "activity" exists: |
| 70 | + | activity | page | |
| 71 | + | course | C1 | |
| 72 | + | idnumber | page1 | |
| 73 | + | name | Music history | |
| 74 | + | intro | A lesson learned in life | |
| 75 | + | completion | 1 | |
| 76 | + When I entered the course "Course 1" as "teacher1" in the app |
| 77 | + Then I should find "Mark as done" in the app |
| 78 | + When I press "Music history" in the app |
| 79 | + Then the header should be "Music history" in the app |
| 80 | + And I should find "Mark as done" in the app |
| 81 | + But I should not be able to press "Mark as done" in the app |
| 82 | + |
| 83 | + Scenario: A student can manually mark the page activity as done |
| 84 | + Given the following "activity" exists: |
| 85 | + | activity | page | |
| 86 | + | course | C1 | |
| 87 | + | idnumber | page1 | |
| 88 | + | name | Music history | |
| 89 | + | intro | A lesson learned in life | |
| 90 | + | completion | 1 | |
| 91 | + When I entered the course "Course 1" as "student1" in the app |
| 92 | + And I press "Mark as done" within "Music history" "ion-card" in the app |
| 93 | + Then I should find "Done" in the app |
| 94 | + When I press "Done" within "Music history" "ion-card" in the app |
| 95 | + Then I should find "Mark as done" in the app |
| 96 | + When I press "Music history" in the app |
| 97 | + Then the header should be "Music history" in the app |
| 98 | + When I press "Mark as done" in the app |
| 99 | + Then I should find "Done" in the app |
| 100 | + When I press "Done" in the app |
| 101 | + Then I should find "Mark as done" in the app |
| 102 | + |
| 103 | + Scenario: The manual completion button will not be shown on the course page if the Show activity completion conditions is set to No as teacher |
| 104 | + Given the following "activity" exists: |
| 105 | + | activity | page | |
| 106 | + | course | C2 | |
| 107 | + | idnumber | page1 | |
| 108 | + | name | Music history | |
| 109 | + | intro | A lesson learned in life | |
| 110 | + | completion | 1 | |
| 111 | + When I entered the course "Course 2" as "teacher1" in the app |
| 112 | + Then I should not find "Mark as done" in the app |
| 113 | + When I press "Music history" in the app |
| 114 | + Then the header should be "Music history" in the app |
| 115 | + And I should find "Mark as done" in the app |
| 116 | + |
| 117 | + Scenario: The manual completion button will not be shown on the course page if the Show activity completion conditions is set to No as student |
| 118 | + Given the following "activity" exists: |
| 119 | + | activity | page | |
| 120 | + | course | C2 | |
| 121 | + | idnumber | page1 | |
| 122 | + | name | Music history | |
| 123 | + | intro | A lesson learned in life | |
| 124 | + | completion | 1 | |
| 125 | + When I entered the course "Course 2" as "student1" in the app |
| 126 | + Then I should not find "Mark as done" in the app |
| 127 | + When I press "Music history" in the app |
| 128 | + Then the header should be "Music history" in the app |
| 129 | + And I should find "Mark as done" in the app |
0 commit comments