Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Now that we've got a pretty good body of Behat tests going, there's starting to be some pretty clear ways we could refactor them to make it easier to create new tests and maintain the existing ones.
Here are some of the things I'd like to do:
- #2291961: Create a panopoly_test module to hold Views and Content Types for testing
Reduce repetition in tests by creating custom Given steps. We have loads of tests that setup essentially the same context. Reducing repetition would make maintenance easier.- #2154225: Switch Behat widget tests to use "Landing page"
- Audit permissions levels and reduce to the lowest possible to complete a test. Right now, I think we're using the "administrator" role for pretty much every test. We should reduce this to the lowest level capable of completing a test in order to also test that permissions are set correctly. #2372063: Audit permissions levels used in Behat tests
- Replace all field names with the label wherever possible. When we first started writing tests, some labels where missing (due to a bug in panopoly_admin: #2151657: Use #title_display rather than unsetting #title for better accessibility) and we hadn't started using regions yet (so, some labels were ambiguous). This led to us using field names rather than labels early on, much of which got copy-pasted into loads of other tests. The test are more readable and future proof using the labels, so we should switch to them where possible.
- #2370527: Use 'imports' in behat.yml files to share common configuration
- #2267555: Parameterize tests as much as possible so they work in child distributions
- #2291813: Move functionality from .travis.yml into a proper script
- #2293747: Move our FeatureContext and *.features into panopoly_test so that child distributions can reuse them
- #2293753: Refactor scripts/travis-ci.sh so that child distributions can use it
Comments
Comment #1
dsnopekComment #2
dsnopekComment #3
dsnopekUpdated now that #2154225: Switch Behat widget tests to use "Landing page" is in, and including #2267555: Parameterize tests as much as possible so they work in child distributions.
Comment #4
dsnopekComment #5
dsnopekCreated a child issue for #2291961: Create a panopoly_test module to hold Views and Content Types for testing.
Comment #6
dsnopekComment #7
cboyden CreditAttribution: cboyden commentedAdded a child issue for importing common Behat config.
Comment #8
dsnopekWe've made a lot of headway on point #2, so I crossed it out. And I added a child issue for point #4, which was the only one missing a child issue that wasn't already complete.
Comment #9
dsnopekComment #10
dsnopekI'm going to mark this one as closed: the bulk of the work is finished and the remaining tasks have child issues.