AutorÃa | Ultima modificación | Ver Log |
@core @javascript @core_formFeature: Autocomplete functionality in formsFor forms including autocomplete elementsAs a userI need to use the autocomplete form elementScenario: Use autocomplete element which accepts a single valueGiven the following "users" exist:| username | firstname | lastname || user1 | Jane | Jones || user2 | Sam | Smith |And I log in as "admin"When I navigate to "Users > Privacy and policies > Data requests" in site administrationAnd I follow "New request"And I open the autocomplete suggestions listAnd I click on "Jane Jones" item in the autocomplete listThen "Jane Jones" "autocomplete_selection" should exist# Change selectionAnd I open the autocomplete suggestions listAnd I click on "Sam Smith" item in the autocomplete listAnd "Sam Smith" "autocomplete_selection" should existAnd "Jane Jones" "autocomplete_selection" should not exist# Remove selectionAnd I click on "Sam Smith" "autocomplete_selection"And "Sam Smith" "autocomplete_selection" should not existAnd I should see "No selection" in the ".form-autocomplete-selection" "css_element"@javascriptScenario: Single-select autocomplete can be cleared after being setGiven the following "courses" exist:| fullname | shortname || Course 1 | C1 |And I am on the "autocomplete-disabledif" "core_form > Fixture" page logged in as "admin"When I set the field "Controls the rest" to "Course 1"And "Course 1" "autocomplete_selection" should be visibleAnd I click on "Course 1" "autocomplete_selection"Then "frog" "autocomplete_selection" should not exist@javascriptScenario: Single-select autocomplete can be cleared immediately after page loadGiven the following "courses" exist:| fullname | shortname || Course 1 | C1 |And I am on the "autocomplete-disabledif" "core_form > Fixture" page logged in as "admin"When I set the field "Controls the rest" to "Course 1"And I press "Save changes"And "Course 1" "autocomplete_selection" should be visibleAnd I click on "Course 1" "autocomplete_selection"Then "frog" "autocomplete_selection" should not exist@javascriptScenario: Autocomplete can control other form fields via disabledIfGiven the following "courses" exist:| fullname | shortname || Course 1 | C1 |And I am on the "autocomplete-disabledif" "core_form > Fixture" page logged in as "admin"When I set the field "Controls the rest" to "Course 1"Then the "Single select will be enabled if the control is blank" "field" should be disabledAnd the "Single select will be disabled if the control is blank" "field" should be enabledAnd I click on "Course 1" "autocomplete_selection"And the "Single select will be enabled if the control is blank" "field" should be enabledAnd the "Single select will be disabled if the control is blank" "field" should be disabled@javascriptScenario: Single-select autocomplete can be cleared after being set and suggestion list reloadedGiven the following "users" exist:| username | firstname | lastname || user1 | Jane | Jones || user2 | Sam | Smith || user3 | Mark | Davis |And I log in as "admin"When I navigate to "Server > Web services > Manage tokens" in site administrationAnd I press "Create token"And I open the autocomplete suggestions listAnd I click on "Jane Jones" item in the autocomplete listThen "Jane Jones" "autocomplete_selection" should exist# Only reload de sugestion listAnd I open the autocomplete suggestions list# Remove selectionAnd I click on "Jane Jones" "autocomplete_selection"And "Jane Jones" "autocomplete_selection" should not existAnd I should see "No selection" in the ".form-autocomplete-selection" "css_element"