1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: The questions in the question bank can be selected in various ways
|
|
|
3 |
In selected to do something for questions
|
|
|
4 |
As a teacher
|
|
|
5 |
I want to choose them to move, delete it.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | format |
|
|
|
13 |
| Course 1 | C1 | weeks |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "question categories" exist:
|
|
|
18 |
| contextlevel | reference | name |
|
|
|
19 |
| Course | C1 | Test questions |
|
|
|
20 |
And the following "questions" exist:
|
|
|
21 |
| questioncategory | qtype | name | user | questiontext |
|
|
|
22 |
| Test questions | essay | A question 1 name | admin | Question 1 text |
|
|
|
23 |
| Test questions | essay | B question 2 name | teacher1 | Question 2 text |
|
|
|
24 |
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text |
|
|
|
25 |
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
|
|
26 |
|
|
|
27 |
@javascript
|
|
|
28 |
Scenario: The question text can be chosen all in the list of questions
|
|
|
29 |
Given the field "Select all" matches value ""
|
|
|
30 |
When I click on "Select all" "checkbox"
|
|
|
31 |
And the field "A question 1 name" matches value "1"
|
|
|
32 |
And the field "B question 2 name" matches value "1"
|
|
|
33 |
And the field "C question 3 name" matches value "1"
|
|
|
34 |
Then I click on "Deselect all" "checkbox"
|
|
|
35 |
And the field "A question 1 name" matches value ""
|
|
|
36 |
And the field "B question 2 name" matches value ""
|
|
|
37 |
And the field "C question 3 name" matches value ""
|
|
|
38 |
|
|
|
39 |
@javascript
|
|
|
40 |
Scenario: The question text can be chosen in the list of questions
|
|
|
41 |
Given the field "Select all" matches value ""
|
|
|
42 |
When I click on "A question 1 name" "checkbox"
|
|
|
43 |
Then the field "Select all" matches value ""
|
|
|
44 |
And I click on "B question 2 name" "checkbox"
|
|
|
45 |
And I click on "C question 3 name" "checkbox"
|
|
|
46 |
And the field "Deselect all" matches value "1"
|
|
|
47 |
|
|
|
48 |
@javascript
|
|
|
49 |
Scenario: The action button can be disabled when the question not be chosen in the list of questions
|
|
|
50 |
Given the field "Select all" matches value ""
|
|
|
51 |
When I click on "With selected" "button"
|
|
|
52 |
And I should not see "Delete"
|
|
|
53 |
And I should not see "Move to..."
|
|
|
54 |
And I click on "Select all" "checkbox"
|
|
|
55 |
And I click on "With selected" "button"
|
|
|
56 |
Then I should see question bulk action "move"
|
|
|
57 |
And I should see question bulk action "deleteselected"
|