ISAICP-5450: Make Cookie Consent step definitions reusable #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISAICP-5450
Description
In the Joinup project we are planning to replace our custom cookie consent solution with
oe_webtools_cookie_consent
(ref. Jira ticket ISAICP-5450).We would like to be able to use the step definitions defined in
WebtoolsCookieConsentContext
but these currently contain code that is specific to theoe_webtools
project and is related to the creating of certain media entities in the setup of the test scenarios and enabling/disabling modules needed for the scenarios.In projects using Behat, any code that is specific to the local test suite and is not intended to be reusable should be put in the
features/bootstrap/
folder. AllContext
classes in this folder are discovered and added to the autoloader when the Behat application is bootstrapped. This means they are not exposed to the global autoloader, so they cannot be instantiated by any PHP code except for Behat in scope of the current test suite.By moving the oe_webtools-specific code in this folder we can ensure that other projects can reuse the code in
WebtoolsCookieConsentContext
without risking to accidentally trigger the non-reusable code.Change log