简体   繁体   中英

Java Integration tests between mobile and API. What is the best approach?

I am implementing some integration tests here between my mobile apk and the server API. I am using JAVA and Robotium for the UI tests. I need send some Json requests to the server and check if the behaviour on the app is correct after this change.

I have suggested create the jsons in a script and inside of the a step of the scenario (Given step) send this json to the server, but this would duplicate the effort when maintaining the scenario on server automation (Jmeter scripts) and mobile automation (Cucumber-JVM and Robotium).

Is anyone has an idea how I could implement integrated tests between the mobile app and the server API without duplicating the scenarios on both of the automations ?

I found a strategy to do the integration tests between the app and the server API, google suggests Hermetic tests:

http://googletesting.blogspot.co.uk/2012/10/hermetic-servers.html

http://googletesting.blogspot.co.uk/2015/03/android-ui-automated-testing.html

Some good points are: - You are not mocking the server anymore - You don't need to worry about to maintain the mock server and the test - You are running without need a network connection - The tests are more reliable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM