From d7a2a11e672fad5fd9d5f9b73658df42bb7c0bd8 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 1 Oct 2014 16:59:56 +0100 Subject: [PATCH] MDL-47497 qformats gift and xml: basic test of export. Really, this is just to test the new behat setps, as much as anything. Note that the details of what is written to the export files is tested in the unit tests. --- .../tests/behat/{import.feature => import_export.feature} | 6 ++++++ .../tests/behat/{import.feature => import_export.feature} | 6 ++++++ 2 files changed, 12 insertions(+) rename question/format/gift/tests/behat/{import.feature => import_export.feature} (82%) rename question/format/xml/tests/behat/{import.feature => import_export.feature} (92%) diff --git a/question/format/gift/tests/behat/import.feature b/question/format/gift/tests/behat/import_export.feature similarity index 82% rename from question/format/gift/tests/behat/import.feature rename to question/format/gift/tests/behat/import_export.feature index a2a683ad6f9..ccd49af3c10 100644 --- a/question/format/gift/tests/behat/import.feature +++ b/question/format/gift/tests/behat/import_export.feature @@ -28,3 +28,9 @@ Feature: Test importing questions from GIFT format. And I should see "What's between orange and green in the spectrum?" When I press "Continue" Then I should see "colours" + + # Now export again. + And I navigate to "Export" node in "Course administration > Question bank" + And I set the field "id_format_gift" to "1" + And I press "Export questions to file" + And following "click here" should download "1624" bytes diff --git a/question/format/xml/tests/behat/import.feature b/question/format/xml/tests/behat/import_export.feature similarity index 92% rename from question/format/xml/tests/behat/import.feature rename to question/format/xml/tests/behat/import_export.feature index 4f6ee79e260..18dcc9bd740 100644 --- a/question/format/xml/tests/behat/import.feature +++ b/question/format/xml/tests/behat/import_export.feature @@ -31,6 +31,12 @@ Feature: Test importing questions from Moodle XML format. Then I should see "Moodle acronym (False)" Then I should see "Moodle acronym (True)" + # Now export again. + And I navigate to "Export" node in "Course administration > Question bank" + And I set the field "id_format_xml" to "1" + And I press "Export questions to file" + And following "click here" should download between "57000" and "58000" bytes + @javascript @_file_upload Scenario: import some multiple choice questions from Moodle XML format When I navigate to "Import" node in "Course administration > Question bank"