#! code: Drupal 10: Using Default Content Deploy To Create Testing Content

Performing behavioural testing on a Drupal project allows you to make sure that all of your features work as they should do. This is especially important when you update code as this can introduce bugs that are otherwise time consuming or difficult to spot.

One aspect that is important to behavioural tests is the content of the site, which is often integral to many Drupal sites functioning correctly. Many Drupal sites have taxonomy terms that are used in views to filter content in one way or another.

There are also structure pages that are used as signposts to other parts of the site, and they are often important in navigation. Whilst you could just visit the pages directly, it's often useful to test the user journey end-to-end, which involves being able to navigate to the functionality being tested.

One approach to ensuring the site contains content is to copy the production database into the testing environment. Using the production database for testing has several disadvantages, not least of which is the complexity of copying the data across in the first place. Some production databases are very large and so importing this into the test environment can cause tests to take many hours to complete.

The biggest problem, though, is making sure that your development site doesn't contain any personal information as this is a security concern and can even cause problems like sending test emails to users. Whilst there are ways around this, teams can often spend quite a lot of time ensuring that there is no personally identifiable information at rest in your test environment.

A better approach to this is to use default content to create a Drupal site so that is in a known state before tests are run. This means that the site will function in the same way as the production site, just without all of the personal information. The idea behind this approach is that you create a known test environment for tests to run.

Read more

PubDate

Tags