MDL-48624 behat: fix trailing whitespace
[moodle.git] / question / format / gift / tests / behat / import_export.feature
CommitLineData
02643daf 1@qformat @qformat_gift
f41269f3
TH
2Feature: Test importing questions from GIFT format.
3 In order to reuse questions
4 As an teacher
5 I need to be able to import them in GIFT format.
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname | format |
10 | Course 1 | C1 | topics |
11 And the following "users" exist:
12 | username | firstname |
13 | teacher | Teacher |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher | C1 | editingteacher |
17 And I log in as "teacher"
18 And I follow "Course 1"
19
20 @javascript @_file_upload
21 Scenario: import some GIFT questions
22 When I navigate to "Import" node in "Course administration > Question bank"
23 And I set the field "id_format_gift" to "1"
24 And I upload "question/format/gift/tests/fixtures/questions.gift.txt" file to "Import" filemanager
25 And I press "id_submitbutton"
26 Then I should see "Parsing questions from import file."
27 And I should see "Importing 9 questions from file"
28 And I should see "What's between orange and green in the spectrum?"
29 When I press "Continue"
30 Then I should see "colours"
d7a2a11e
TH
31
32 # Now export again.
33 And I navigate to "Export" node in "Course administration > Question bank"
34 And I set the field "id_format_gift" to "1"
35 And I press "Export questions to file"
9abf2d14 36 And following "click here" should download between "1550" and "1650" bytes