This change is designed to be merged in at the same time as the matching
testsession PR (silverstripe-labs/silverstripe-testsession#7) is merged in, as
it relies on changes introduced in that PR to function.
This updates the behat-extension to use the new file-based capabilities of the
testsession module. Instead of creating a temp database, it will create an
entire testsession in the initializer, and then continue on as per normal. When
Behat runs end, the cleanup code will completely remove the testsession state,
instead of just removing the temp database. This may mean in the future that
you can hook into the TestSessionEnvironment via extensions, and connect to
other test services during a testsession, then cleanup after yourself on ending
a test session.
API CHANGES:
- Remove SilverStripeAwareInitializer::initializeTempDb()
- Remove SilverStripeAwareInitializer::deleteTempDb()
stepIAmNotLoggedIn() would previously just kill the test
session, but this has the side effect of losing the current testsession
temporary database, so this causes steps of logging out to fail the
rest of the steps in a scenario.
See https://github.com/silverstripe-labs/silverstripe-behat-extension/pull/12
Allows for a step like: `I select "Admins" from "Groups" input group`
Adding it to BasicContext as it seems useful to be used in
other places, not just the CMS admin interface. It could be used
frontend forms that use CheckboxSetField, or OptionsetField,
for example.
Thanks to @srizzling for writing the definition for this step!
Was referencing outdated $this->context settings
instead of parent context. Still a bit hacky to make
assumptions on parent context, but its difficult to pass
through arguments to subcontexts.
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.
Removed framework_host since its no longer necessary due to the changed execution logic.
Unfortunately had to subclass the existing Mink Extension class since we can't influence
its config persistence from our own extensions (with a completely separate ContainerBuilder).
Also restructured README to be more focused on execution rather
than diving into deep config concerns early on.
Important for running behat tests per-module,
while stil keeping parameters like "base_url" configurable
without modifying behat.yml files in the modules own source code.
- 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).