简体   繁体   English

使用Rails JSON API的Javascript客户端框架 - 如何进行集成测试?

[英]Javascript client framework with Rails JSON API - how to do integration tests?

I have two applications, a Rails JSON API, and a Javascript client framework. 我有两个应用程序,一个是Rails JSON API,另一个是Javascript客户端框架。

What is the best way to do integration tests ? 进行集成测试的最佳方法是什么?

And another question, can this be done via Capybara ? 另一个问题,这可以通过Capybara完成吗?

If you want a true integration test, you can use Capybara with a driver that executes javascript, like Poltergeist , or Capybara-Webkit . 如果你想要一个真正的集成测试,你可以使用Capybara与执行javascript的驱动程序,如PoltergeistCapybara-Webkit Alternatively, you could use Selenium, but that's not quite as slick as a headless test. 或者,您可以使用Selenium,但这并不像无头测试那样光滑。

That said, you will probably have a lot more luck and more solid tests if you test your front end and back end separately with Rspec on the back and Jasmine/Qunit on the front. 也就是说,如果你分别用背面的Rspec和前面的Jasmine / Qunit测试你的前端和后端,你可能会有更多的运气和更坚实的测试。 Integration tests with JS are often tricky. 使用JS进行集成测试通常很棘手。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何编写 JavaScript 集成测试? - How to write JavaScript Integration Tests? 使用Javascript通过Test :: Unit和Capybara在Ruby on Rails中进行集成测试 - Integration tests with Javascript through Test::Unit and Capybara in Ruby on Rails 如何将 HAL JSON 转换为 OpenAPI JSON 以生成 JavaScript 客户端 API - How to Convert HAL JSON to OpenAPI JSON for JavaScript Client API Generation 如何将AngularJS与Google API JavaScript客户端一起使用? - How do I use AngularJS with Google API JavaScript Client? 如何保护JavaScript / Ajax客户端[apigee]中使用的API? - How do I secure an API that is used in a JavaScript/Ajax client [apigee]? 将clojurescript集成到javascript框架中 - Integration clojurescript into a javascript framework Javascript集成测试框架 - Javascript Integration Testing Framework 如何使用google-api-javascript-client和Javascript访问Google Photos API并读取JSON数据? - How to Access Google Photos API with Javascript using google-api-javascript-client and read JSON data? 未在集成测试中加载Javascript库 - Javascript libraries not loaded in integration tests Google Maps JavaScript中的api客户端json - Google maps api client side json in javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM