|
| 1 | +@mod @mod_choice @app @javascript |
| 2 | +Feature: Test basic usage in app |
| 3 | + In order to participate in the choice while using the mobile app |
| 4 | + As a student |
| 5 | + I need basic choice functionality to work |
| 6 | + |
| 7 | + Background: |
| 8 | + Given the following "courses" exist: |
| 9 | + | fullname | shortname | |
| 10 | + | Course 1 | C1 | |
| 11 | + And the following "users" exist: |
| 12 | + | username | |
| 13 | + | teacher1 | |
| 14 | + | student1 | |
| 15 | + And the following "course enrolments" exist: |
| 16 | + | user | course | role | |
| 17 | + | teacher1 | C1 | editingteacher | |
| 18 | + | student1 | C1 | student | |
| 19 | + |
| 20 | + Scenario: Student sends their single choice |
| 21 | + Given the following "activities" exist: |
| 22 | + | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | |
| 23 | + | choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 | |
| 24 | + When I enter the app |
| 25 | + And I log in as "student1" |
| 26 | + And I press "Course 1" near "Course overview" in the app |
| 27 | + And I press "Test single choice name" in the app |
| 28 | + And I press "Option 1" in the app |
| 29 | + And I press "Option 2" in the app |
| 30 | + And I press "Save my choice" in the app |
| 31 | + And I should see "Are you sure" |
| 32 | + And I press "OK" in the app |
| 33 | + Then I should see "Option 1: 0" |
| 34 | + And I should see "Option 2: 1" |
| 35 | + And I should see "Option 3: 0" |
| 36 | + And I should not see "Remove my choice" |
| 37 | + |
| 38 | + Scenario: Student sends, changes and remove their multi choice |
| 39 | + Given the following "activities" exist: |
| 40 | + | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | |
| 41 | + | choice | Test multi choice name | Test multi choice description | C1 | choice2 | Option 1, Option 2, Option 3 | 1 | 1 | 1 | |
| 42 | + When I enter the app |
| 43 | + And I log in as "student1" |
| 44 | + And I press "Course 1" near "Course overview" in the app |
| 45 | + And I press "Test multi choice name" in the app |
| 46 | + And I press "Option 1" in the app |
| 47 | + And I press "Option 2" in the app |
| 48 | + And I press "Save my choice" in the app |
| 49 | + Then I should see "Option 1: 1" |
| 50 | + And I should see "Option 2: 1" |
| 51 | + And I should see "Option 3: 0" |
| 52 | + And I should see "Remove my choice" |
| 53 | + And I press "Option 1" in the app |
| 54 | + And I press "Option 3" in the app |
| 55 | + And I press "Save my choice" in the app |
| 56 | + And I should see "Option 1: 0" |
| 57 | + And I should see "Option 2: 1" |
| 58 | + And I should see "Option 3: 1" |
| 59 | + And I press "Remove my choice" in the app |
| 60 | + And I should see "Are you sure" |
| 61 | + And I press "OK" in the app |
| 62 | + And I should not see "Remove my choice" |
| 63 | + And I should see "The results are not currently viewable" |
0 commit comments