Testing Strategy
Our testing strategy is designed to ensure the reliability and robustness of our applications while supporting a sustainable development process. We use Vitest and Playwright for testing, with plans to expand our test suites and integrate testing more deeply into our CI/CD pipelines.
Vitest
Vitest is a JavaScript testing framework that is optimized for the Vite ecosystem. It is designed to be a fast and lightweight tool for unit and integration testing. Vitest utilizes Vite's native ES modules support, which allows it to start up quickly and execute tests with minimal overhead.
Vitest documentation can be found here.
Current Use:
Currently, we have a modest number of tests implemented with Vitest, focusing primarily on critical functionalities. While we do not enforce strict test coverage thresholds, we highly encourage the addition of tests, especially for new features and bug fixes.
Playwright
Playwright is a framework for end-to-end testing of web applications across modern browsers. It allows for reliable simulations of user interactions, making it an invaluable tool for ensuring our applications behave as expected in real-world scenarios.
More information about playwright can be found in our playwright guide here.
Current Use:
Playwright tests are not yet integrated into our CI/CD workflow. However, we plan to increase the use of Playwright for automated browser testing, given its ability to test across multiple browser environments seamlessly.
Automated Testing
In addition to our in-house testing efforts, we have an automated testing setup in a separate repository. This setup involves a framework developed by GoTech, a consulting company. This framework is essentially a wrapper over Playwright, tailored to meet our specific testing needs.
Integration Plans:
This automated testing suite is scheduled to be integrated into our pull request (PR) process once the existing test suites are evaluated and updated for consistency and coverage. The integration will help ensure that all new code contributions are verified against our functional and regression test cases before merging.
Future Enhancements
GoTech will soon provide us with a detailed presentation on their testing framework, explaining the underlying principles and demonstrating its usage with practical examples. Following this presentation, I will update this section to include detailed information on how to utilize their custom Playwright wrapper effectively.
Key Points for Future Testing Strategy:
- Expanding Test Coverage: We aim to expand our test coverage by adding more comprehensive unit and integration tests using Vitest.
- CI/CD Integration: Integrating our testing frameworks into the CI/CD pipeline to automate testing processes and ensure code quality before deployment.
- Learning and Development: Encourage ongoing learning about testing practices and tools among the team, ensuring everyone can contribute to our testing efforts effectively.