Rails 为什么 Rails System Test 没有在社区流行起来?

hiveer · May 17, 2023 · Last by zhugexinxin replied at May 18, 2023 · 455 hits

因为自己对于什么是 end to end 测试,以及和 feature test 是什么关系我一直比较迷惑,所以最近花了一些时间了解了下跟测试相关的知识,特别是如何在 Rails 项目中写测试,总结了一篇文章:https://zhuanlan.zhihu.com/p/628037293

从搜集到的信息中发现一个我之前的盲点就是:其实在 Rails 5.1 以及 Rspec 3.7 之后,就支持使用 System Test 了,而且根据 rspec-rails(https://github.com/rspec/rspec-rails/blob/main/README.md#feature-specs)的描述:

| Before Rails introduced system testing facilities, feature specs were the only spec type for end-to-end testing. While the RSpec team now officially recommends system specs instead, feature specs are still fully supported, look basically identical, and work on older versions of Rails.

更推荐使用 System Test,而不再是 Rspec feature test

但是,但是,为啥在社区开源项目中,很少看到使用 System Test 的场景呢?

大家知道吗?

rspec 用的多,rails 自带的测试框架,没怎么用过。

一直用 rails 自带的测试框架,没有为什么,只是方便,有人帮我升级,就是 rails 的人,哈哈

You need to Sign in before reply, if you don't have an account, please Sign up first.