Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea 1...
1
@qbank @qbank_deletequestion
1
@qbank @qbank_deletequestion
2
Feature: Use the qbank plugin manager page for deletequestion
2
Feature: Use the qbank plugin manager page for deletequestion
3
  In order to check the plugin behaviour with enable and disable
3
  In order to check the plugin behaviour with enable and disable
Línea 4... Línea 4...
4
 
4
 
5
  Background:
5
  Background:
-
 
6
    Given the following "users" exist:
-
 
7
      | username | firstname | lastname | email                |
-
 
8
      | teacher1 | Teacher   | 1        | teacher1@example.com |
6
    Given the following "courses" exist:
9
    And the following "courses" exist:
7
      | fullname | shortname | category |
10
      | fullname | shortname | category |
-
 
11
      | Course 1 | C1        | 0        |
-
 
12
    And the following "course enrolments" exist:
-
 
13
      | user     | course | role           |
8
      | Course 1 | C1        | 0        |
14
      | teacher1 | C1     | editingteacher |
9
    And the following "activities" exist:
15
    And the following "activities" exist:
10
      | activity   | name      | course | idnumber |
16
      | activity   | name      | course | idnumber |
11
      | quiz       | Test quiz | C1     | quiz1    |
17
      | quiz       | Test quiz | C1     | quiz1    |
12
    And the following "question categories" exist:
18
    And the following "question categories" exist:
13
      | contextlevel | reference | name           |
19
      | contextlevel    | reference | name             |
14
      | Course       | C1        | Test questions |
20
      | Activity module | quiz1     | Test questions   |
15
    And the following "questions" exist:
21
    And the following "questions" exist:
16
      | questioncategory | qtype     | name                  | questiontext              |
22
      | questioncategory | qtype     | name       | questiontext               |
-
 
23
      | Test questions   | truefalse | Question 1 | Answer the first question  |
17
      | Test questions   | truefalse | First question        | Answer the first question |
24
      | Test questions   | truefalse | Question 2 | Answer the second question |
Línea -... Línea 25...
-
 
25
      | Test questions   | truefalse | Question 3 | Answer the third question  |
18
      | Test questions   | truefalse | First question second | Answer the first question |
26
 
19
 
27
  @javascript
20
  Scenario: Enable/disable delete question column from the base view
28
  Scenario: Enable/disable delete question column from the base view
21
    Given I log in as "admin"
29
    Given I log in as "admin"
22
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
30
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
23
    And I should see "Delete question"
31
    And I should see "Delete question"
-
 
32
    And I click on "Disable" "link" in the "Delete question" "table_row"
24
    And I click on "Disable" "link" in the "Delete question" "table_row"
33
    And I am on the "Test quiz" "mod_quiz > question bank" page
25
    And I am on the "Test quiz" "mod_quiz > question bank" page
34
    And I apply question bank filter "Category" with value "Test questions"
26
    Then the "Delete" action should not exist for the "First question" question in the question bank
35
    Then the "Delete" action should not exist for the "Question 1" question in the question bank
27
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
36
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
-
 
37
    And I click on "Enable" "link" in the "Delete question" "table_row"
28
    And I click on "Enable" "link" in the "Delete question" "table_row"
38
    And I am on the "Test quiz" "mod_quiz > question bank" page
Línea 29... Línea 39...
29
    And I am on the "Test quiz" "mod_quiz > question bank" page
39
    And I apply question bank filter "Category" with value "Test questions"
30
    And the "Delete" action should exist for the "First question" question in the question bank
40
    And the "Delete" action should exist for the "Question 1" question in the question bank
31
 
41
 
32
  @javascript
42
  @javascript
33
  Scenario: Enable/disable delete questions bulk action from the base view
43
  Scenario: Enable/disable delete questions bulk action from the base view
34
    Given I log in as "admin"
44
    Given I log in as "admin"
35
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
45
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
-
 
46
    And I should see "Delete question"
36
    And I should see "Delete question"
47
    And I click on "Disable" "link" in the "Delete question" "table_row"
37
    And I click on "Disable" "link" in the "Delete question" "table_row"
48
    And I am on the "Test quiz" "mod_quiz > question bank" page
38
    And I am on the "Test quiz" "mod_quiz > question bank" page
49
    And I apply question bank filter "Category" with value "Test questions"
39
    And I click on "With selected" "button"
50
    And I click on "With selected" "button"
40
    Then I should not see question bulk action "deleteselected"
51
    Then I should not see question bulk action "deleteselected"
-
 
52
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
41
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
53
    And I click on "Enable" "link" in the "Delete question" "table_row"
42
    And I click on "Enable" "link" in the "Delete question" "table_row"
54
    And I am on the "Test quiz" "mod_quiz > question bank" page
Línea 43... Línea 55...
43
    And I am on the "Test quiz" "mod_quiz > question bank" page
55
    And I apply question bank filter "Category" with value "Test questions"
44
    And I click on "With selected" "button"
56
    And I click on "With selected" "button"
45
    And I should see question bulk action "deleteselected"
57
    And I should see question bulk action "deleteselected"
-
 
58
 
46
 
59
  @javascript
47
  @javascript
60
  Scenario: I should not see the deleted questions in the base view
48
  Scenario: I should not see the deleted questions in the base view
61
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
49
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
62
    And I apply question bank filter "Category" with value "Test questions"
50
    And I click on "First question" "checkbox"
63
    And I click on "Question 1" "checkbox"
51
    And I click on "First question second" "checkbox"
64
    And I click on "Question 2" "checkbox"
52
    And I click on "With selected" "button"
65
    And I click on "With selected" "button"
Línea 53... Línea 66...
53
    And I click on question bulk action "deleteselected"
66
    And I click on question bulk action "deleteselected"
54
    And I click on "Delete" "button" in the "Delete questions?" "dialogue"
67
    And I click on "Delete" "button" in the "Delete questions?" "dialogue"
55
    Then I should not see "First question"
68
    Then I should not see "Question 1"
-
 
69
    And I should not see "Question 2"
56
    And I should not see "First question second"
70
 
57
 
71
  @javascript
58
  @javascript
72
  Scenario: I should be able to delete a question when filtered using tags
59
  Scenario: I should be able to delete a question when filtered using tags
73
    Given I am on the "Question 1" "core_question > edit" page logged in as "admin"
-
 
74
    And I change window size to "large"
60
    Given I am on the "First question" "core_question > edit" page logged in as "admin"
75
    And I set the following fields to these values:
61
    And I set the following fields to these values:
76
      | Tags | foo |
62
      | Tags | foo |
77
    And I click on "Save changes" "button"
63
    And I click on "Save changes" "button"
78
    And I am on the "Test quiz" "mod_quiz > question bank" page
64
    And I am on the "Test quiz" "mod_quiz > question bank" page
79
    And I apply question bank filter "Category" with value "Test questions"
65
    And I apply question bank filter "Tag" with value "foo"
80
    And I apply question bank filter "Tag" with value "foo"
66
    And I click on "First question" "checkbox"
81
    And I click on "Question 1" "checkbox"
-
 
82
    And I click on "With selected" "button"
-
 
83
    And I click on question bulk action "deleteselected"
-
 
84
    When I click on "Delete" "button" in the "Delete question?" "dialogue"
-
 
85
    Then I should not see "Third question"
-
 
86
    And "foo" "autocomplete_selection" should exist
-
 
87
 
-
 
88
  @javascript
-
 
89
  Scenario: Questions can be bulk deleted from the question bank
-
 
90
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
-
 
91
    And I apply question bank filter "Category" with value "Test questions"
-
 
92
    # Select questions to be deleted.
-
 
93
    And I click on "Question 1" "checkbox"
-
 
94
    And I click on "Question 2" "checkbox"
-
 
95
    And I click on "With selected" "button"
-
 
96
    When I press "Delete"
-
 
97
    # Confirm that delete confirmation message is displayed.
-
 
98
    Then I should see "This will delete the following questions and all their versions:"
-
 
99
    # Confirm that selected questions are listed on the confirmation dialog.
-
 
100
    And I should see "Question 1 v1"
-
 
101
    And I should see "Question 2 v1"
-
 
102
    # Delete selected questions.