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.