1 |
efrain |
1 |
@core @core_user
|
|
|
2 |
Feature: Users' names are displayed across the site according to the user policy settings
|
|
|
3 |
In order to control the way students and teachers see users' names
|
|
|
4 |
As a teacher or admin
|
|
|
5 |
I need to be able to configure the name display formats 'fullnamedisplay' and 'alternativefullnameformat'
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | middlename | alternatename | firstnamephonetic | lastnamephonetic |
|
|
|
10 |
| user1 | Grainne | Beauchamp | one@example.com | Ann | Jill | Gronya | Beecham |
|
|
|
11 |
| user2 | Niamh | Cholmondely | two@example.com | Jane | Nina | Nee | Chumlee |
|
|
|
12 |
| user3 | Siobhan | Desforges | three@example.com | Sarah | Sev | Shevon | De-forjay |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com | | | | |
|
|
|
14 |
And the following "courses" exist:
|
|
|
15 |
| fullname | shortname | format |
|
|
|
16 |
| Course 1 | C1 | topics |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
| user1 | C1 | student |
|
|
|
21 |
| user2 | C1 | student |
|
|
|
22 |
And the following config values are set as admin:
|
|
|
23 |
| fullnamedisplay | firstnamephonetic,lastnamephonetic |
|
|
|
24 |
| alternativefullnameformat | middlename, alternatename, firstname, lastname |
|
|
|
25 |
|
|
|
26 |
Scenario: As a student, 'fullnamedisplay' should be used in the participants list and when viewing my own course profile
|
|
|
27 |
Given I log in as "user1"
|
|
|
28 |
And I am on "Course 1" course homepage
|
|
|
29 |
When I navigate to course participants
|
|
|
30 |
And I click on "Gronya,Beecham" "link" in the "Gronya,Beecham" "table_row"
|
|
|
31 |
Then I should see "Gronya,Beecham" in the "region-main" "region"
|
|
|
32 |
And I log out
|
|
|
33 |
|
|
|
34 |
Scenario: As a student, 'fullnamedisplay' should be used in the participants list and when viewing another user's course profile
|
|
|
35 |
Given I log in as "user2"
|
|
|
36 |
And I am on "Course 1" course homepage
|
|
|
37 |
When I navigate to course participants
|
|
|
38 |
And I click on "Gronya,Beecham" "link" in the "Gronya,Beecham" "table_row"
|
|
|
39 |
Then I should see "Gronya,Beecham" in the "region-main" "region"
|
|
|
40 |
And I log out
|
|
|
41 |
|
|
|
42 |
Scenario: As a teacher, 'alternativefullnameformat' should be used in the participants list but 'fullnamedisplay' used on the course profile
|
|
|
43 |
Given I log in as "teacher1"
|
|
|
44 |
And I am on "Course 1" course homepage
|
|
|
45 |
When I navigate to course participants
|
|
|
46 |
Then I should see "Ann, Jill, Grainne, Beauchamp" in the "Ann, Jill, Grainne, Beauchamp" "table_row"
|
|
|
47 |
And I click on "Ann, Jill, Grainne, Beauchamp" "link" in the "Ann, Jill, Grainne, Beauchamp" "table_row"
|
|
|
48 |
And I should see "Gronya,Beecham" in the "region-main" "region"
|
|
|
49 |
And I log out
|
|
|
50 |
|
|
|
51 |
Scenario: As an authenticated user, 'fullnamedisplay' should be used in the navigation and when viewing my profile
|
|
|
52 |
Given I log in as "user1"
|
|
|
53 |
When I follow "Profile" in the user menu
|
|
|
54 |
Then I should see "Gronya,Beecham" in the ".page-context-header" "css_element"
|
|
|
55 |
And I should see "You are logged in as Gronya,Beecham" in the "page-footer" "region"
|
|
|
56 |
And I log out
|
|
|
57 |
|
|
|
58 |
Scenario: As an admin, 'fullnamedisplay' should be used when using the 'log in as' function
|
|
|
59 |
Given I log in as "admin"
|
|
|
60 |
When I navigate to "Users > Accounts > Browse list of users" in site administration
|
|
|
61 |
And I follow "Jane, Nina, Niamh, Cholmondely"
|
|
|
62 |
And I follow "Log in as"
|
|
|
63 |
Then I should see "You are logged in as Nee,Chumlee" in the ".usermenu" "css_element"
|
|
|
64 |
And I should see "You are logged in as Jane, Nina, Niamh, Cholmondely" in the "region-main" "region"
|
|
|
65 |
And I should see "You are logged in as Nee,Chumlee" in the "page-footer" "region"
|
|
|
66 |
And I log out
|
|
|
67 |
|
|
|
68 |
Scenario: As an admin, 'fullnamedisplay' should be used when viewing another user's site profile
|
|
|
69 |
Given I log in as "admin"
|
|
|
70 |
When I navigate to "Users > Accounts > Browse list of users" in site administration
|
|
|
71 |
And I follow "Ann, Jill, Grainne, Beauchamp"
|
|
|
72 |
Then I should see "Gronya,Beecham" in the ".page-header-headings" "css_element"
|
|
|
73 |
And I log out
|
|
|
74 |
|
|
|
75 |
@javascript
|
|
|
76 |
Scenario: As a teacher, the 'alternativefullnameformat' should be used when searching for and enrolling a user
|
|
|
77 |
Given I log in as "teacher1"
|
|
|
78 |
And I am on "Course 1" course homepage
|
|
|
79 |
When I navigate to course participants
|
|
|
80 |
And I press "Enrol users"
|
|
|
81 |
And I click on "Select users" "field"
|
|
|
82 |
And I type "three@example.com"
|
|
|
83 |
Then I should see "Sarah, Sev, Siobhan, Desforges"
|