MDL-67668 behat: Share behat_behat functionality with forms
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 10 Nov 2020 07:10:30 +0000 (15:10 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 23 Nov 2020 01:00:46 +0000 (09:00 +0800)
commite29e8373e67c4381e14580483e376d0b76f4df39
treed61ea930ce087a1f56ff338b3dcf3477af3ee3d5
parent9e11009eb1b2999f4493baddaa600302131d54a3
MDL-67668 behat: Share behat_behat functionality with forms

Behat form fields are implemented in a way completely isolated from the
rest of the Behat Context system. Whereas regular step definitions have
access to execute steps, to call `find`, check for JS running, and other
related functionality, the Moodle implementation of a field type does
not have any access to this.

By moving the core functionality of behat_base to a new trait, and the
constants to a new interface, the functionality can also be used in
behat form fields in the same way as elsewhere.
lib/behat/behat_base.php
lib/behat/classes/behat_session_interface.php [new file with mode: 0644]
lib/behat/classes/behat_session_trait.php [new file with mode: 0644]