|
2 | 2 | Feature: Use moodleoverflow anonymously |
3 | 3 |
|
4 | 4 | Background: |
5 | | - Given the following "users" exist: |
6 | | - | username | firstname | lastname | email | |
7 | | - | teacher1 | Teacher | 1 | teacher1@example.com | |
8 | | - | student1 | Student | 1 | student1@example.com | |
9 | | - And the following "courses" exist: |
10 | | - | fullname | shortname | category | |
11 | | - | Course 1 | C1 | 0 | |
12 | | - And the following "course enrolments" exist: |
13 | | - | user | course | role | |
14 | | - | teacher1 | C1 | editingteacher | |
15 | | - | student1 | C1 | student | |
| 5 | + Given I prepare a moodleoverflow feature background with users: |
| 6 | + | username | firstname | lastname | email | idnumber | role | |
| 7 | + | student1 | Student | 1 | student1@mail.com | 10 | student | |
| 8 | + | teacher1 | Teacher | 1 | teacher1@mail.com | 11 | editingteacher | |
16 | 9 | And the following "activity" exists: |
17 | | - | activity | moodleoverflow | |
18 | | - | course | C1 | |
19 | | - | name | Test moodleoverflow name | |
20 | | - | anonymous | 2 | |
| 10 | + | activity | moodleoverflow | |
| 11 | + | course | C1 | |
| 12 | + | name | Test moodleoverflow | |
| 13 | + | anonymous | 2 | |
21 | 14 |
|
22 | 15 | @_file_upload |
23 | 16 | Scenario: Other people should not see the questioners name in anonymous mode, not even as file author. |
24 | | - Given I am on the "Test moodleoverflow name" "Activity" page logged in as "student1" |
| 17 | + Given I navigate as "student1" to "Course 1" "Test moodleoverflow" "" |
25 | 18 | And I press "Add a new discussion topic" |
26 | 19 | And I set the following fields to these values: |
27 | 20 | | Subject | This is Nina | |
28 | 21 | | Message | She is nice. | |
29 | 22 | And I upload "mod/moodleoverflow/tests/fixtures/NH.jpg" file to "Attachment" filemanager |
30 | 23 | And I press "Post to forum" |
31 | 24 | Then I should see "Anonymous (You)" |
32 | | - When I am on the "Test moodleoverflow name" "Activity" page logged in as "teacher1" |
| 25 | + When I navigate as "teacher1" to "Course 1" "Test moodleoverflow" "" |
33 | 26 | And I follow "This is Nina" |
34 | 27 | Then I should not see "Student 1" |
35 | 28 | And I should see "Questioner" |
36 | | - Given I follow "Edit" |
37 | | - And I click on "NH.jpg" "link" |
| 29 | + When I click in moodleoverflow on "link" type: |
| 30 | + | Edit | NH.jpg | |
38 | 31 | Then the field "Author" matches value "Anonymous" |
0 commit comments