AutorÃa | Ultima modificación | Ver Log |
@core @javascriptFeature: Test dropdown output moduleIn order to show extra information to the userAs a userI need to interact with the dropdown output modulesBackground:# Get to the fixture page.Given I log in as "admin"And I am on fixture page "/lib/tests/behat/fixtures/dropdown_output_testpage.php"And I should not see "Dialog content"Scenario: User can open a dropdown dialogWhen I click on "Open dialog" "button" in the "regularscenario" "region"Then I should see "Dialog content" in the "regularscenario" "region"Scenario: Dropdown dialog can have rich content insideWhen I click on "Open dialog" "button" in the "richcontent" "region"Then I should see "Some rich content" in the "richcontent" "region"And "Link 1" "link" should exist in the "richcontent" "region"And "Eye icon" "icon" should exist in the "richbutton" "region"Scenario: HTML attributtes can be overriden in dropdownsWhen I click on "Open dialog" "button" in the "cssoverride" "region"Then I should see "Dialog content" in the "cssoverride" "region"And ".extraclass" "css_element" should exist in the "cssoverride" "region"And "[data-foo='bar']" "css_element" should exist in the "extraattributes" "region"And I should see "Custom ID button found" in the "customid" "region"And "#CustomDropdownButtonId" "css_element" should exist in the "customid" "region"And ".dialog-big" "css_element" should exist in the "widths" "region"And ".dialog-small" "css_element" should exist in the "widths" "region"Scenario: User can open a dropdown statusWhen I click on "Open dialog" "button" in the "statusregularscenario" "region"Then I should see "Option 1" in the "statusregularscenario" "region"And I should see "Option 1 description" in the "statusregularscenario" "region"And I should see "Option 2" in the "statusregularscenario" "region"And I should see "Option 2 description" in the "statusregularscenario" "region"And "Eye icon 1" "icon" should exist in the "statusregularscenario" "region"And "Eye icon 2" "icon" should exist in the "statusregularscenario" "region"Scenario: Dropdown status can have as selected optionWhen I click on "Open dialog" "button" in the "statusselectedscenario" "region"Then "Selected" "icon" in the "#statusselectedscenario [data-optionnumber='2']" "css_element" should be visibleAnd "Selected" "icon" in the "#statusselectedscenario [data-optionnumber='1']" "css_element" should not be visibleAnd "Selected" "icon" in the "#statusselectedscenario [data-optionnumber='3']" "css_element" should not be visibleScenario: Dropdown status can have a disabled optionWhen I click on "Open dialog" "button" in the "statusdisablescenario" "region"Then ".disabled" "css_element" should exist in the "#statusdisablescenario [data-optionnumber='2']" "css_element"And ".disabled" "css_element" should not exist in the "#statusdisablescenario [data-optionnumber='1']" "css_element"And ".disabled" "css_element" should not exist in the "#statusdisablescenario [data-optionnumber='3']" "css_element"Scenario: Dropdown status can have a extra attribute in the optionsWhen I click on "Open dialog" "button" in the "statusoptionextrasscenario" "region"Then "[data-foo='bar']" "css_element" should exist in the "#statusoptionextrasscenario [data-optionnumber='2']" "css_element"And "[data-foo='bar']" "css_element" should not exist in the "#statusoptionextrasscenario [data-optionnumber='1']" "css_element"And "[data-foo='bar']" "css_element" should not exist in the "#statusoptionextrasscenario [data-optionnumber='3']" "css_element"Scenario: Dropdown status can define urls in optionsGiven I should see "Foo param value: none"When I click on "Open dialog" "button" in the "statusoptionurl" "region"And I click on "Option 2" "link" in the "statusoptionurl" "region"Then I should see "Foo param value: bar"Scenario: Dropdowns dialogs can be controlled via javascriptGiven "Open dialog" "button" should exist in the "dialogjscontrolssection" "region"And I should see "The dropdown is hidden" in the "dialogjscontrolssection" "region"# Change button text.When I click on "Change button text" "button" in the "dialogjscontrolssection" "region"Then "New button text" "button" should exist in the "dialogjscontrolssection" "region"# Open dropdown.And I click on "Open" "button" in the "dialogjscontrolssection" "region"And I should see "Dialog content" in the "dialogjscontrolssection" "region"And I should see "The dropdown is visible" in the "dialogjscontrolssection" "region"# Close dropdown.And I click on "Close" "button" in the "dialogjscontrolssection" "region"And I should not see "Dialog content" in the "dialogjscontrolssection" "region"And I should see "The dropdown is hidden" in the "dialogjscontrolssection" "region"Scenario: Dropdown status can sync the clicked option with the button textGiven I should see "Option 2" in the "statussyncbutton" "region"When I click on "Option 2" "button" in the "statussyncbutton" "region"And "Selected" "icon" in the "#statussyncbutton [data-optionnumber='2']" "css_element" should be visibleAnd "Selected" "icon" in the "#statussyncbutton [data-optionnumber='3']" "css_element" should not be visibleAnd I click on "Option 3" "link" in the "statussyncbutton" "region"Then I should see "Option 3" in the "statussyncbutton" "region"And I should not see "Option 2" in the "statussyncbutton" "region"And I click on "Option 3" "button" in the "statussyncbutton" "region"And "Selected" "icon" in the "#statussyncbutton [data-optionnumber='2']" "css_element" should not be visibleAnd "Selected" "icon" in the "#statussyncbutton [data-optionnumber='3']" "css_element" should be visibleScenario: Dropdowns status can be controlled via javascriptGiven "Open dialog" "button" should exist in the "statusjscontrolsection" "region"And I should see "The status value is option2" in the "statusjscontrolsection" "region"# Change value.When I click on "Change selected value" "button" in the "statusjscontrolsection" "region"Then I should see "The status value is option3" in the "statusjscontrolsection" "region"And I click on "Open dialog" "button" in the "statusjscontrolsection" "region"And "Selected" "icon" in the "#statusjscontrolsection [data-optionnumber='2']" "css_element" should not be visibleAnd "Selected" "icon" in the "#statusjscontrolsection [data-optionnumber='3']" "css_element" should be visible# Enable button sync.And I click on "Enable sync" "button" in the "statusjscontrolsection" "region"And I should see "Option 3" in the "statusjscontrolsection" "region"And I click on "Option 3" "button" in the "statusjscontrolsection" "region"And I click on "Option 2" "link" in the "statusjscontrolsection" "region"And I should see "The status value is option2" in the "statusjscontrolsection" "region"And I should see "Option 2" in the "statusjscontrolsection" "region"# Trigger change event with button text sync.And I click on "Change selected value" "button" in the "statusjscontrolsection" "region"And I should see "Option 3" in the "statusjscontrolsection" "region"And I should see "The status value is option3" in the "statusjscontrolsection" "region"# Disable button text sync.And I click on "Disable sync" "button" in the "statusjscontrolsection" "region"And I click on "Option 3" "button" in the "statusjscontrolsection" "region"And I click on "Option 1" "link" in the "statusjscontrolsection" "region"And I should see "Option 3" in the "statusjscontrolsection" "region"And I should see "The status value is option1" in the "statusjscontrolsection" "region"And I click on "Change selected value" "button" in the "statusjscontrolsection" "region"And I should see "Option 3" in the "statusjscontrolsection" "region"And I should see "The status value is option2" in the "statusjscontrolsection" "region"# Disable update.And I click on "Disable update" "button" in the "statusjscontrolsection" "region"And I click on "Option 3" "button" in the "statusjscontrolsection" "region"And I click on "Option 1" "link" in the "statusjscontrolsection" "region"And I should see "The status value is option2" in the "statusjscontrolsection" "region"And I click on "Option 3" "button" in the "statusjscontrolsection" "region"And "Selected" "icon" in the "#statusjscontrolsection [data-optionnumber='1']" "css_element" should not be visibleAnd "Selected" "icon" in the "#statusjscontrolsection [data-optionnumber='2']" "css_element" should be visibleScenario: Dropdown status content is accessible with keyboardGiven I click on "Focus helper" "button" in the "statussyncbutton" "region"When I press the tab key# Open and close dropdown with enter key.Then I press the enter keyAnd the focused element is "[data-for='dropdowndialog_button']" "css_element" in the "statussyncbutton" "region"And I should see "Option 1" in the "statussyncbutton" "region"And I press the enter keyAnd the focused element is "[data-for='dropdowndialog_button']" "css_element" in the "statussyncbutton" "region"And I should not see "Option 1" in the "statussyncbutton" "region"# Open and close with down and up keys.And I press the down keyAnd the focused element is "[data-optionnumber='1'] a" "css_element" in the "statussyncbutton" "region"And I should see "Option 1" in the "statussyncbutton" "region"And I press the up keyAnd the focused element is "[data-for='dropdowndialog_button']" "css_element" in the "statussyncbutton" "region"And I should see "Option 1" in the "statussyncbutton" "region"And I press the up keyAnd the focused element is "[data-for='dropdowndialog_button']" "css_element" in the "statussyncbutton" "region"And I should not see "Option 1" in the "statussyncbutton" "region"# Select to option 3 and check user cannot go beyond that.And I press the down keyAnd the focused element is "[data-optionnumber='1'] a" "css_element" in the "statussyncbutton" "region"And I press the down keyAnd the focused element is "[data-optionnumber='2'] a" "css_element" in the "statussyncbutton" "region"And I press the down keyAnd the focused element is "[data-optionnumber='3'] a" "css_element" in the "statussyncbutton" "region"And I press the down keyAnd the focused element is "[data-optionnumber='3'] a" "css_element" in the "statussyncbutton" "region"And I press the enter keyAnd I should see "Option 3" in the "statussyncbutton" "region"# Close dropdown with escape key.And I press the down keyAnd the focused element is "[data-optionnumber='1'] a" "css_element" in the "statussyncbutton" "region"And I should see "Option 1" in the "statussyncbutton" "region"And I press the escape keyAnd the focused element is "[data-for='dropdowndialog_button']" "css_element" in the "statussyncbutton" "region"And I should not see "Option 1" in the "statussyncbutton" "region"