Skip to content

Commit

Permalink
MDL-47617 behat: Fixed behat sorting failure
Browse files Browse the repository at this point in the history
Postgres and MySQL treat values that are null differently
when sorting. MySQL will sort null values above fields with
values and Postgres will be vice versa. I removed the checks
against the Admin User.

Oracle treats lower case values different to upper case values
and so I have modified the test so that all Names start with
an Uppercase letter.
  • Loading branch information
abgreeve committed Oct 14, 2014
1 parent d3ff822 commit c1a2702
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions user/tests/behat/table_sorting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Tables can be sorted by additional names
Given the following "users" exist:
| username | firstname | lastname | middlename | alternatename | email | idnumber |
| student1 | Annie | Edison | Faith | Anne | student1@mail.com | s1 |
| student2 | George | Bradley | David | gman | student2@mail.com | s2 |
| student2 | George | Bradley | David | Gman | student2@mail.com | s2 |
| student3 | Travis | Sutcliff | Peter | Mr T | student3@mail.com | s3 |
And I log in as "admin"
And I navigate to "User policies" node in "Site administration > Users > Permissions"
Expand All @@ -19,37 +19,29 @@ Feature: Tables can be sorted by additional names
@javascript
Scenario: All user names are show and sortable in the administration user list.
Given I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
# And I should see "First name / Middle name / Alternate name / Surname"
Then the following should exist in the "users" table:
| First name / Middle name / Alternate name / Surname | Email address |
| Admin User | moodle@moodlemoodle.com |
| Annie Faith Anne Edison | student1@mail.com |
| George David gman Bradley | student2@mail.com |
| George David Gman Bradley | student2@mail.com |
| Travis Peter Mr T Sutcliff | student3@mail.com |
And "Admin User" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "George David gman Bradley" "table_row"
And "George David gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "George David Gman Bradley" "table_row"
And "George David Gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And I follow "Middle name"
And "George David gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "George David Gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear before "Admin User" "table_row"
And I follow "Middle name"
And "George David gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
And "George David Gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear after "Admin User" "table_row"
And I follow "Alternate name"
And "Annie Faith Anne Edison" "table_row" should appear before "George David gman Bradley" "table_row"
And "George David gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear before "Admin User" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "George David Gman Bradley" "table_row"
And "George David Gman Bradley" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And I follow "Alternate name"
And "Annie Faith Anne Edison" "table_row" should appear after "George David gman Bradley" "table_row"
And "George David gman Bradley" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear after "Admin User" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear after "George David Gman Bradley" "table_row"
And "George David Gman Bradley" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And I follow "Surname"
And "George David gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "George David Gman Bradley" "table_row" should appear before "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear before "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear before "Admin User" "table_row"
And I follow "Surname"
And "George David gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
And "George David Gman Bradley" "table_row" should appear after "Annie Faith Anne Edison" "table_row"
And "Annie Faith Anne Edison" "table_row" should appear after "Travis Peter Mr T Sutcliff" "table_row"
And "Travis Peter Mr T Sutcliff" "table_row" should appear after "Admin User" "table_row"

0 comments on commit c1a2702

Please sign in to comment.