1 |
efrain |
1 |
@core
|
|
|
2 |
Feature: Choice dropdown form behat test
|
|
|
3 |
In order to use choicelist in quickforms
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to test it via behat
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given I log in as "admin"
|
|
|
9 |
And I am on fixture page "/lib/form/tests/behat/fixtures/field_choicedropdown_testpage.php"
|
|
|
10 |
|
|
|
11 |
Scenario: Set some value into choice dropdown
|
|
|
12 |
When I set the field "Basic choice dropdown" to "Text option 2"
|
|
|
13 |
And I click on "Send form" "button"
|
|
|
14 |
Then I should see "example0: option2" in the "submitted_data" "region"
|
|
|
15 |
|
|
|
16 |
@javascript
|
|
|
17 |
Scenario: Set some value into choice dropdown with javascript enabled
|
|
|
18 |
When I set the field "Basic choice dropdown" to "Text option 2"
|
|
|
19 |
And I click on "Send form" "button"
|
|
|
20 |
Then I should see "example0: option2" in the "submitted_data" "region"
|
|
|
21 |
|
|
|
22 |
@javascript
|
|
|
23 |
Scenario: Disable choice dropdown via javascript
|
|
|
24 |
When I click on "Check to disable the first choice dropdown field." "checkbox"
|
|
|
25 |
Then the "Disable if example" "field" should be disabled
|
|
|
26 |
|
|
|
27 |
@javascript
|
|
|
28 |
Scenario: Hide choice dropdown via javascript
|
|
|
29 |
Given I should see "Hide if example"
|
|
|
30 |
When I click on "Check to hide the first choice dropdown field." "checkbox"
|
|
|
31 |
Then I should not see "Hide if example"
|
|
|
32 |
|
|
|
33 |
@javascript
|
|
|
34 |
Scenario: Use a choice dropdown to disable and hide other fields
|
|
|
35 |
Given I should not see "Hide if element"
|
|
|
36 |
And the "Disabled if element" "field" should be disabled
|
|
|
37 |
When I set the field "Control choice dropdown" to "Show or enable subelements"
|
|
|
38 |
Then I should see "Hide if element"
|
|
|
39 |
And the "Disabled if element" "field" should be enabled
|
|
|
40 |
And I set the field "Control choice dropdown" to "Hide or disable subelements"
|
|
|
41 |
And I should not see "Hide if element"
|
|
|
42 |
And the "Disabled if element" "field" should be disabled
|