From 67e7d60b562e2d9e2cece5ed318c965afdae0a7b Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 27 Nov 2014 11:15:48 +0800 Subject: [PATCH] MDL-48290 behat: Add log out after checking exported file If the download step is the last in the scenario then we can sometimes run into the situation where the download page causes a http redirect but behat has already conducted its reset (generating an error). By putting a logout step we avoid behat doing the reset until we are off that page. --- question/format/gift/tests/behat/import_export.feature | 5 +++++ question/format/xml/tests/behat/import_export.feature | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/question/format/gift/tests/behat/import_export.feature b/question/format/gift/tests/behat/import_export.feature index a458b018f4c..11ad3bffcb9 100644 --- a/question/format/gift/tests/behat/import_export.feature +++ b/question/format/gift/tests/behat/import_export.feature @@ -34,3 +34,8 @@ Feature: Test importing questions from GIFT format. And I set the field "id_format_gift" to "1" And I press "Export questions to file" And following "click here" should download between "1550" and "1650" bytes + # If the download step is the last in the scenario then we can sometimes run + # into the situation where the download page causes a http redirect but behat + # has already conducted its reset (generating an error). By putting a logout + # step we avoid behat doing the reset until we are off that page. + And I log out diff --git a/question/format/xml/tests/behat/import_export.feature b/question/format/xml/tests/behat/import_export.feature index 18dcc9bd740..941c722d0a1 100644 --- a/question/format/xml/tests/behat/import_export.feature +++ b/question/format/xml/tests/behat/import_export.feature @@ -36,6 +36,11 @@ Feature: Test importing questions from Moodle XML format. 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 + # If the download step is the last in the scenario then we can sometimes run + # into the situation where the download page causes a http redirect but behat + # has already conducted its reset (generating an error). By putting a logout + # step we avoid behat doing the reset until we are off that page. + And I log out @javascript @_file_upload Scenario: import some multiple choice questions from Moodle XML format