weekly release 5.0dev
[moodle.git] / user / tests / behat / table_sorting.feature
blob1626c812627cc0272d0503e89b1e39ba8b87f858
1 @core @core_user
2 Feature: Tables can be sorted by additional names
3   In order to sort fields by additional names
4   As a user
5   I need to browse to a page with users in a table.
7   Background:
8     Given the following "users" exist:
9     | username | firstname | lastname | middlename | alternatename | email | idnumber |
10     | student1 | Annie | Edison | Faith | Anne | student1@example.com | s1 |
11     | student2 | George | Bradley | David | Gman | student2@example.com | s2 |
12     | student3 | Travis | Sutcliff | Peter | Mr T | student3@example.com | s3 |
13     And I log in as "admin"
14     And I navigate to "Users > Permissions > User policies" in site administration
15     And the following config values are set as admin:
16     | fullnamedisplay | firstname middlename lastname |
17     | alternativefullnameformat | firstname middlename alternatename lastname |
19   @javascript
20   Scenario: All user names are show and sortable in the administration user list.
21     Given I navigate to "Users > Accounts > Browse list of users" in site administration
22     Then the following should exist in the "reportbuilder-table" table:
23     | First name | Email address |
24     | Admin User | moodle@example.com |
25     | Annie Faith Anne Edison | student1@example.com |
26     | George David Gman Bradley | student2@example.com |
27     | Travis Peter Mr T Sutcliff | student3@example.com |
28     And "Annie Faith Anne Edison" "table_row" should appear before "George David Gman Bradley" "table_row"
29     And "George David Gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
30     And I follow "Middle name"
31     And "George David Gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
32     And "Annie Faith Anne Edison" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
33     And I follow "Middle name"
34     And "George David Gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
35     And "Annie Faith Anne Edison" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
36     And I follow "Alternate name"
37     And "Annie Faith Anne Edison" "table_row" should appear after "George David Gman Bradley" "table_row"
38     And "George David Gman Bradley" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
39     And I follow "Alternate name"
40     And "Annie Faith Anne Edison" "table_row" should appear before "George David Gman Bradley" "table_row"
41     And "George David Gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
42     And I follow "Last name"
43     And "George David Gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
44     And "Annie Faith Anne Edison" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
45     And I follow "Last name"
46     And "George David Gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
47     And "Annie Faith Anne Edison" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"