This commit is contained in:
Dan Poltawski 2016-03-22 13:51:34 +08:00
commit ae0af5491b

View File

@ -56,149 +56,150 @@ Feature: View course participants
@javascript
Scenario: Use select and deselect all buttons
When I log in as "teacher1"
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Participants"
And I press "Select all"
When I press "Select all"
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
And I press "Deselect all"
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
@javascript
Scenario: Use select all users on this page, select all n users and deselect all
And the following "course enrolments" exist:
Given the following "course enrolments" exist:
| user | course | role |
| student20 | C1 | student |
When I log in as "teacher1"
And I follow "Course 1"
And I follow "Participants"
And I follow "Surname"
And I press "Select all users on this page"
Then I should not see "Student 11"
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
Then I should not see "Student 9"
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
And I press "Deselect all"
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
And I press "Select all 21 users"
Then I should see "Student 11"
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
Then the field with xpath "//tbody//tr[21]//input[@class='usercheckbox']" matches value "1"
And I should see "Student 9"
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "1"
And the field with xpath "//tbody//tr[21]//input[@class='usercheckbox']" matches value "1"
And I press "Deselect all"
Then the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
Then the field with xpath "//tbody//tr[21]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[1]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[2]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[3]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[4]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[5]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[6]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[7]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[8]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[9]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[10]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[11]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[12]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[13]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[14]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[15]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[16]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[17]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[18]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[19]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[20]//input[@class='usercheckbox']" matches value "0"
And the field with xpath "//tbody//tr[21]//input[@class='usercheckbox']" matches value "0"