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
|
Feature: A teacher can preview questions in the question bank
|
||||||
In order to ensure the questions are properly created
|
In order to ensure the questions are properly created
|
||||||
As a teacher
|
As a teacher
|
||||||
|
|
|
@ -16,7 +16,6 @@ Feature: Use the qbank plugin manager page for previewquestion
|
||||||
| questioncategory | qtype | name | questiontext |
|
| questioncategory | qtype | name | questiontext |
|
||||||
| Test questions | truefalse | First question | Answer the first question |
|
| Test questions | truefalse | First question | Answer the first question |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Enable/disable previewquestion column from the base view
|
Scenario: Enable/disable previewquestion column from the base view
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
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 |
|
| user | course | role |
|
||||||
| teacher1 | C1 | editingteacher |
|
| teacher1 | C1 | editingteacher |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Synchronously deleting a quiz with existing questions in its context
|
Scenario: Synchronously deleting a quiz with existing questions in its context
|
||||||
Given the following config values are set as admin:
|
Given the following config values are set as admin:
|
||||||
| coursebinenable | 0 | tool_recyclebin |
|
| 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
|
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
|
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
||||||
And I press "Delete"
|
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"
|
Then I should not see "Test question to be deleted"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Deleting a question can be cancelled
|
Scenario: Deleting a question can be cancelled
|
||||||
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
When I choose "Delete" action for "Test question to be deleted" in the question bank
|
||||||
And I press "Cancel"
|
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 choose "Delete" action for "Test used question to be deleted" in the question bank
|
||||||
And I press "Delete"
|
And I press "Delete"
|
||||||
Then I should not see "Test used question to be deleted"
|
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 should see "Test used question to be deleted"
|
||||||
And I am on the "Test quiz" "quiz activity" page
|
And I am on the "Test quiz" "quiz activity" page
|
||||||
And I click on "Preview quiz" "button"
|
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
|
And I reload the page
|
||||||
When I choose "Delete" action for "Broken question" in the question bank
|
When I choose "Delete" action for "Broken question" in the question bank
|
||||||
And I press "Delete"
|
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"
|
Then I should not see "Broken question"
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
@core @core_question
|
@core @core_question
|
||||||
Feature: The questions in the question bank can be sorted in various ways
|
Feature: The questions in the question bank can be sorted in various ways
|
||||||
In order to see what questions I have
|
In order to see what questions I have
|
||||||
As a teacher
|
As a teacher
|
||||||
I want to view them in different orders
|
I want to view them in different orders
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given the following "users" exist:
|
Given the following "users" exist:
|
||||||
| username | firstname | lastname | email |
|
| username | firstname | lastname | email |
|
||||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||||
And the following "courses" exist:
|
And the following "courses" exist:
|
||||||
| fullname | shortname | format |
|
| fullname | shortname | format |
|
||||||
| Course 1 | C1 | weeks |
|
| Course 1 | C1 | weeks |
|
||||||
And the following "course enrolments" exist:
|
And the following "course enrolments" exist:
|
||||||
| user | course | role |
|
| user | course | role |
|
||||||
| teacher1 | C1 | editingteacher |
|
| teacher1 | C1 | editingteacher |
|
||||||
And the following "question categories" exist:
|
And the following "question categories" exist:
|
||||||
| contextlevel | reference | name |
|
| contextlevel | reference | name |
|
||||||
| Course | C1 | Test questions |
|
| 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 |
|
| 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"
|
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
|
Scenario: The questions are sorted by type by default
|
||||||
Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted by idnumber
|
Scenario: The questions can be sorted by idnumber
|
||||||
When I change the window size to "large"
|
When I change the window size to "large"
|
||||||
And I follow "Sort by ID number ascending"
|
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 I follow "Sort by ID number descending"
|
||||||
And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
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
|
Scenario: The questions can be sorted in reverse order by type
|
||||||
When I follow "Sort by Question type descending"
|
When I follow "Sort by Question type descending"
|
||||||
Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted by name
|
Scenario: The questions can be sorted by name
|
||||||
When I follow "Sort by Question name ascending"
|
When I follow "Sort by Question name ascending"
|
||||||
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
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"
|
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
|
Scenario: The questions can be sorted in reverse order by name
|
||||||
When I follow "Sort by Question name ascending"
|
When I follow "Sort by Question name ascending"
|
||||||
And I follow "Sort by Question name descending"
|
And I follow "Sort by Question name descending"
|
||||||
Then "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
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"
|
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: The questions can be sorted by creator name
|
Scenario: The questions can be sorted by creator name
|
||||||
When I follow "Sort by First name ascending"
|
When I follow "Sort by First name ascending"
|
||||||
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
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
|
Scenario: The questions can be sorted in reverse order by creator name
|
||||||
When I follow "Sort by First name ascending"
|
When I follow "Sort by First name ascending"
|
||||||
And I follow "Sort by First name descending"
|
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
|
@javascript
|
||||||
Scenario: The question text can be shown in the list of questions
|
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"
|
Then I should see "Question 1 text"
|
||||||
And I should see "Question 2 text"
|
And I should see "Question 2 text"
|
||||||
And I should see "Question 3 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 |
|
| questioncategory | qtype | name | template | minwordlimit | maxwordlimit |
|
||||||
| Test questions | essay | essay-min-max | editor | 0 | 0 |
|
| Test questions | essay | essay-min-max | editor | 0 | 0 |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Minimum/Maximum word limit are enabled but not set.
|
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
|
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 set the field "minwordenabled" to "1"
|
||||||
And I click on "Save changes" "button"
|
And I click on "Save changes" "button"
|
||||||
Then I should see "Minimum word limit is enabled but is not set"
|
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.
|
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
|
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 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"
|
And I click on "Save changes" "button"
|
||||||
Then I should see "Minimum word limit cannot be a negative number"
|
Then I should see "Minimum word limit cannot be a negative number"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Maximum word limit cannot be greater than minimum word limit.
|
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
|
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 set the field "minwordenabled" to "1"
|
||||||
|
|
|
@ -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
|
Feature: A Teacher can generate question instance reports
|
||||||
In order to see question instance reports
|
In order to see question instance reports
|
||||||
As a Teacher
|
As a Teacher
|
||||||
|
@ -32,7 +32,6 @@ Feature: A Teacher can generate question instance reports
|
||||||
| contextlevel | reference | name |
|
| contextlevel | reference | name |
|
||||||
| Activity module | Test quiz Q001 | Quiz category |
|
| Activity module | Test quiz Q001 | Quiz category |
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Generate general and specific report
|
Scenario: Generate general and specific report
|
||||||
Given I am on the "C1" "Course" page logged in as "admin"
|
Given I am on the "C1" "Course" page logged in as "admin"
|
||||||
And I navigate to "Reports > Question instances" in site administration
|
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 "Visible" column of "generaltable" table should contain "2"
|
||||||
And "Course: Course 1" row "Hidden" column of "generaltable" table should contain "0"
|
And "Course: Course 1" row "Hidden" column of "generaltable" table should contain "0"
|
||||||
|
|
||||||
@javascript
|
|
||||||
Scenario: Generate report displaying hidden questions
|
Scenario: Generate report displaying hidden questions
|
||||||
Given I am on the "Test quiz Q001" "mod_quiz > question bank" page logged in as "admin"
|
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
|
And I choose "Delete" action for "TF" in the question bank
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue