Skip to content

Commit

Permalink
Adust behat tests with new questions banks.
Browse files Browse the repository at this point in the history
  • Loading branch information
srobotta committed Dec 6, 2024
1 parent db6788a commit 764cd61
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions tests/behat/bulk_xml_export_action.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Feature: Use the plugin to export several question at once in the qbank manager.
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "activities" exist:
| activity | name | course | idnumber |
| quiz | Test quiz | C1 | quiz1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber |
| qbank | Qbank 1 | C1 | qbank1 |
And the following "question categories" exist:
| contextlevel | reference | questioncategory | name |
| Course | C1 | Top | top |
| Course | C1 | top | Default for C1 |
| Course | C1 | Default for C1 | Subcategory |
| contextlevel | reference | questioncategory | name |
| Activity module | qbank1 | Top | top |
| Activity module | qbank1 | top | Default for C1 |
| Activity module | qbank1 | Default for C1 | Subcategory |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Default for C1 | truefalse | First question | Answer the first question |
Expand All @@ -29,19 +29,26 @@ Feature: Use the plugin to export several question at once in the qbank manager.
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I should see "Bulk move questions"
And I click on "Disable" "link" in the "Bulk XML Export questions" "table_row"
And I am on the "Test quiz" "mod_quiz > question bank" page
And I am on the "C1" "Course" page
And I navigate to "Question banks" in current page administration
And I click on "Qbank 1" "link"
And I click on "input[type='checkbox']" "css_element" in the "First question" "table_row"
And I click on "With selected" "button"
Then I should not see question bulk action "bulkxmlexport"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Bulk XML Export questions" "table_row"
And I am on the "Test quiz" "mod_quiz > question bank" page
And I am on the "C1" "Course" page
And I navigate to "Question banks" in current page administration
And I click on "Qbank 1" "link"
And I click on "input[type='checkbox']" "css_element" in the "First question" "table_row"
And I click on "With selected" "button"
And I should see question bulk action "bulkxmlexport"
Then I should see question bulk action "bulkxmlexport"

Scenario: Bulk export questions as Moodle XML
When I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
Given I log in as "teacher1"
And I am on the "C1" "Course" page logged in as "teacher1"
And I navigate to "Question banks" in current page administration
And I click on "Qbank 1" "link"
And I should see "First question"
And I should not see "Essay Foo Bar"
And I click on "Also show questions from subcategories" "checkbox"
Expand Down

0 comments on commit 764cd61

Please sign in to comment.