I created some functional tests for a Symfony 4 project to test three different Controller methods that display lists of objects, but use the same general method in Symfony to build the list pages.
Each test method logs in, then visits the list page and reads how many elements are returned, such as:
* @param \FunctionalTester $I
public function assetsOnIndex(\FunctionalTester $I)
$defaultRpp = 20; // +1 for the header row
$I->seeNumberOfElements('.table-list tr', $defaultRpp + 1);
If I run all of the functional tests at once, I find that tests after the first one fail, and return a 500 error.
However, if I run any of the tests on their own, they all work.
The Codeception documentation mentions that this can happen if the requests are not isolated effectively.
Can anyone suggest a strategy or process that will help me isolate these tests so that they can be called back to back?