MDL-62514 behat: Rewrite handling of autocomplete
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 21 May 2018 23:49:14 +0000 (07:49 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 30 Jan 2019 00:24:32 +0000 (08:24 +0800)
commite994dea0b3b583056d7738c184b0ede242afdcba
treedfee558d3bfb6446824b048cee97261813a9af74
parent7bfb575f633d5a828afd4be41525d7c16cbf60cb
MDL-62514 behat: Rewrite handling of autocomplete

This includes a minor restructure of the autocomplete JS to make use of
promises and improve tracking of pending JS.

In particular it improves the way in which throttled text input is
handled to ensure that the behat does not continue until:
- typing is fully complete; and
- all possible ajax requests have been sent; and
- all possible ajax requests complete; and
- the suggestions are updated.

A number of conditions existed where behat would move on to the next
step too early in a race condition effect between Behat and Autocomplete.
lib/amd/build/form-autocomplete.min.js
lib/amd/src/form-autocomplete.js
lib/behat/form_field/behat_form_autocomplete.php
lib/templates/form_autocomplete_input.mustache
mod/feedback/tests/behat/coursemapping.feature
theme/boost/templates/core/form_autocomplete_input.mustache
theme/upgrade.txt