From 846653b85a1c96b0da82a100ed5d9f83b0314eda Mon Sep 17 00:00:00 2001 From: Joseph Baxter Date: Fri, 20 Jun 2014 16:52:38 +0100 Subject: [PATCH] added test of file export --- tests/behat/attendance_mod.feature | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/behat/attendance_mod.feature b/tests/behat/attendance_mod.feature index 24fc6fa..cef3a96 100644 --- a/tests/behat/attendance_mod.feature +++ b/tests/behat/attendance_mod.feature @@ -17,9 +17,9 @@ Feature: Teachers and Students can record session attendance | fullname | shortname | summary | category | | Course 1 | C101 | Prove the attendance activity works | 0 | And the following "users" exist: - | username | firstname | lastname | email | - | student1 | Sam | Student | student1@asd.com | - | teacher1 | Teacher | One | teacher1@asd.com | + | 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: | user | course | role | | student1 | C101 | student | @@ -38,7 +38,7 @@ Feature: Teachers and Students can record session attendance And I follow "Add" And I check "Allow students to record own attendance" And I set the following fields to these values: - | id_sessiondate_hour | 23 | + | id_sessiondate_hour | 23 | And I click on "id_submitbutton" "button" And I follow "Continue" And I log out @@ -63,7 +63,7 @@ Feature: Teachers and Students can record session attendance And I follow "Attendance" And I follow "Add" And I set the following fields to these values: - | id_sessiondate_hour | 01 | + | id_sessiondate_hour | 01 | And I click on "id_submitbutton" "button" And I follow "Continue" And I follow "Report" @@ -77,11 +77,29 @@ Feature: Teachers and Students can record session attendance And I click on "Get these logs" "button" Then "attendance report viewed" "link" should exist - Scenario: Export report id number, department and institution are unchecked by default + # Dependency - selenium running with firefox profile with auto saving of txt files to $CFG->behat_download. + @javascript @ignore + Scenario: Export report includes id number, department and institution When I log in as "teacher1" And I follow "Course 1" And I follow "Attendance" + And I follow "Add" + And I set the following fields to these values: + | id_sessiondate_hour | 01 | + And I click on "id_submitbutton" "button" + And I follow "Continue" And I follow "Export" Then the "id_ident_idnumber" checkbox should not be checked And the "id_ident_institution" checkbox should not be checked And the "id_ident_department" checkbox should not be checked + And I check "id_ident_idnumber" + And I check "id_ident_institution" + And I check "id_ident_department" + And I set the following fields to these values: + | format | Download in text format | + And I click on "OK" "button" + Then attendance export file is ok + And I should see "ID number" as "1234" in the file + And I should see "Department" as "computer science" in the file + And I should see "Institution" as "University of Nottingham" in the file +