Rails 5 Test Prescriptions 第8章 Integration Testing with Capybara and Cucumber

集成测试就是把局部的程序组合起来测试。

端到端测试是一个特殊的集成测试,覆盖了系统的全部行为, end-to-end.

接受测试acceptance test是用来指定正确行为,从客户或商业想法出发。Acceptance tests 通常在代码开始之前就计划或者写了。

集成测试也使用Javascript driver来评测基于Javascript的模仿用户行动。

本章是无Js版本,下章是有Js版本。

  • Setting up Capybara
  • Using Feature Tests to bulid a Feature
  • What to Test in an RSpec System test
  • Outside-in Testing
  • Making the Capybara Test Pass
  • Retrospective回顾
  • Setting up Cucumber ⚠️新的知识点,概览!!
  • Writing Cucumber Features
  • Writing Cucumber Steps
  • Advanced Cucumber 
  • is Cucumber Worth it?


A Field Guide to Integration and System Tests 

Rails core testing library defines two similar types of end-to-end test:

integration test:传统的Rails测试,使用自己的API,功能没Capybara强大。

system test:5.1新增的。需要使用Capybara 。也叫feature tests. 也可以叫integration test。

另外Request 测试,是指URL for routing的test input。也是integration的一种。(11章会学习 request specs.)

RSpec-rails团队,推荐使用Capybara在系统测试中,不论是否使用JavaScript。


Setting Up Capybara 

猜你喜欢

转载自www.cnblogs.com/chentianwei/p/9103795.html
今日推荐