Skip to content

Commit

Permalink
MDL-63379 user: Fix Behat tests for participants filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Sep 17, 2018
1 parent 674ef9b commit 8420b61
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions user/tests/behat/filter_participants.feature
Original file line number Diff line number Diff line change
Expand Up @@ -166,32 +166,33 @@ Feature: Course participants can be filtered
And I should not see "Student 2" in the "participants" "table"
And I should not see "Teacher 1" in the "participants" "table"
# Search by idnumber (only).
Given I click on ".tag[data-value='[email protected]']" "css_element"
When I set the field "Filters" to "SID"
And I click on "[email protected]" "text" in the ".form-autocomplete-selection" "css_element"
And I set the field "Filters" to "SID"
And I press key "13" in the field "Filters"
Then I should see "Student 1" in the "participants" "table"
And I should see "Student 1" in the "participants" "table"
And I should see "Student 2" in the "participants" "table"
And I should see "Student 3" in the "participants" "table"
And I should see "Student 4" in the "participants" "table"
And I should not see "Teacher 1" in the "participants" "table"
# Search by city (only).
Given I click on ".tag[data-value='SID']" "css_element"
When I set the field "Filters" to "SCITY"
And I click on "SID" "text" in the ".form-autocomplete-selection" "css_element"
And I set the field "Filters" to "SCITY"
And I press key "13" in the field "Filters"
Then I should see "Student 1" in the "participants" "table"
And I should see "Student 1" in the "participants" "table"
And I should see "Student 2" in the "participants" "table"
And I should see "Student 3" in the "participants" "table"
And I should see "Student 4" in the "participants" "table"
And I should not see "Teacher 1" in the "participants" "table"
# Search by country text (only) - should not match.
Given I click on ".tag[data-value='SCITY']" "css_element"
When I set the field "Filters" to "GB"
And I click on "SCITY" "text" in the ".form-autocomplete-selection" "css_element"
And I set the field "Filters" to "GB"
And I press key "13" in the field "Filters"
Then I should see "Nothing to display"
And I should see "Nothing to display"
# Check no match.
Given I set the field "Filters" to "NOTHING"
When I press key "13" in the field "Filters"
Then I should see "Nothing to display"
And I click on "GB" "text" in the ".form-autocomplete-selection" "css_element"
And I set the field "Filters" to "NOTHING"
And I press key "13" in the field "Filters"
And I should see "Nothing to display"

@javascript
Scenario: Filter by user identity fields when cannot see the field data
Expand All @@ -213,19 +214,19 @@ Feature: Course participants can be filtered
And I should not see "Student 4" in the "participants" "table"
And I should see "Teacher 1" in the "participants" "table"
# Search for other fields - should only see own results.
Given I click on ".tag[data-value='@example.com']" "css_element"
When I set the field "Filters" to "SID"
And I click on "@example.com" "text" in the ".form-autocomplete-selection" "css_element"
And I set the field "Filters" to "SID"
And I press key "13" in the field "Filters"
Then I should see "Nothing to display"
Given I click on ".tag[data-value='SID']" "css_element"
When I set the field "Filters" to "TID"
And I should see "Nothing to display"
And I click on "SID" "text" in the ".form-autocomplete-selection" "css_element"
And I set the field "Filters" to "TID"
And I press key "13" in the field "Filters"
Then I should see "Teacher 1" in the "participants" "table"
Given I set the field "Filters" to "CITY"
When I press key "13" in the field "Filters"
Then I should see "Teacher 1" in the "participants" "table"
And I should see "Teacher 1" in the "participants" "table"
And I set the field "Filters" to "CITY"
And I press key "13" in the field "Filters"
And I should see "Teacher 1" in the "participants" "table"
And I should not see "Student 1" in the "participants" "table"
# Check no match.
Given I set the field "Filters" to "NOTHING"
When I press key "13" in the field "Filters"
Then I should see "Nothing to display"
And I set the field "Filters" to "NOTHING"
And I press key "13" in the field "Filters"
And I should see "Nothing to display"

0 comments on commit 8420b61

Please sign in to comment.