We've upgraded SilverStripe core to PHPUnit 4.x now, and the Functions.php has moved locations.
Since all custom contexts either use one of these contexts, or extend off SilverStripeContext,
we can be certain that the required assertions are automatically included for custom contexts,
no need to duplicate the require_once() calls.
Note that Behat 3.x suggests using static methods on a class, e.g. PHPUnit_Framework_Assert::assertSame (see http://docs.behat.org/en/master/quick_intro.html).
This seems quite verbose, and increases the upgrade burden on any project using Behat.
The issue that prompted this change was that at line 361, if an exception needed to be thrown, it would be thrown with $field being a NodeElement rather than a string, causing a Catchable Fatal Error to be thrown in ElementNotFoundException::__construct#46 (can't convert object of type NodeElement to string).
The dual use of regions (CSS selector and natural language name)
causes some difficulties in processing. Since the CSS selector
is tried first, we need to ensure the underlying logic
doesn't bail on invald selector syntax.
See https://github.com/silverstripe-labs/silverstripe-behat-extension/pull/84
TestSessionEnvironment by default will create a temporary database for
use with behat tests, but this may not be required.
e.g. in your behat.yml:
```
default:
...
extensions:
...
SilverStripe\BehatExtension\Extension:
create_temp_database: false
```
This fix improves the robustness of the behat tests, ensuring that the testsession has actually
been successfully started before the test kicks off. Although it doesn't fix anything that
wasn't previously broken, it makes environment set-up errors a bit easier to figure out.
It looks for a new status comment in the result of testsession, that is also being added to the
module.
- Moved all extension-specific conf into its own configuration namespace
- Described configuration via PHP, and added default values
- Removed boilerplate config from README
- Made screenshot_path optional
- Configurable ajax_timeout settings
Note: The DI system plus the initializer+context combo requires insane amounts of code duplication,
will need to be looked at more closely (very little docs on that level of Behat extension available).