MDL-76169 question: General behat fixes

Whilst amending these tests I discovered some other minor fixes to be
made.
This commit is contained in:
Andrew Nicols 2022-11-02 15:11:21 +08:00
parent 8ffbaad330
commit bcbdb8764a
7 changed files with 14 additions and 29 deletions

View File

@ -1,4 +1,4 @@
@qbank @qbank_previewquestion @javascript
@qbank @qbank_previewquestion
Feature: A teacher can preview questions in the question bank
In order to ensure the questions are properly created
As a teacher

View File

@ -16,7 +16,6 @@ Feature: Use the qbank plugin manager page for previewquestion
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | First question | Answer the first question |
@javascript
Scenario: Enable/disable previewquestion column from the base view
Given I log in as "admin"
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration

View File

@ -15,7 +15,6 @@ Feature: An activity module instance with questions in its context can be delete
| user | course | role |
| teacher1 | C1 | editingteacher |
@javascript
Scenario: Synchronously deleting a quiz with existing questions in its context
Given the following config values are set as admin:
| coursebinenable | 0 | tool_recyclebin |

View File

@ -26,10 +26,9 @@ Feature: A teacher can delete questions in the question bank
Scenario: A question not used anywhere can really be deleted
When I choose "Delete" action for "Test question to be deleted" in the question bank
And I press "Delete"
And I click on "Also show old questions" "checkbox"
And I set the field "Also show old questions" to "1"
Then I should not see "Test question to be deleted"
@javascript
Scenario: Deleting a question can be cancelled
When I choose "Delete" action for "Test question to be deleted" in the question bank
And I press "Cancel"
@ -54,7 +53,7 @@ Feature: A teacher can delete questions in the question bank
And I choose "Delete" action for "Test used question to be deleted" in the question bank
And I press "Delete"
Then I should not see "Test used question to be deleted"
And I click on "Also show old questions" "checkbox"
And I set the field "Also show old questions" to "1"
And I should see "Test used question to be deleted"
And I am on the "Test quiz" "quiz activity" page
And I click on "Preview quiz" "button"
@ -68,5 +67,5 @@ Feature: A teacher can delete questions in the question bank
And I reload the page
When I choose "Delete" action for "Broken question" in the question bank
And I press "Delete"
And I click on "Also show old questions" "checkbox"
And I set the field "Also show old questions" to "1"
Then I should not see "Broken question"

View File

@ -1,19 +1,19 @@
@core @core_question
Feature: The questions in the question bank can be sorted in various ways
In order to see what questions I have
As a teacher
I want to view them in different orders
In order to see what questions I have
As a teacher
I want to view them in different orders
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | weeks |
| Course 1 | C1 | weeks |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "question categories" exist:
| contextlevel | reference | name |
| Course | C1 | Test questions |
@ -24,11 +24,9 @@ Feature: The questions in the question bank can be sorted in various ways
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text | numidnum</c |
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
@javascript
Scenario: The questions are sorted by type by default
Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
@javascript
Scenario: The questions can be sorted by idnumber
When I change the window size to "large"
And I follow "Sort by ID number ascending"
@ -37,30 +35,25 @@ Feature: The questions in the question bank can be sorted in various ways
And I follow "Sort by ID number descending"
And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
@javascript
Scenario: The questions can be sorted in reverse order by type
When I follow "Sort by Question type descending"
Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
@javascript
Scenario: The questions can be sorted by name
When I follow "Sort by Question name ascending"
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
@javascript
Scenario: The questions can be sorted in reverse order by name
When I follow "Sort by Question name ascending"
And I follow "Sort by Question name descending"
Then "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
@javascript
Scenario: The questions can be sorted by creator name
When I follow "Sort by First name ascending"
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
@javascript
Scenario: The questions can be sorted in reverse order by creator name
When I follow "Sort by First name ascending"
And I follow "Sort by First name descending"
@ -68,7 +61,7 @@ Feature: The questions in the question bank can be sorted in various ways
@javascript
Scenario: The question text can be shown in the list of questions
When I click on "Show question text in the question list" "checkbox"
When I set the field "Show question text in the question list" to "1"
Then I should see "Question 1 text"
And I should see "Question 2 text"
And I should see "Question 3 text"

View File

@ -21,14 +21,12 @@ Feature: In an essay question, let the question author choose the min/max number
| questioncategory | qtype | name | template | minwordlimit | maxwordlimit |
| Test questions | essay | essay-min-max | editor | 0 | 0 |
@javascript
Scenario: Minimum/Maximum word limit are enabled but not set.
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
And I set the field "minwordenabled" to "1"
And I click on "Save changes" "button"
Then I should see "Minimum word limit is enabled but is not set"
@javascript
Scenario: Minimum/Maximum word limit cannot be set to a negative number.
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
And I set the field "minwordenabled" to "1"
@ -36,7 +34,6 @@ Feature: In an essay question, let the question author choose the min/max number
And I click on "Save changes" "button"
Then I should see "Minimum word limit cannot be a negative number"
@javascript
Scenario: Maximum word limit cannot be greater than minimum word limit.
When I am on the "essay-min-max" "core_question > edit" page logged in as teacher
And I set the field "minwordenabled" to "1"

View File

@ -1,4 +1,4 @@
@core @core_question @javascript @report @report_questioninstance
@core @core_question @report @report_questioninstance
Feature: A Teacher can generate question instance reports
In order to see question instance reports
As a Teacher
@ -32,7 +32,6 @@ Feature: A Teacher can generate question instance reports
| contextlevel | reference | name |
| Activity module | Test quiz Q001 | Quiz category |
@javascript
Scenario: Generate general and specific report
Given I am on the "C1" "Course" page logged in as "admin"
And I navigate to "Reports > Question instances" in site administration
@ -41,7 +40,6 @@ Feature: A Teacher can generate question instance reports
And "Course: Course 1" row "Visible" column of "generaltable" table should contain "2"
And "Course: Course 1" row "Hidden" column of "generaltable" table should contain "0"
@javascript
Scenario: Generate report displaying hidden questions
Given I am on the "Test quiz Q001" "mod_quiz > question bank" page logged in as "admin"
And I choose "Delete" action for "TF" in the question bank