diff --git a/tests/behat/report.feature b/tests/behat/report.feature index da8fd61..eee95f2 100644 --- a/tests/behat/report.feature +++ b/tests/behat/report.feature @@ -1,247 +1,5 @@ @javascript @mod @uon @mod_attendance Feature: Visiting reports -<<<<<<< HEAD - 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 follow "Course 1" - And I turn 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 - When I log in as "teacher1" - And I follow "Course 1" - 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.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 - When I log in as "teacher1" - And I follow "Course 1" - 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.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 follow "Course 1" - 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.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.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 - When I log in as "teacher1" - And I follow "Course 1" - 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.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.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 - When I log in as "teacher1" - And I follow "Course 1" - 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.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.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 follow "Course 1" - And I follow "Attendance" - And I click on "All" "link" in the ".attfiltercontrols" "css_element" - - 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 -======= As a teacher I visit the reports Background: @@ -258,9 +16,9 @@ Feature: Visiting reports | C1 | teacher1 | editingteacher | ##yesterday## | And the following config values are set as admin: | enablewarnings | 1 | attendance | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on + And I follow "Course 1" + And I turn editing mode on And I add a "Attendance" to section "1" and I fill the form with: | Name | Attendance | And I follow "Attendance" @@ -280,8 +38,8 @@ Feature: Visiting reports And I log out Scenario: Teacher takes attendance - Given I log in as "teacher1" - And I am on "Course 1" course homepage + When I log in as "teacher1" + And I follow "Course 1" And I follow "Attendance" And I follow "Edit settings" Then I set the following fields to these values: @@ -299,8 +57,8 @@ Feature: Visiting reports 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" + # Late + And I click on "td.c4 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Report" @@ -314,8 +72,8 @@ Feature: Visiting reports 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 + When I log in as "teacher1" + And I follow "Course 1" And I follow "Attendance" And I follow "Edit settings" Then I set the following fields to these values: @@ -325,8 +83,8 @@ Feature: Visiting reports 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" + # Excused + And I click on "td.c4 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Attendance" @@ -343,6 +101,7 @@ Feature: Visiting reports 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 @@ -354,7 +113,7 @@ Feature: Visiting reports | Group1 | student1 | When I log in as "teacher1" - And I am on "Course 1" course homepage + And I follow "Course 1" And I follow "Attendance" And I follow "Edit settings" And I set the following fields to these values: @@ -365,8 +124,8 @@ Feature: Visiting reports 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" + # Excused + And I click on "td.c4 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Add session" @@ -380,8 +139,8 @@ Feature: Visiting reports 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" + # Present + And I click on "td.c3 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Report" @@ -395,18 +154,18 @@ Feature: Visiting reports And I log out Scenario: Teacher visit summary report and at-risk report - Given I log in as "teacher1" - And I am on "Course 1" course homepage + When I log in as "teacher1" + And I follow "Course 1" 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_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" + # Late + And I click on "td.c4 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Add session" @@ -417,8 +176,8 @@ Feature: Visiting reports 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" + # Present + And I click on "td.c3 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Add session" @@ -435,15 +194,14 @@ Feature: Visiting reports 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 follow "At-risk report" And I should see "Student 1" And I log out Scenario: Student visit user report - Given I log in as "teacher1" - And I am on "Course 1" course homepage + When I log in as "teacher1" + And I follow "Course 1" And I follow "Attendance" And I follow "Edit settings" Then I set the following fields to these values: @@ -452,8 +210,8 @@ Feature: Visiting reports 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" + # Late + And I click on "td.c4 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Add session" @@ -463,8 +221,8 @@ Feature: Visiting reports 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" + # Present + And I click on "td.c3 input" "css_element" in the "Student 1" "table_row" And I press "Save attendance" When I follow "Add session" @@ -476,7 +234,7 @@ Feature: Visiting reports Then I log out When I log in as "student1" - And I am on "Course 1" course homepage + And I follow "Course 1" And I follow "Attendance" And I click on "All" "link" in the ".attfiltercontrols" "css_element" @@ -489,5 +247,4 @@ Feature: Visiting reports 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 ->>>>>>> 664dfe0... Merge notification/warning feature into master. (#267) + And I log out \ No newline at end of file