MDL-48035 Fix Behat tests regressions after merging en_fix strings
[moodle.git] / mod / choice / tests / behat / publish_results_anonymously.feature
CommitLineData
550d842e 1@mod @mod_choice
b7d6c485
DM
2Feature: A teacher can choose whether to publish choice activity results anonymously or showing names
3 In order to keep students privacy or to give more info to students
5d7b6307 4 As a teacher
b7d6c485
DM
5 I need to select whether I want other students to know who selected what option
6
7 Background:
759b323e 8 Given the following "users" exist:
b7d6c485
DM
9 | username | firstname | lastname | email |
10 | teacher1 | Teacher | 1 | teacher1@asd.com |
11 | student1 | Student | 1 | student1@asd.com |
12 | student2 | Student | 2 | student2@asd.com |
759b323e 13 And the following "courses" exist:
b7d6c485
DM
14 | fullname | shortname | category |
15 | Course 1 | C1 | 0 |
759b323e 16 And the following "course enrolments" exist:
b7d6c485
DM
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | student1 | C1 | student |
20 | student2 | C1 | student |
21 And I log in as "teacher1"
22 And I follow "Course 1"
23 And I turn editing mode on
24
25 @javascript
26 Scenario: Publish anonymous results
4d40089d 27 Given I add a "Choice" to section "1" and I fill the form with:
b7d6c485
DM
28 | Choice name | Choice 1 |
29 | Description | Choice Description |
30 | option[0] | Option 1 |
31 | option[1] | Option 2 |
32 | Publish results | Always show results to students |
33 | Privacy of results | Publish anonymous results, do not show student names |
34 And I log out
35 And I log in as "student1"
36 And I follow "Course 1"
37 And I choose "Option 1" from "Choice 1" choice activity
38 And I log out
39 When I log in as "student2"
40 And I follow "Course 1"
41 And I follow "Choice 1"
42 Then I should not see "Student 1"
6887e2e5 43 And I should not see "Users who chose this option"
b7d6c485
DM
44 And I hover ".results .graph img" "css_element"
45
46 @javascript
47 Scenario: Publish full results
4d40089d 48 Given I add a "Choice" to section "1" and I fill the form with:
b7d6c485
DM
49 | Choice name | Choice 1 |
50 | Description | Choice Description |
51 | option[0] | Option 1 |
52 | option[1] | Option 2 |
53 | Publish results | Always show results to students |
54 | Privacy of results | Publish full results, showing names and their choices |
55 And I log out
56 And I log in as "student1"
57 And I follow "Course 1"
58 And I choose "Option 1" from "Choice 1" choice activity
59 And I log out
60 When I log in as "student2"
61 And I follow "Course 1"
62 And I follow "Choice 1"
63 Then I should see "Student 1"
6887e2e5 64 And I should see "Users who chose this option"