Mocking/Stubbing backend server when running Android emulator or Genymotion

I have an Android app which I am starting to run functional tests with. I'm currently looking at using Calabash and Cucumber style tests written in Ruby. What I'm looking for is a good way to mock out the backend when running these tests, so I can control the responses, and set up tests for various scenarios (ie set up things for the happy path as well as various error paths that might occur). It'd also be nice if this could work whether running in emulator, Genymotion, or through a device that is connected, but if it will only work on one of the first two, that'd be fine.

If I could get the setup and tear down of this solution integrated into my Gradle build scripts, that'd be fantastic.


I have seen others use Factory Girl for mocking backend. You can see the readme at http://rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md

Or you could have a look at http://mock-server.com/ and see if that could help you out.

链接地址: http://www.djcxy.com/p/93492.html

上一篇: 集成测试:模拟外部API与使用外部API沙箱

下一篇: 运行Android模拟器或Genymotion时模拟/存根后端服务器