Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_question @core_customfield @qbank_customfields @javascript
2
Feature: Site administrators can manage categories for question custom fields
3
  In order to have additional data in questions
4
  As a site site administrator
5
  I need to create, edit, remove and sort question custom field categories
6
 
7
  Scenario: Create a category for custom question fields
8
    Given I log in as "admin"
9
    When I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
10
    And I press "Add a new category"
11
    And I wait until the page is ready
12
    Then I should see "Other fields" in the "#customfield_catlist" "css_element"
13
 
14
  Scenario: Edit a category name for custom question fields
15
    Given the following "custom field categories" exist:
16
      | name              | component          | area     | itemid |
17
      | Category for test | qbank_customfields | question | 0      |
18
    And I log in as "admin"
19
    And I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
20
    And I set the field "Edit category name" in the "//div[contains(@class,'categoryinstance') and contains(.,'Category for test')]" "xpath_element" to "Good fields"
21
    Then I should not see "Category for test" in the "#customfield_catlist" "css_element"
22
    And "New value for Category for test" "field" should not exist
23
    And I should see "Good fields" in the "#customfield_catlist" "css_element"
24
 
25
  Scenario: Delete a category for custom question fields
26
    Given the following "custom field categories" exist:
27
      | name              | component          | area     | itemid |
28
      | Category for test | qbank_customfields | question | 0      |
29
    And the following "custom fields" exist:
30
      | name    | category          | type | shortname |
31
      | Field 1 | Category for test | text | f1        |
32
    And I log in as "admin"
33
    And I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
34
    And I click on "[data-role='deletecategory']" "css_element"
35
    And I click on "Yes" "button" in the "Confirm" "dialogue"
36
    And I wait until the page is ready
37
    And I wait until "Test category" "text" does not exist
38
    Then I should not see "Test category" in the "#customfield_catlist" "css_element"
39
 
40
  Scenario: Move field in the question custom fields to another category
41
    Given the following "custom field categories" exist:
42
      | name      | component          | area     | itemid |
43
      | Category1 | qbank_customfields | question | 0      |
44
      | Category2 | qbank_customfields | question | 0      |
45
      | Category3 | qbank_customfields | question | 0      |
46
    And the following "custom fields" exist:
47
      | name   | category  | type | shortname |
48
      | Field1 | Category1 | text | f1        |
49
      | Field2 | Category2 | text | f2        |
50
    When I log in as "admin"
51
    And I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
52
    Then "Field1" "text" should appear after "Category1" "text"
53
    And "Category2" "text" should appear after "Field1" "text"
54
    And "Field2" "text" should appear after "Category2" "text"
55
    And "Category3" "text" should appear after "Field2" "text"
56
    And I press "Move \"Field1\""
57
    And I follow "To the top of category Category2"
58
    And "Category2" "text" should appear after "Category1" "text"
59
    And "Field1" "text" should appear after "Category2" "text"
60
    And "Field2" "text" should appear after "Field1" "text"
61
    And "Category3" "text" should appear after "Field2" "text"
62
    And I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
63
    And "Category2" "text" should appear after "Category1" "text"
64
    And "Field1" "text" should appear after "Category2" "text"
65
    And "Field2" "text" should appear after "Field1" "text"
66
    And "Category3" "text" should appear after "Field2" "text"
67
    And I press "Move \"Field1\""
68
    And I follow "After field Field2"
69
    And "Field1" "text" should appear after "Field2" "text"
70
 
71
  Scenario: Reorder question custom field categories
72
    Given the following "custom field categories" exist:
73
      | name      | component          | area     | itemid |
74
      | Category1 | qbank_customfields | question | 0      |
75
      | Category2 | qbank_customfields | question | 0      |
76
      | Category3 | qbank_customfields | question | 0      |
77
    And the following "custom fields" exist:
78
      | name   | category  | type | shortname |
79
      | Field1 | Category1 | text | f1        |
80
    When I log in as "admin"
81
    And I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
82
    Then "Field1" "text" should appear after "Category1" "text"
83
    And "Category2" "text" should appear after "Field1" "text"
84
    And "Category3" "text" should appear after "Category2" "text"
85
    And I press "Move \"Category2\""
86
    And I follow "After \"Category3\""
87
    And "Field1" "text" should appear after "Category1" "text"
88
    And "Category3" "text" should appear after "Field1" "text"
89
    And "Category2" "text" should appear after "Category3" "text"
90
    And I navigate to "Plugins > Question bank plugins > Question custom fields" in site administration
91
    And "Field1" "text" should appear after "Category1" "text"
92
    And "Category3" "text" should appear after "Field1" "text"
93
    And "Category2" "text" should appear after "Category3" "text"
94
    And I press "Move \"Category2\""
95
    And I follow "After \"Category1\""
96
    And "Field1" "text" should appear after "Category1" "text"
97
    And "Category2" "text" should appear after "Field1" "text"
98
    And "Category3" "text" should appear after "Category2" "text"