diff --git a/tests/behat/attendance_mod.feature b/tests/behat/attendance_mod.feature index 30e0917..28fd3b6 100644 --- a/tests/behat/attendance_mod.feature +++ b/tests/behat/attendance_mod.feature @@ -1,101 +1,102 @@ @javascript @mod @uon @mod_attendance Feature: Teachers and Students can record session attendance - In order to record session attendance - As a student - I need to be able to mark my own attendance to a session - And as a teacher - I need to be able to mark any students attendance to a session - In order to report on session attendance - As a teacher - I need to be able to export session attendance and run reports - In order to contact students with poor attendance - As a teacher - I need the ability to message a group of students with low attendance + In order to record session attendance + As a student + I need to be able to mark my own attendance to a session + And as a teacher + I need to be able to mark any students attendance to a session + In order to report on session attendance + As a teacher + I need to be able to export session attendance and run reports + In order to contact students with poor attendance + As a teacher + I need the ability to message a group of students with low attendance - Background: - Given the following "courses" exist: - | fullname | shortname | summary | category | timecreated | timemodified | - | Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## | - And the following "users" exist: - | username | firstname | lastname | email | idnumber | department | institution | - | student1 | Sam | Student | student1@asd.com | 1234 | computer science | University of Nottingham | - | teacher1 | Teacher | One | teacher1@asd.com | 5678 | computer science | University of Nottingham | - And the following "course enrolments" exist: - | course | user | role | timestart | - | C1 | student1 | student | ##yesterday## | - | C1 | teacher1 | editingteacher | ##yesterday## | + Background: + Given the following "courses" exist: + | fullname | shortname | summary | category | timecreated | timemodified | + | Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## | + And the following "users" exist: + | username | firstname | lastname | email | idnumber | department | institution | + | student1 | Sam | Student | student1@asd.com | 1234 | computer science | University of Nottingham | + | teacher1 | Teacher | One | teacher1@asd.com | 5678 | computer science | University of Nottingham | + And the following "course enrolments" exist: + | course | user | role | timestart | + | C1 | student1 | student | ##yesterday## | + | C1 | teacher1 | editingteacher | ##yesterday## | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Add a block" - And I follow "Administration" - And I add a "Attendance" to section "1" and I fill the form with: - | Name | Attendance | - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I should see "Attendance" - And I log out + And I log in as "teacher1" + And I am on "Course 1" course homepage with editing mode on + And I follow "Add a block" + And I follow "Administration" + And I add a "Attendance" to section "1" and I fill the form with: + | Name | Attendance | + And I log out + And I log in as "student1" + And I am on "Course 1" course homepage + And I should see "Attendance" + And I log out Scenario: Students can mark their own attendance - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Add" - And I set the field "Allow students to record own attendance" to "1" - And I set the following fields to these values: - | id_sestime_starthour | 22 | - | id_sestime_endhour | 23 | - And I click on "id_submitbutton" "button" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Submit attendance" - And I set the field "Present" to "1" - And I press "Save changes" - And I should see "Self-recorded" - And I log out - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I expand "Reports" node - And I follow "Logs" - And I click on "Get these logs" "button" - Then "Attendance taken by student" "link" should exist + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Add" + And I set the field "Allow students to record own attendance" to "1" + And I set the following fields to these values: + | id_sestime_starthour | 22 | + | id_sestime_endhour | 23 | + And I click on "id_submitbutton" "button" + And I log out + And I log in as "student1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Submit attendance" + And I set the field "Present" to "1" + And I press "Save changes" + And I should see "Self-recorded" + And I log out + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I expand "Reports" node + And I follow "Logs" + And I click on "Get these logs" "button" + Then "Attendance taken by student" "link" should exist Scenario: Teachers can view low grade report and send a message - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Add" - And I set the following fields to these values: - | id_sestime_starthour | 01 | - | id_sestime_endhour | 02 | - And I click on "id_submitbutton" "button" - And I follow "Report" - And I follow "Low grade" - And I set the field "cb_selector" to "1" - And I click on "Send a message" "button" - And I should see "Message body" - And I should see "student1@asd.com" - And I follow "Course 1" - And I expand "Reports" node - And I follow "Logs" - And I click on "Get these logs" "button" - Then "Attendance report viewed" "link" should exist + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Add" + And I set the following fields to these values: + | id_sestime_starthour | 01 | + | id_sestime_endhour | 02 | + And I click on "id_submitbutton" "button" + And I follow "Report" + And I follow "Low grade" + And I set the field "cb_selector" to "1" + And I click on "Send a message" "button" + And I should see "Message body" + And I should see "student1@asd.com" + And I follow "Course 1" + And I expand "Reports" node + And I follow "Logs" + And I click on "Get these logs" "button" + Then "Attendance report viewed" "link" should exist Scenario: Export report includes id number, department and institution - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Add" - And I set the following fields to these values: - | id_sestime_starthour | 01 | - | id_sestime_endhour | 02 | - And I click on "id_submitbutton" "button" - And I follow "Export" - Then the field "id_ident_idnumber" matches value "" - And the field "id_ident_institution" matches value "" - And the field "id_ident_department" matches value "" - # Removed dependency on behat_download to allow automated Travis CI tests to pass. - # It would be good to add these back at some point. + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Add" + And I set the following fields to these values: + | id_sestime_starthour | 01 | + | id_sestime_endhour | 02 | + And I click on "id_submitbutton" "button" + And I follow "Export" + Then the field "id_ident_idnumber" matches value "" + And the field "id_ident_institution" matches value "" + And the field "id_ident_department" matches value "" + + # Removed dependency on behat_download to allow automated Travis CI tests to pass. + # It would be good to add these back at some point. diff --git a/tests/behat/preferences.feature b/tests/behat/preferences.feature index 83e68ab..d49ff05 100644 --- a/tests/behat/preferences.feature +++ b/tests/behat/preferences.feature @@ -1,56 +1,56 @@ @mod @uon @mod_attendance @mod_attendance_preferences Feature: Teachers can't change status variables to have empty acronyms or descriptions - In order to update status variables - As a teacher - I need to see an error notice below each acronym / description that I try to set to be empty + In order to update status variables + As a teacher + I need to see an error notice below each acronym / description that I try to set to be empty - Background: - Given the following "courses" exist: - | fullname | shortname | summary | category | timecreated | timemodified | - | Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## | - And the following "users" exist: - | username | firstname | lastname | - | student1 | Sam | Student | - | teacher1 | Teacher | One | - And the following "course enrolments" exist: - | course | user | role | timestart | - | C1 | student1 | student | ##yesterday## | - | C1 | teacher1 | editingteacher | ##yesterday## | + Background: + Given the following "courses" exist: + | fullname | shortname | summary | category | timecreated | timemodified | + | Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## | + And the following "users" exist: + | username | firstname | lastname | + | student1 | Sam | Student | + | teacher1 | Teacher | One | + And the following "course enrolments" exist: + | course | user | role | timestart | + | C1 | student1 | student | ##yesterday## | + | C1 | teacher1 | editingteacher | ##yesterday## | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Attendance" to section "1" and I fill the form with: - | Name | Attendancepreftest | - And I follow "Attendancepreftest" - And I follow "Status set" + And I log in as "teacher1" + And I am on "Course 1" course homepage with editing mode on + And I add a "Attendance" to section "1" and I fill the form with: + | Name | Attendancepreftest | + And I follow "Attendancepreftest" + And I follow "Status set" @javascript Scenario: Teachers can add status variables - # 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 "" - # 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 "" - # 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 "" - 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" - 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" + # 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 "" + # 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 "" + # 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 "" + 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" + 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" - # 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 "" - # 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 "" - # 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 "" - # 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 "" - # 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 "" - # 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 "" - 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" - 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 descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element" + # 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 "" + # 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 "" + # 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 "" + # 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 "" + # 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 "" + # 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 "" + 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" + 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 descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element" \ No newline at end of file diff --git a/tests/behat/report.feature b/tests/behat/report.feature index ccfa42a..204470e 100644 --- a/tests/behat/report.feature +++ b/tests/behat/report.feature @@ -1,241 +1,239 @@ @javascript @mod @uon @mod_attendance Feature: Visiting reports - As a teacher I visit the reports - - Background: - Given the following "courses" exist: - | fullname | shortname | summary | category | timecreated | timemodified | - | Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## | - And the following "users" exist: - | username | firstname | lastname | email | idnumber | department | institution | - | student1 | Student | 1 | student1@asd.com | 1234 | computer science | University of Nottingham | - | teacher1 | Teacher | 1 | teacher1@asd.com | 5678 | computer science | University of Nottingham | - And the following "course enrolments" exist: - | course | user | role | timestart | - | C1 | student1 | student | ##yesterday## | - | C1 | teacher1 | editingteacher | ##yesterday## | - - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Attendance" to section "1" and I fill the form with: - | Name | Attendance | - And I follow "Attendance" - And I follow "Add a block" - And I follow "Administration" - And I follow "Add session" - And I set the following fields to these values: - | id_sestime_starthour | 01 | - | id_sestime_endhour | 02 | - And I click on "id_submitbutton" "button" - - And I log out + As a teacher I visit the reports + + Background: + Given the following "courses" exist: + | fullname | shortname | summary | category | timecreated | timemodified | + | Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## | + And the following "users" exist: + | username | firstname | lastname | email | idnumber | department | institution | + | student1 | Student | 1 | student1@asd.com | 1234 | computer science | University of Nottingham | + | teacher1 | Teacher | 1 | teacher1@asd.com | 5678 | computer science | University of Nottingham | + And the following "course enrolments" exist: + | course | user | role | timestart | + | C1 | student1 | student | ##yesterday## | + | C1 | teacher1 | editingteacher | ##yesterday## | + + And I log in as "teacher1" + And I am on "Course 1" course homepage with editing mode on + And I add a "Attendance" to section "1" and I fill the form with: + | Name | Attendance | + And I follow "Attendance" + And I follow "Add a block" + And I follow "Administration" + And I follow "Add session" + And I set the following fields to these values: + | id_sestime_starthour | 01 | + | id_sestime_endhour | 02 | + And I click on "id_submitbutton" "button" + And I log out Scenario: Teacher takes attendance - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Edit settings" - Then I set the following fields to these values: - | id_grade_modgrade_type | Point | - | id_grade_modgrade_point | 50 | - And I press "Save and display" - - When I follow "Report" - Then "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 - And I follow "Course 1" - And "-" "text" should exist in the "Student 1" "table_row" - - When I follow "Attendance" - Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" - # Late - And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Report" - Then "1 / 2" "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 - And I follow "Course 1" - And "25.00" "text" should exist in the "Student 1" "table_row" - - And I log out + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Edit settings" + Then I set the following fields to these values: + | id_grade_modgrade_type | Point | + | id_grade_modgrade_point | 50 | + And I press "Save and display" + + When I follow "Report" + Then "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 + And I follow "Course 1" + And "-" "text" should exist in the "Student 1" "table_row" + + When I follow "Attendance" + Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" + # Late + And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Report" + Then "1 / 2" "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 + And I follow "Course 1" + And "25.00" "text" should exist in the "Student 1" "table_row" + + And I log out Scenario: Teacher changes the maximum points in the attendance settings - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Edit settings" - Then I set the following fields to these values: - | id_grade_modgrade_type | Point | - | id_grade_modgrade_point | 50 | - And I press "Save and display" - - When I follow "Attendance" - Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" - # Excused - And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Attendance" - And I follow "Edit settings" - Then I set the following fields to these values: - | id_grade_modgrade_type | Point | - | id_grade_modgrade_point | 70 | - And I press "Save and display" - - When I follow "Report" - Then "1 / 2" "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 - And I follow "Course 1" - Then "35.00" "text" should exist in the "Student 1" "table_row" - - And I log out + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Edit settings" + Then I set the following fields to these values: + | id_grade_modgrade_type | Point | + | id_grade_modgrade_point | 50 | + And I press "Save and display" + + When I follow "Attendance" + Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" + # Excused + And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Attendance" + And I follow "Edit settings" + Then I set the following fields to these values: + | id_grade_modgrade_type | Point | + | id_grade_modgrade_point | 70 | + And I press "Save and display" + + When I follow "Report" + Then "1 / 2" "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 + And I follow "Course 1" + Then "35.00" "text" should exist in the "Student 1" "table_row" + And I log out Scenario: Teacher take attendance of group session - Given the following "groups" exist: - | course | name | idnumber | - | C1 | Group1 | Group1 | - And the following "group members" exist: - | group | user | - | Group1 | student1 | - - When I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Edit settings" - And I set the following fields to these values: - | id_grade_modgrade_type | Point | - | id_grade_modgrade_point | 50 | - | id_groupmode | Visible groups | - And I press "Save and display" - - When I follow "Attendance" - Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" - # Excused - And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Add session" - And I set the following fields to these values: - | id_sestime_starthour | 03 | - | id_sestime_endhour | 04 | - | id_sessiontype_1 | 1 | - | id_groups | Group1 | - And I click on "id_submitbutton" "button" - Then I should see "3am - 4am" - 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" - # Present - And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Report" - Then "3 / 4" "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 - And I follow "Course 1" - Then "37.50" "text" should exist in the "Student 1" "table_row" + Given the following "groups" exist: + | course | name | idnumber | + | C1 | Group1 | Group1 | + And the following "group members" exist: + | group | user | + | Group1 | student1 | + + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Edit settings" + And I set the following fields to these values: + | id_grade_modgrade_type | Point | + | id_grade_modgrade_point | 50 | + | id_groupmode | Visible groups | + And I press "Save and display" + + When I follow "Attendance" + Then I click on "Take attendance" "link" in the "1am - 2am" "table_row" + # Excused + And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Add session" + And I set the following fields to these values: + | id_sestime_starthour | 03 | + | id_sestime_endhour | 04 | + | id_sessiontype_1 | 1 | + | id_groups | Group1 | + And I click on "id_submitbutton" "button" + Then I should see "3am - 4am" + 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" + # Present + And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Report" + Then "3 / 4" "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 + And I follow "Course 1" + Then "37.50" "text" should exist in the "Student 1" "table_row" And I log out Scenario: Teacher visit summary report - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Edit settings" - And I set the following fields to these values: - | id_grade_modgrade_type | Point | - | id_grade_modgrade_point | 50 | - And I press "Save and display" - - When I click on "Take attendance" "link" in the "1am - 2am" "table_row" - # Late - And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Add session" - And I set the following fields to these values: - | id_sestime_starthour | 03 | - | id_sestime_endhour | 04 | - And I click on "id_submitbutton" "button" - Then I should see "3am - 4am" - - When I click on "Take attendance" "link" in the "3am - 4am" "table_row" - # Present - And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Add session" - And I set the following fields to these values: - | id_sestime_starthour | 05 | - | id_sestime_endhour | 06 | - And I click on "id_submitbutton" "button" - Then I should see "5am - 6am" - - When I follow "Report" - And I click on "Summary" "link" in the "All" "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 "5 / 6" "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 + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Edit settings" + And I set the following fields to these values: + | id_grade_modgrade_type | Point | + | id_grade_modgrade_point | 50 | + And I press "Save and display" + + When I click on "Take attendance" "link" in the "1am - 2am" "table_row" + # Late + And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Add session" + And I set the following fields to these values: + | id_sestime_starthour | 03 | + | id_sestime_endhour | 04 | + And I click on "id_submitbutton" "button" + Then I should see "3am - 4am" + + When I click on "Take attendance" "link" in the "3am - 4am" "table_row" + # Present + And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Add session" + And I set the following fields to these values: + | id_sestime_starthour | 05 | + | id_sestime_endhour | 06 | + And I click on "id_submitbutton" "button" + Then I should see "5am - 6am" + + When I follow "Report" + And I click on "Summary" "link" in the "All" "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 "5 / 6" "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 Scenario: Student visit user report - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "Edit settings" - Then I set the following fields to these values: - | id_grade_modgrade_type | Point | - | id_grade_modgrade_point | 50 | - And I press "Save and display" - - When I click on "Take attendance" "link" in the "1am - 2am" "table_row" - # Late - And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Add session" - And I set the following fields to these values: - | id_sestime_starthour | 03 | - | id_sestime_endhour | 04 | - And I click on "id_submitbutton" "button" - - When I click on "Take attendance" "link" in the "3am - 4am" "table_row" - # Present - And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" - And I press "Save attendance" - - When I follow "Add session" - And I set the following fields to these values: - | id_sestime_starthour | 05 | - | id_sestime_endhour | 06 | - And I click on "id_submitbutton" "button" - - Then I log out - - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Attendance" - And I follow "All" - - 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 "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 / 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 "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 I log out + Given I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "Edit settings" + Then I set the following fields to these values: + | id_grade_modgrade_type | Point | + | id_grade_modgrade_point | 50 | + And I press "Save and display" + + When I click on "Take attendance" "link" in the "1am - 2am" "table_row" + # Late + And I click on "td.cell.c4 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Add session" + And I set the following fields to these values: + | id_sestime_starthour | 03 | + | id_sestime_endhour | 04 | + And I click on "id_submitbutton" "button" + + When I click on "Take attendance" "link" in the "3am - 4am" "table_row" + # Present + And I click on "td.cell.c3 input" "css_element" in the "Student 1" "table_row" + And I press "Save attendance" + + When I follow "Add session" + And I set the following fields to these values: + | id_sestime_starthour | 05 | + | id_sestime_endhour | 06 | + And I click on "id_submitbutton" "button" + + Then I log out + + When I log in as "student1" + And I am on "Course 1" course homepage + And I follow "Attendance" + And I follow "All" + + 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 "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 / 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 "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 I log out \ No newline at end of file