habitat icon indicating copy to clipboard operation
habitat copied to clipboard

Application tests

Open carlnewton opened this issue 1 year ago • 2 comments

Application tests that use an in-memory sqlite database and automatically populate the database with test fixtures creating scenarios. I ran into some issues getting the schema created automatically.

carlnewton avatar May 12 '24 10:05 carlnewton

I'm thinking that Cypress might be a good option for this now. I was originally going to use Symfony's application tests, but Cypress might be more robust and feature rich due to wider usage.

carlnewton avatar Jun 09 '24 18:06 carlnewton

I think it will be possible to reset the database with cypress with something like:

Cypress.Commands.add('resetDatabase', () => {
    cy.exec('docker exec habitat-apache-php php bin/console doctrine:fixtures:load --no-interaction', { failOnNonZeroExit: false });
});

carlnewton avatar Apr 26 '25 10:04 carlnewton

There's good enough coverage on this one for me to say that this is achieved now.

carlnewton avatar Jun 13 '25 12:06 carlnewton