1441 |
ariadna |
1 |
@core @javascript
|
|
|
2 |
Feature: Test collapsable section output module
|
|
|
3 |
In order to show extra information to the user
|
|
|
4 |
As a user
|
|
|
5 |
I need to interact with the collapsable section output
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
# Get to the fixture page.
|
|
|
9 |
Given I log in as "admin"
|
|
|
10 |
And I am on fixture page "/lib/tests/behat/fixtures/collapsable_section_output_testpage.php"
|
|
|
11 |
|
|
|
12 |
Scenario: Collapsable sections can be opened and closed
|
|
|
13 |
Given I should not see "Dialog content"
|
|
|
14 |
And I should not see "This is the closed section content." in the "closedsection" "region"
|
|
|
15 |
And I should see "This is the open section content." in the "opensection" "region"
|
|
|
16 |
When I click on "Expand" "button" in the "closedsection" "region"
|
|
|
17 |
And I click on "Collapse" "button" in the "opensection" "region"
|
|
|
18 |
Then I should see "This is the closed section content." in the "closedsection" "region"
|
|
|
19 |
And I should not see "This is the open section content." in the "opensection" "region"
|
|
|
20 |
|
|
|
21 |
Scenario: Collapsable sections content can have rich content inside
|
|
|
22 |
When I click on "Expand" "button" in the "closedsection" "region"
|
|
|
23 |
Then I should see "This is the closed section content." in the "closedsection" "region"
|
|
|
24 |
And "Link" "link" should exist in the "closedsection" "region"
|
|
|
25 |
And "Eye icon" "icon" should exist in the "closedsection" "region"
|
|
|
26 |
|
|
|
27 |
Scenario: Collapsable sections HTML attributtes can be overriden
|
|
|
28 |
When I click on "Expand" "button" in the "extraclasses" "region"
|
|
|
29 |
And I click on "Expand" "button" in the "extraattributes" "region"
|
|
|
30 |
Then ".extraclass" "css_element" should exist in the "extraclasses" "region"
|
|
|
31 |
And "[data-foo='bar']" "css_element" should exist in the "extraattributes" "region"
|
|
|
32 |
And "#myid" "css_element" should exist in the "extraattributes" "region"
|
|
|
33 |
|
|
|
34 |
Scenario: Collapsable sections can have custom labels for expand and collapse
|
|
|
35 |
When I click on "Custom expand" "button" in the "customlabels" "region"
|
|
|
36 |
Then I should see "This is the custom labels content." in the "customlabels" "region"
|
|
|
37 |
And I click on "Custom collapse" "button" in the "customlabels" "region"
|
|
|
38 |
And I should not see "This is the custom labels content." in the "customlabels" "region"
|
|
|
39 |
|
|
|
40 |
Scenario: Collapsable sections can be controlled via javascript
|
|
|
41 |
# Toggle.
|
|
|
42 |
Given I should not see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
43 |
When I click on "Toggle" "button" in the "jscontrols" "region"
|
|
|
44 |
Then I should see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
45 |
And I click on "Toggle" "button" in the "jscontrols" "region"
|
|
|
46 |
And I should not see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
47 |
# Show and Hide.
|
|
|
48 |
And I click on "Show" "button" in the "jscontrols" "region"
|
|
|
49 |
And I should see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
50 |
And I click on "Show" "button" in the "jscontrols" "region"
|
|
|
51 |
And I should see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
52 |
And I click on "Hide" "button" in the "jscontrols" "region"
|
|
|
53 |
And I should not see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
54 |
And I click on "Hide" "button" in the "jscontrols" "region"
|
|
|
55 |
And I should not see "This is the javascript controls content." in the "jscontrols" "region"
|
|
|
56 |
# Test state.
|
|
|
57 |
And I click on "Test state" "button" in the "jscontrols" "region"
|
|
|
58 |
And I should see "hidden" in the "state" "region"
|
|
|
59 |
And I click on "Show" "button" in the "jscontrols" "region"
|
|
|
60 |
And I click on "Test state" "button" in the "jscontrols" "region"
|
|
|
61 |
And I should see "visible" in the "state" "region"
|
|
|
62 |
# Events.
|
|
|
63 |
And I click on "Show" "button" in the "jscontrols" "region"
|
|
|
64 |
And I should see "Last event: Section shown" in the "jscontrols" "region"
|
|
|
65 |
And I click on "Hide" "button" in the "jscontrols" "region"
|
|
|
66 |
And I should see "Last event: Section hidden" in the "jscontrols" "region"
|