1 |
efrain |
1 |
@mod @mod_choice
|
|
|
2 |
Feature: Test the display of the choice module on my home
|
|
|
3 |
In order to know my status in a choice activity
|
|
|
4 |
As a user
|
|
|
5 |
I need to see it in My dashboard.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | intro | course | idnumber | option | section |
|
|
|
21 |
| choice | Test choice name | Test choice description | C1 | choice1 | Option 1, Option 2 | 1 |
|
|
|
22 |
And I log in as "teacher1"
|
|
|
23 |
And I am on "Course 1" course homepage
|
|
|
24 |
And I follow "Test choice name"
|
|
|
25 |
And I navigate to "Settings" in current page administration
|
|
|
26 |
And I set the following fields to these values:
|
|
|
27 |
| timeopen[enabled] | 1 |
|
|
|
28 |
| timeclose[enabled] | 1 |
|
|
|
29 |
| timeclose[day] | 1 |
|
|
|
30 |
| timeclose[month] | January |
|
|
|
31 |
| timeclose[year] | 2030 |
|
|
|
32 |
| timeclose[hour] | 08 |
|
|
|
33 |
| timeclose[minute] | 00 |
|
|
|
34 |
| Allow choice to be updated | No |
|
|
|
35 |
And I press "Save and return to course"
|
|
|
36 |
And I log out
|
|
|
37 |
|
|
|
38 |
Scenario: View my home as a student after answering the choice
|
|
|
39 |
Given I log in as "student1"
|
|
|
40 |
And I am on "Course 1" course homepage
|
|
|
41 |
And I choose "Option 1" from "Test choice name" choice activity
|
|
|
42 |
And I should see "Your selection: Option 1"
|
|
|
43 |
And I should see "Your choice has been saved"
|
|
|
44 |
And "Save my choice" "button" should not exist
|
|
|
45 |
And I log out
|
|
|
46 |
|
|
|
47 |
Scenario: View my home as a teacher
|
|
|
48 |
Given I log in as "student1"
|
|
|
49 |
And I am on "Course 1" course homepage
|
|
|
50 |
And I choose "Option 1" from "Test choice name" choice activity
|
|
|
51 |
And I should see "Your selection: Option 1"
|
|
|
52 |
And I should see "Your choice has been saved"
|
|
|
53 |
And "Save my choice" "button" should not exist
|
|
|
54 |
And I log out
|