"Organizing crossplatform API automation testing" from Sergey Zenchenko
The presentation is about how to test your server API and share API client between tests and mobile app.
Find more useful slides at Sergey's account: https://speakerdeck.com/sergeyzenchenko
• Concurrency support is limited • Hard to maintain large test suite • No static typing • Code is not reusable https://mochajs.org https://github.com/visionmedia/supertest http://dareid.github.io/chakram/
in tests • Test should operate with business domain, not with HTTP requests • Work with Objects not JSON and Strings • Static typing • Code reusability
API request is a separate Janet Action • Purely declarative • Annotations are used to map class attrs. to HTTP request values • Action are executed by services. (HTTPService, WebSocketService, SOAPService, YourCustomService)
"/health_check", method = HttpAction.Method.GET) public class HealthCheckAction { @Query("url") public final String url; public HealthCheckAction(String url) { this.url = url; } @Response public HealthStatus response; }
"health_check") public class HealthCheckAction { @Payload("url") public final String url; public HealthCheckAction(String url) { this.url = url; } @Response public HealthStatus response; }
defines models and actions 3. Team writes tests for new endpoint 4. Android team can now start implementing feature by mocking actions if required. 5. Tests run on CI to check if feature is working 6. Backend team deploys new API endpoint 7. Tests pass and feature is ready