mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-76169 question: General behat fixes
Whilst amending these tests I discovered some other minor fixes to be made.
This commit is contained in:
parent
8ffbaad330
commit
bcbdb8764a
7 changed files with 14 additions and 29 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 |
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue