|
| 1 | +@mod @mod_assign @app @javascript |
| 2 | +Feature: Test basic usage of assignment activity in app |
| 3 | + In order to participate in the assignment while using the mobile app |
| 4 | + I need basic assignment functionality to work |
| 5 | + |
| 6 | + Background: |
| 7 | + Given the following "users" exist: |
| 8 | + | username | firstname | lastname | email | |
| 9 | + | teacher1 | Teacher | teacher | teacher1@example.com | |
| 10 | + | student1 | Student | student | student1@example.com | |
| 11 | + And the following "courses" exist: |
| 12 | + | fullname | shortname | category | |
| 13 | + | Course 1 | C1 | 0 | |
| 14 | + And the following "course enrolments" exist: |
| 15 | + | user | course | role | |
| 16 | + | teacher1 | C1 | editingteacher | |
| 17 | + | student1 | C1 | student | |
| 18 | + And the following "activities" exist: |
| 19 | + | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod | |
| 20 | + | assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1029844800 | manual | |
| 21 | + |
| 22 | + @app @3.8.0 |
| 23 | + Scenario: Create, edit and submit an assignment as a student, view it as a teacher |
| 24 | + # Create, edit and submit as a student |
| 25 | + When I enter the app |
| 26 | + And I log in as "student1" |
| 27 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 28 | + And I press "assignment1" in the app |
| 29 | + Then the header should be "assignment1" in the app |
| 30 | + And I should see "Test assignment description1" |
| 31 | + And I should see "Due date" |
| 32 | + And I should see "Tuesday, 20 August 2002, 12:00 PM" |
| 33 | + |
| 34 | + When I press "Add submission" in the app |
| 35 | + And I set the field "Online text submissions" to "Submission test" in the app |
| 36 | + And I press "Save" in the app |
| 37 | + Then I should see "Draft (not submitted)" |
| 38 | + And I should see "Not graded" |
| 39 | + |
| 40 | + When I press "Edit submission" in the app |
| 41 | + And I set the field "Online text submissions" to "Submission test edited" in the app |
| 42 | + And I press "Save" in the app |
| 43 | + And I press "OK" in the app |
| 44 | + Then I should see "Submission test edited" |
| 45 | + |
| 46 | + When I press "Submit assignment" in the app |
| 47 | + And I press "OK" in the app |
| 48 | + Then I should see "Submitted for grading" |
| 49 | + And I should see "Not graded" |
| 50 | + And I should see "Submission test edited" |
| 51 | + |
| 52 | + # View as a teacher |
| 53 | + When I enter the app |
| 54 | + And I log in as "teacher1" |
| 55 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 56 | + And I press "assignment1" in the app |
| 57 | + Then the header should be "assignment1" in the app |
| 58 | + |
| 59 | + When I press "Submitted" in the app |
| 60 | + Then I should see "Student student" |
| 61 | + And I should see "Not graded" |
| 62 | + |
| 63 | + When I press "Student student" near "assignment1" in the app |
| 64 | + Then I should see "Online text submissions" |
| 65 | + And I should see "Submission test edited" |
| 66 | + |
| 67 | + @app @3.8.0 |
| 68 | + Scenario: Add new attempt from previous submission |
| 69 | + # Submit first attempt as a student |
| 70 | + Given I enter the app |
| 71 | + And I log in as "student1" |
| 72 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 73 | + And I press "assignment1" in the app |
| 74 | + And I press "Add submission" in the app |
| 75 | + And I set the field "Online text submissions" to "Submission test 1st attempt" in the app |
| 76 | + And I press "Save" in the app |
| 77 | + And I press "Submit assignment" in the app |
| 78 | + And I press "OK" in the app |
| 79 | + |
| 80 | + # Allow more attempts as a teacher |
| 81 | + When I enter the app |
| 82 | + And I log in as "teacher1" |
| 83 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 84 | + And I press "assignment1" in the app |
| 85 | + And I press "Participants" in the app |
| 86 | + And I press "Student student" near "assignment1" in the app |
| 87 | + And I press "Grade" in the app |
| 88 | + And I press "Allow another attempt" in the app |
| 89 | + And I press "Done" |
| 90 | + Then I should see "Reopened" |
| 91 | + And I should see "Not graded" |
| 92 | + |
| 93 | + # Submit second attempt as a student |
| 94 | + When I enter the app |
| 95 | + And I log in as "student1" |
| 96 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 97 | + And I press "assignment1" in the app |
| 98 | + Then I should see "Reopened" |
| 99 | + And I should see "2 out of Unlimited" |
| 100 | + And I should see "Add a new attempt based on previous submission" |
| 101 | + And I should see "Add a new attempt" |
| 102 | + |
| 103 | + When I press "Add a new attempt based on previous submission" in the app |
| 104 | + And I press "OK" in the app |
| 105 | + Then I should see "Submission test 1st attempt" |
| 106 | + |
| 107 | + When I set the field "Online text submissions" to "Submission test 2nd attempt" in the app |
| 108 | + And I press "Save" in the app |
| 109 | + And I press "OK" in the app |
| 110 | + And I press "Submit assignment" in the app |
| 111 | + And I press "OK" in the app |
| 112 | + |
| 113 | + # View second attempt as a teacher |
| 114 | + When I enter the app |
| 115 | + And I log in as "teacher1" |
| 116 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 117 | + And I press "assignment1" in the app |
| 118 | + And I press "Participants" in the app |
| 119 | + And I press "Student student" near "assignment1" in the app |
| 120 | + Then I should see "Online text submissions" |
| 121 | + And I should see "Submission test 2nd attempt" |
| 122 | + |
| 123 | + @app @3.8.0 |
| 124 | + Scenario: Add offline submission and synchronise it |
| 125 | + When I enter the app |
| 126 | + And I log in as "student1" |
| 127 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 128 | + And I press "assignment1" in the app |
| 129 | + And I press "Add submission" in the app |
| 130 | + And I switch offline mode to "true" |
| 131 | + And I set the field "Online text submissions" to "Submission test" in the app |
| 132 | + And I press "Save" in the app |
| 133 | + And I press "Submit assignment" in the app |
| 134 | + And I press "OK" in the app |
| 135 | + Then I should see "This Assignment has offline data to be synchronised." |
| 136 | + |
| 137 | + When I switch offline mode to "false" |
| 138 | + And I press the back button in the app |
| 139 | + And I press "assignment1" in the app |
| 140 | + And I press "Display options" in the app |
| 141 | + And I press "Refresh" in the app |
| 142 | + Then I should see "Submitted for grading" |
| 143 | + But I should not see "This Assignment has offline data to be synchronised." |
| 144 | + |
| 145 | + @app @3.8.0 |
| 146 | + Scenario: Edit an offline submission before synchronising it |
| 147 | + When I enter the app |
| 148 | + And I log in as "student1" |
| 149 | + And I press "Course 1" near "Recently accessed courses" in the app |
| 150 | + And I press "assignment1" in the app |
| 151 | + And I press "Add submission" in the app |
| 152 | + And I switch offline mode to "true" |
| 153 | + And I set the field "Online text submissions" to "Submission test original offline" in the app |
| 154 | + And I press "Save" in the app |
| 155 | + Then I should see "This Assignment has offline data to be synchronised." |
| 156 | + And I should see "Submission test original offline" |
| 157 | + |
| 158 | + When I press "Edit submission" in the app |
| 159 | + And I set the field "Online text submissions" to "Submission test edited offline" in the app |
| 160 | + And I press "Save" in the app |
| 161 | + Then I should see "This Assignment has offline data to be synchronised." |
| 162 | + And I should see "Submission test edited offline" |
| 163 | + But I should not see "Submission test original offline" |
| 164 | + |
| 165 | + When I press "Submit assignment" in the app |
| 166 | + And I press "OK" in the app |
| 167 | + Then I should see "This Assignment has offline data to be synchronised." |
| 168 | + |
| 169 | + When I switch offline mode to "false" |
| 170 | + And I press the back button in the app |
| 171 | + And I press "assignment1" in the app |
| 172 | + Then I should see "Submitted for grading" |
| 173 | + And I should see "Submission test edited offline" |
| 174 | + But I should not see "This Assignment has offline data to be synchronised." |
0 commit comments