Browse Source

tidy up some more spacing in tests.

MOODLE_33_STABLE
Dan Marsden 8 years ago
parent
commit
eb50cadda0
  1. 118
      tests/behat/attendance_mod.feature
  2. 58
      tests/behat/preferences.feature
  3. 416
      tests/behat/report.feature

118
tests/behat/attendance_mod.feature

@ -37,66 +37,66 @@ Feature: Teachers and Students can record session attendance
And I should see "Attendance" And I should see "Attendance"
And I log out And I log out
Scenario: Students can mark their own attendance Scenario: Students can mark their own attendance
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Add" And I follow "Add"
And I set the field "Allow students to record own attendance" to "1" And I set the field "Allow students to record own attendance" to "1"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 22 | | id_sestime_starthour | 22 |
| id_sestime_endhour | 23 | | id_sestime_endhour | 23 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
And I log out And I log out
And I log in as "student1" And I log in as "student1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Submit attendance" And I follow "Submit attendance"
And I set the field "Present" to "1" And I set the field "Present" to "1"
And I press "Save changes" And I press "Save changes"
And I should see "Self-recorded" And I should see "Self-recorded"
And I log out And I log out
When I log in as "teacher1" When I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I expand "Reports" node And I expand "Reports" node
And I follow "Logs" And I follow "Logs"
And I click on "Get these logs" "button" And I click on "Get these logs" "button"
Then "Attendance taken by student" "link" should exist Then "Attendance taken by student" "link" should exist
Scenario: Teachers can view low grade report and send a message Scenario: Teachers can view low grade report and send a message
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Add" And I follow "Add"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 01 | | id_sestime_starthour | 01 |
| id_sestime_endhour | 02 | | id_sestime_endhour | 02 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
And I follow "Report" And I follow "Report"
And I follow "Low grade" And I follow "Low grade"
And I set the field "cb_selector" to "1" And I set the field "cb_selector" to "1"
And I click on "Send a message" "button" And I click on "Send a message" "button"
And I should see "Message body" And I should see "Message body"
And I should see "student1@asd.com" And I should see "student1@asd.com"
And I follow "Course 1" And I follow "Course 1"
And I expand "Reports" node And I expand "Reports" node
And I follow "Logs" And I follow "Logs"
And I click on "Get these logs" "button" And I click on "Get these logs" "button"
Then "Attendance report viewed" "link" should exist Then "Attendance report viewed" "link" should exist
Scenario: Export report includes id number, department and institution Scenario: Export report includes id number, department and institution
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Add" And I follow "Add"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 01 | | id_sestime_starthour | 01 |
| id_sestime_endhour | 02 | | id_sestime_endhour | 02 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
And I follow "Export" And I follow "Export"
Then the field "id_ident_idnumber" matches value "" Then the field "id_ident_idnumber" matches value ""
And the field "id_ident_institution" matches value "" And the field "id_ident_institution" matches value ""
And the field "id_ident_department" matches value "" And the field "id_ident_department" matches value ""
# Removed dependency on behat_download to allow automated Travis CI tests to pass. # Removed dependency on behat_download to allow automated Travis CI tests to pass.
# It would be good to add these back at some point. # It would be good to add these back at some point.

58
tests/behat/preferences.feature

@ -24,33 +24,33 @@ Feature: Teachers can't change status variables to have empty acronyms or descri
And I follow "Attendancepreftest" And I follow "Attendancepreftest"
And I follow "Status set" And I follow "Status set"
@javascript @javascript
Scenario: Teachers can add status variables Scenario: Teachers can add status variables
# Set the second status acronym to be empty # Set the second status acronym to be empty
Given I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[2]/input" to "" Given I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[2]/input" to ""
# Set the second status description to be empty # Set the second status description to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" to ""
# Set the second status grade to be empty # Set the second status grade to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[4]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[4]/input" to ""
When I click on "Update" "button" in the "#preferencesform" "css_element" When I click on "Update" "button" in the "#preferencesform" "css_element"
Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[2]/td[2]/p" "xpath_element" Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[2]/td[2]/p" "xpath_element"
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/p" "xpath_element" And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/p" "xpath_element"
And I click on "Update" "button" in the "#preferencesform" "css_element" And I click on "Update" "button" in the "#preferencesform" "css_element"
# Set the first status acronym to be empty # Set the first status acronym to be empty
Given I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/input" to "" Given I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/input" to ""
# Set the first status description to be empty # Set the first status description to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/input" to ""
# Set the first status grade to be empty # Set the first status grade to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[4]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[4]/input" to ""
# Set the third status acronym to be empty # Set the third status acronym to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/input" to ""
# Set the third status description to be empty # Set the third status description to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/input" to ""
# Set the third status grade to be empty # Set the third status grade to be empty
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[4]/input" to "" And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[4]/input" to ""
When I click on "Update" "button" in the "#preferencesform" "css_element" When I click on "Update" "button" in the "#preferencesform" "css_element"
Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/p" "xpath_element" Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/p" "xpath_element"
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/p" "xpath_element" And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/p" "xpath_element"
And I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/p" "xpath_element" And I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/p" "xpath_element"
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element" And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element"

416
tests/behat/report.feature

@ -29,211 +29,211 @@ Feature: Visiting reports
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
And I log out And I log out
Scenario: Teacher takes attendance Scenario: Teacher takes attendance
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Edit settings" And I follow "Edit settings"
Then I set the following fields to these values: Then I set the following fields to these values:
| id_grade_modgrade_type | Point | | id_grade_modgrade_type | Point |
| id_grade_modgrade_point | 50 | | id_grade_modgrade_point | 50 |
And I press "Save and display" And I press "Save and display"
When I follow "Report" When I follow "Report"
Then "0 / 0" "text" should exist in the "Student 1" "table_row" Then "0 / 0" "text" should exist in the "Student 1" "table_row"
And "0.0%" "text" should exist in the "Student 1" "table_row" And "0.0%" "text" should exist in the "Student 1" "table_row"
When I follow "Grades" in the user menu When I follow "Grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
And "-" "text" should exist in the "Student 1" "table_row" And "-" "text" should exist in the "Student 1" "table_row"
When I follow "Attendance" When I follow "Attendance"
Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" Then I click on "Take attendance" "link" in the "1am - 2am" "table_row"
# Late # Late
And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Report" When I follow "Report"
Then "1 / 2" "text" should exist in the "Student 1" "table_row" Then "1 / 2" "text" should exist in the "Student 1" "table_row"
And "50.0%" "text" should exist in the "Student 1" "table_row" And "50.0%" "text" should exist in the "Student 1" "table_row"
When I follow "Grades" in the user menu When I follow "Grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
And "25.00" "text" should exist in the "Student 1" "table_row" And "25.00" "text" should exist in the "Student 1" "table_row"
And I log out And I log out
Scenario: Teacher changes the maximum points in the attendance settings Scenario: Teacher changes the maximum points in the attendance settings
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Edit settings" And I follow "Edit settings"
Then I set the following fields to these values: Then I set the following fields to these values:
| id_grade_modgrade_type | Point | | id_grade_modgrade_type | Point |
| id_grade_modgrade_point | 50 | | id_grade_modgrade_point | 50 |
And I press "Save and display" And I press "Save and display"
When I follow "Attendance" When I follow "Attendance"
Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" Then I click on "Take attendance" "link" in the "1am - 2am" "table_row"
# Excused # Excused
And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Attendance" When I follow "Attendance"
And I follow "Edit settings" And I follow "Edit settings"
Then I set the following fields to these values: Then I set the following fields to these values:
| id_grade_modgrade_type | Point | | id_grade_modgrade_type | Point |
| id_grade_modgrade_point | 70 | | id_grade_modgrade_point | 70 |
And I press "Save and display" And I press "Save and display"
When I follow "Report" When I follow "Report"
Then "1 / 2" "text" should exist in the "Student 1" "table_row" Then "1 / 2" "text" should exist in the "Student 1" "table_row"
And "50.0%" "text" should exist in the "Student 1" "table_row" And "50.0%" "text" should exist in the "Student 1" "table_row"
When I follow "Grades" in the user menu When I follow "Grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
Then "35.00" "text" should exist in the "Student 1" "table_row" Then "35.00" "text" should exist in the "Student 1" "table_row"
And I log out And I log out
Scenario: Teacher take attendance of group session Scenario: Teacher take attendance of group session
Given the following "groups" exist: Given the following "groups" exist:
| course | name | idnumber | | course | name | idnumber |
| C1 | Group1 | Group1 | | C1 | Group1 | Group1 |
And the following "group members" exist: And the following "group members" exist:
| group | user | | group | user |
| Group1 | student1 | | Group1 | student1 |
When I log in as "teacher1" When I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Edit settings" And I follow "Edit settings"
And I set the following fields to these values: And I set the following fields to these values:
| id_grade_modgrade_type | Point | | id_grade_modgrade_type | Point |
| id_grade_modgrade_point | 50 | | id_grade_modgrade_point | 50 |
| id_groupmode | Visible groups | | id_groupmode | Visible groups |
And I press "Save and display" And I press "Save and display"
When I follow "Attendance" When I follow "Attendance"
Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" Then I click on "Take attendance" "link" in the "1am - 2am" "table_row"
# Excused # Excused
And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Add session" When I follow "Add session"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 03 | | id_sestime_starthour | 03 |
| id_sestime_endhour | 04 | | id_sestime_endhour | 04 |
| id_sessiontype_1 | 1 | | id_sessiontype_1 | 1 |
| id_groups | Group1 | | id_groups | Group1 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
Then I should see "3am - 4am" Then I should see "3am - 4am"
And "Group: Group1" "text" should exist in the "3am - 4am" "table_row" And "Group: Group1" "text" should exist in the "3am - 4am" "table_row"
When I click on "Take attendance" "link" in the "3am - 4am" "table_row" When I click on "Take attendance" "link" in the "3am - 4am" "table_row"
# Present # Present
And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Report" When I follow "Report"
Then "3 / 4" "text" should exist in the "Student 1" "table_row" Then "3 / 4" "text" should exist in the "Student 1" "table_row"
And "75.0%" "text" should exist in the "Student 1" "table_row" And "75.0%" "text" should exist in the "Student 1" "table_row"
When I follow "Grades" in the user menu When I follow "Grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
Then "37.50" "text" should exist in the "Student 1" "table_row" Then "37.50" "text" should exist in the "Student 1" "table_row"
And I log out And I log out
Scenario: Teacher visit summary report Scenario: Teacher visit summary report
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Edit settings" And I follow "Edit settings"
And I set the following fields to these values: And I set the following fields to these values:
| id_grade_modgrade_type | Point | | id_grade_modgrade_type | Point |
| id_grade_modgrade_point | 50 | | id_grade_modgrade_point | 50 |
And I press "Save and display" And I press "Save and display"
When I click on "Take attendance" "link" in the "1am - 2am" "table_row" When I click on "Take attendance" "link" in the "1am - 2am" "table_row"
# Late # Late
And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Add session" When I follow "Add session"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 03 | | id_sestime_starthour | 03 |
| id_sestime_endhour | 04 | | id_sestime_endhour | 04 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
Then I should see "3am - 4am" Then I should see "3am - 4am"
When I click on "Take attendance" "link" in the "3am - 4am" "table_row" When I click on "Take attendance" "link" in the "3am - 4am" "table_row"
# Present # Present
And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Add session" When I follow "Add session"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 05 | | id_sestime_starthour | 05 |
| id_sestime_endhour | 06 | | id_sestime_endhour | 06 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
Then I should see "5am - 6am" Then I should see "5am - 6am"
When I follow "Report" When I follow "Report"
And I click on "Summary" "link" in the "All" "table_row" And I click on "Summary" "link" in the "All" "table_row"
Then "3 / 6" "text" should exist in the "Student 1" "table_row" Then "3 / 6" "text" should exist in the "Student 1" "table_row"
And "50.0%" "text" should exist in the "Student 1" "table_row" And "50.0%" "text" should exist in the "Student 1" "table_row"
And "5 / 6" "text" should exist in the "Student 1" "table_row" And "5 / 6" "text" should exist in the "Student 1" "table_row"
And "83.3%" "text" should exist in the "Student 1" "table_row" And "83.3%" "text" should exist in the "Student 1" "table_row"
And I log out And I log out
Scenario: Student visit user report Scenario: Student visit user report
Given I log in as "teacher1" Given I log in as "teacher1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "Edit settings" And I follow "Edit settings"
Then I set the following fields to these values: Then I set the following fields to these values:
| id_grade_modgrade_type | Point | | id_grade_modgrade_type | Point |
| id_grade_modgrade_point | 50 | | id_grade_modgrade_point | 50 |
And I press "Save and display" And I press "Save and display"
When I click on "Take attendance" "link" in the "1am - 2am" "table_row" When I click on "Take attendance" "link" in the "1am - 2am" "table_row"
# Late # Late
And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Add session" When I follow "Add session"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 03 | | id_sestime_starthour | 03 |
| id_sestime_endhour | 04 | | id_sestime_endhour | 04 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
When I click on "Take attendance" "link" in the "3am - 4am" "table_row" When I click on "Take attendance" "link" in the "3am - 4am" "table_row"
# Present # Present
And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row"
And I press "Save attendance" And I press "Save attendance"
When I follow "Add session" When I follow "Add session"
And I set the following fields to these values: And I set the following fields to these values:
| id_sestime_starthour | 05 | | id_sestime_starthour | 05 |
| id_sestime_endhour | 06 | | id_sestime_endhour | 06 |
And I click on "id_submitbutton" "button" And I click on "id_submitbutton" "button"
Then I log out Then I log out
When I log in as "student1" When I log in as "student1"
And I am on "Course 1" course homepage And I am on "Course 1" course homepage
And I follow "Attendance" And I follow "Attendance"
And I follow "All" And I follow "All"
Then "2" "text" should exist in the "Taken sessions" "table_row" Then "2" "text" should exist in the "Taken sessions" "table_row"
And "3 / 4" "text" should exist in the "Points over taken sessions:" "table_row" And "3 / 4" "text" should exist in the "Points over taken sessions:" "table_row"
And "75.0%" "text" should exist in the "Percentage over taken sessions:" "table_row" And "75.0%" "text" should exist in the "Percentage over taken sessions:" "table_row"
And "3" "text" should exist in the "Total number of sessions:" "table_row" And "3" "text" should exist in the "Total number of sessions:" "table_row"
And "3 / 6" "text" should exist in the "Points over all sessions:" "table_row" And "3 / 6" "text" should exist in the "Points over all sessions:" "table_row"
And "50.0%" "text" should exist in the "Percentage over all sessions:" "table_row" And "50.0%" "text" should exist in the "Percentage over all sessions:" "table_row"
And "5 / 6" "text" should exist in the "Maximum possible points:" "table_row" And "5 / 6" "text" should exist in the "Maximum possible points:" "table_row"
And "83.3%" "text" should exist in the "Maximum possible percentage:" "table_row" And "83.3%" "text" should exist in the "Maximum possible percentage:" "table_row"
And I log out And I log out
Loading…
Cancel
Save