Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qbank @qbank_deletequestion
2
Feature: Use the qbank plugin manager page for deletequestion
3
  In order to check the plugin behaviour with enable and disable
4
 
5
  Background:
6
    Given the following "courses" exist:
7
      | fullname | shortname | category |
8
      | Course 1 | C1        | 0        |
9
    And the following "activities" exist:
10
      | activity   | name      | course | idnumber |
11
      | quiz       | Test quiz | C1     | quiz1    |
12
    And the following "question categories" exist:
13
      | contextlevel | reference | name           |
14
      | Course       | C1        | Test questions |
15
    And the following "questions" exist:
16
      | questioncategory | qtype     | name                  | questiontext              |
17
      | Test questions   | truefalse | First question        | Answer the first question |
18
      | Test questions   | truefalse | First question second | Answer the first question |
19
 
20
  Scenario: Enable/disable delete question column from the base view
21
    Given I log in as "admin"
22
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
23
    And I should see "Delete question"
24
    And I click on "Disable" "link" in the "Delete question" "table_row"
25
    And I am on the "Test quiz" "mod_quiz > question bank" page
26
    Then the "Delete" action should not exist for the "First question" question in the question bank
27
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
28
    And I click on "Enable" "link" in the "Delete question" "table_row"
29
    And I am on the "Test quiz" "mod_quiz > question bank" page
30
    And the "Delete" action should exist for the "First question" question in the question bank
31
 
32
  @javascript
33
  Scenario: Enable/disable delete questions bulk action from the base view
34
    Given I log in as "admin"
35
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
36
    And I should see "Delete question"
37
    And I click on "Disable" "link" in the "Delete question" "table_row"
38
    And I am on the "Test quiz" "mod_quiz > question bank" page
39
    And I click on "With selected" "button"
40
    Then I should not see question bulk action "deleteselected"
41
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
42
    And I click on "Enable" "link" in the "Delete question" "table_row"
43
    And I am on the "Test quiz" "mod_quiz > question bank" page
44
    And I click on "With selected" "button"
45
    And I should see question bulk action "deleteselected"
46
 
47
  @javascript
48
  Scenario: I should not see the deleted questions in the base view
49
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
50
    And I click on "First question" "checkbox"
51
    And I click on "First question second" "checkbox"
52
    And I click on "With selected" "button"
53
    And I click on question bulk action "deleteselected"
54
    And I click on "Delete" "button" in the "Delete questions?" "dialogue"
55
    Then I should not see "First question"
56
    And I should not see "First question second"
57
 
58
  @javascript
59
  Scenario: I should be able to delete a question when filtered using tags
60
    Given I am on the "First question" "core_question > edit" page logged in as "admin"
61
    And I set the following fields to these values:
62
      | Tags | foo |
63
    And I click on "Save changes" "button"
64
    And I am on the "Test quiz" "mod_quiz > question bank" page
65
    And I apply question bank filter "Tag" with value "foo"
66
    And I click on "First question" "checkbox"
67
    And I click on "With selected" "button"
68
    And I click on question bulk action "deleteselected"
69
    When I click on "Delete" "button" in the "Delete question?" "dialogue"
70
    Then I should not see "Third question"
71
    And "foo" "autocomplete_selection" should exist