I'm trying to ask what is the best practice for automatic (ci/cd) end to end tests in web apps?
我想问一下,在Web应用程序中进行自动(CI/CD)端到端测试的最佳实践是什么?
To be honest, I'm not sure what is the best approach for CI/CD end to end tests with playwright, node/express backend, mongodb, and react frontend. I have an app that can be deployed with docker-compose but when it's deployed the empty database is automatically populated through migrations but can take up to 30 minutes (large amounts of data). Should I be doing the same thing in Github Actions and deploy the whole app with the database migration?
老实说,我不确定用PlayWriter、Node/Express后端、MongoDB和Reaction前端进行CI/CD端到端测试的最佳方法是什么。我有一个可以使用docker-compose部署的应用程序,但当它部署后,空数据库会通过迁移自动填充,但可能需要长达30分钟的时间(大量数据)。我是否应该在Github Actions中做同样的事情,并在数据库迁移中部署整个应用程序?
更多回答
Why do you need large volume of data in the DB for your front end UI tests?
为什么您的前端UI测试需要数据库中的大量数据?
优秀答案推荐
It depends on the type of app you have and what you want to test with e2e.
这取决于你拥有的应用程序的类型,以及你想用e2e测试什么。
Maybe it is worth deploying the front end only and tests.
Or the back end and front end connected to the external staging database.
Or deploy everything with DB migration if your data for testing should be unique.
Or deploying DB snapshot, not whole DB migration.
也许只部署前端并进行测试是值得的。或者后端和前端连接到外部中间数据库。或者,如果要测试的数据应该是唯一的,则可以使用数据库迁移部署所有内容。或者部署数据库快照,而不是整个数据库迁移。
更多回答
我是一名优秀的程序员,十分优秀!