Behat and my current DB

Re: Behat and my current DB

by Davo Smith -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
No you cannot.

The whole point of Behat tests is that they run against a clean database, with known configuration (i.e. the specific configuration created by the Behat tests themselves). Even if you could add your database and configuration, all it would prove is that your site doesn't match the starting configuration for a Behat site (for example, a test that created 3 courses, then generated a report on the courses on the site, will be expecting to see 3 courses in the report, which won't be the case if your site data was present).

You can, of course, start with all of your plugins (including your theme) present in the code - in which case, running Behat tests will include the tests for those plugins. This will test that those plugins are working as expected (assuming they include tests) and that they aren't breaking any of the standard tests (although, sadly, there are occasions whereby 3rd-party plugins will break the underlying assumptions of the core tests).