Google Summer of Code
#GSoC Empowering Tomorrow's Coders: Igniting, Innovating, and Inspiring Mauticians of the Future with Google Summer of Code.
Week 7-8: End-to-end test suite for Mautic - Building a Fortress of Tests
Hi everyone!
I'm excited to share the latest updates on the project. We've significantly expanded our test suite and automated the database population process. Let's break down the highlights:
Expanding the test suite:
Last week, we built a solid foundation for writing clean and efficient tests using Page Objects and Step Objects. This week we expanded the test suite to cover a wide range of scenarios, including:
- Individual Contact Tests: We've written tests to verify that creating, editing, deleting, and viewing contacts works as expected.
- Batch Operations: We've tested batch operations like import, batch delete, and changing segments.
Automating Database Population with DbHelper:
Previously, we relied on a simple SQL dump file to populate the database for our tests. While this worked initially, it wasn't ideal for long-term maintainability. This week, we introduced a new class called DbHelper to automate the database population process.
What is DbHelper?
DbHelper is a helper class that resides in the tests/_support directory. It provides methods to manage the test database automatically.
How DbHelper Works?
Checks if the dump.sql file exists in the tests/_data directory.
- If the file exists, it populates the database from the dump.
- If the file doesn't exist:
- It prepares a fresh database environment by:
- Dropping and creating the database using Doctrine commands.
- Installing any necessary fixtures.
- Generates a new dump.sql file by dumping the current database schema.
DbHelper guarantees that tests run against a known and consistent database state.
Next week’s focus:
The coming weeks will be focused on:
- Completing contacts bundle tests.
- Utilizing the test database to ensure isolation from the production environment and prevent unintended side effects.
Stay tuned for more updates!
Feel free to ask any questions in the comments below.
Reportar um problema
Este conteúdo é impróprio?
0 comentários
Carregando comentários ...
Adicione seu comentário
Inscreva-se com sua conta ou sign up para adicionar seu comentário.
Carregando comentários ...