Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 2... Línea 2...
2
Feature: disabledIf functionality in forms
2
Feature: disabledIf functionality in forms
3
  For forms including disabledIf functions
3
  For forms including disabledIf functions
4
  As a user
4
  As a user
5
  If I trigger the disabledIf condition then the form elements will be disabled
5
  If I trigger the disabledIf condition then the form elements will be disabled
Línea 6... Línea 6...
6
 
6
 
7
  Background:
7
  # Note: if you are looking for the Behat tests for the filepicker widget,
Línea 8... Línea 8...
8
    Given I log in as "admin"
8
  # you will find them in repository/tests/behat.
9
 
9
 
10
  Scenario: The file manager is disabled when disabledIf conditions are met
10
  Scenario: The file manager is disabled when disabledIf conditions are met
11
    Given I am on fixture page "/lib/form/tests/behat/fixtures/filemanager_hideif_disabledif_form.php"
11
    Given I am on the "filemanager_hideif_disabledif_form" "core_form > Fixture" page logged in as "admin"
12
    When I click on "Disable" "radio"
12
    When I click on "Disable" "radio"
13
    # Test standard file manager.
13
    # Test standard file manager.
14
    Then the "disabled" attribute of "input#id_some_filemanager" "css_element" should contain "true"
14
    Then the "disabled" attribute of "input#id_some_filemanager" "css_element" should contain "true"
Línea 15... Línea 15...
15
    # Test file manager in a group.
15
    # Test file manager in a group.
-
 
16
    And the "disabled" attribute of "input#id_filemanager_group_some_filemanager_group" "css_element" should contain "true"
16
    And the "disabled" attribute of "input#id_filemanager_group_some_filemanager_group" "css_element" should contain "true"
17
 
17
 
18
  Scenario: The static element is disabled when 'eq' disabledIf conditions are met
18
  Scenario: The static element is disabled when 'eq' disabledIf conditions are met
19
    Given I log in as "admin"
19
    Given I am on fixture page "/lib/form/tests/behat/fixtures/static_hideif_disabledif_form.php"
20
    And I am on fixture page "/lib/form/tests/behat/fixtures/static_hideif_disabledif_form.php"
20
    And I should see "Static with form elements"
21
    And I should see "Static with form elements"
21
    When I click on "Disable" "radio"
22
    When I click on "Disable" "radio"
22
    And the "class" attribute of "#fitem_id_some_static" "css_element" should contain "text-muted"
23
    And the "class" attribute of "#fitem_id_some_static" "css_element" should contain "text-muted"
23
    And the "disabled" attribute of "input#id_some_static_username" "css_element" should contain "true"
24
    And the "disabled" attribute of "input#id_some_static_username" "css_element" should contain "true"
24
    And the "disabled" attribute of "Check" "button" should contain "true"
25
    And the "disabled" attribute of "Check" "button" should contain "true"
25
    Then I click on "Enable" "radio"
26
    Then I click on "Enable" "radio"
-
 
27
    And the "class" attribute of "#fitem_id_some_static" "css_element" should not contain "text-muted"
-
 
28
    And the "#id_some_static_username" "css_element" should be enabled
-
 
29
    And the "class" attribute of "Check" "button" should not contain "disabled"
-
 
30
 
-
 
31
  Scenario: The file picker element is disabled when 'eq' disabledIf conditions are met
-
 
32
    Given I am on the "filepicker_hideif_disabledif_form" "core_form > Fixture" page logged in as "admin"
-
 
33
    And the "#id_filepicker" "css_element" should be enabled
-
 
34
    When I click on "Disable" "radio"
-
 
35
    Then the "#id_filepicker" "css_element" should be disabled
-
 
36
 
-
 
37
  @_file_upload
-
 
38
  Scenario: The other element is disabled when the file picker is not empty
-
 
39
    Given I am on the "filepicker_hideif_disabledif_form" "core_form > Fixture" page logged in as "admin"
-
 
40
    When I upload "lib/ddl/tests/fixtures/xmldb_table.xml" file to "File picker" filemanager
-
 
41
    Then the "inputtext1" "field" should be disabled
-
 
42
 
-
 
43
  Scenario Outline: Inputs are disabled when disabledIf conditions dependent on a multi-select element are met
-
 
44
    Given I am on the "multiselect_hideif_disabledif_form" "core_form > Fixture" page logged in as "admin"
-
 
45
    When I set the field "multiselect1" to "<selection>"
-
 
46
    Then the "#id_disabledIfEq_" "css_element" should be <enabledEq_>
-
 
47
    And the "#id_disabledIfIn_" "css_element" should be <enabledIn_>
-
 
48
    And the "#id_disabledIfNeq_" "css_element" should be <enabledNeq_>
-
 
49
    And the "#id_disabledIfEq1" "css_element" should be <enabledEq1>
-
 
50
    And the "#id_disabledIfIn1" "css_element" should be <enabledIn1>
-
 
51
    And the "#id_disabledIfNeq1" "css_element" should be <enabledNeq1>
-
 
52
    And the "#id_disabledIfEq12" "css_element" should be <enabledEq12>
-
 
53
    And the "#id_disabledIfIn12" "css_element" should be <enabledIn12>
-
 
54
    And the "#id_disabledIfNeq12" "css_element" should be <enabledNeq12>
-
 
55
 
-
 
56
    Examples:
-
 
57
      | selection          | enabledEq_ | enabledIn_ | enabledNeq_ | enabledEq1 | enabledIn1 | enabledNeq1 | enabledEq12 | enabledIn12 | enabledNeq12 |
-
 
58
      |                    | disabled   | disabled   | enabled     | enabled    | enabled    | disabled    | enabled     | enabled     | disabled     |