Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocking Web Server for Integration Tests #107

Closed
tomclement opened this issue Jul 3, 2014 · 1 comment
Closed

Mocking Web Server for Integration Tests #107

tomclement opened this issue Jul 3, 2014 · 1 comment

Comments

@tomclement
Copy link
Member

We are starting to have issues when running parallel builds on Travis CI for the Integration Tests. This is because for each build, the integration tests run against test.rapidftr.com and in some cases modify the data on the server. The result is that when we have parallel builds, the server can potentially exist in an unpredictable state relative to each running build. We are now considering mocking the calls to test.rapidftr.com

What we have tried so far

So far, we have tried to use:

  • Puffing-billy, which works as a proxy server to record and cache requests at first-run, and then plays them back subsequently.
  • Mimic, which enables us to stub requests on the fly from within the Calabash tests

Blockers

  • With mimic, we have not been able to successfully stub requests with query parameters. So for example, if we write a login test where a user logs in with a certain username, and then the user changes their password, mimic will still validate the log-on because it does not recognise the query parameters
  • With Puffing-billy, we have a number of issues trying to get the android to use the http-proxy, especially for SSL traffic. Secondly, we do not have a way forward for scenarios where we need to seed varying test data. This is because we are hoping to seed data on the android through the sync feature. However, since Puffing-billy records and caches a request the first time and subsequently just plays it back, then it looks like we will not be able to get different responses (and therefore different seed data) for varying scenarios.

Way Forward

  • At the moment, we are considering using MImic even without support for query parameters. This would mean we will have to find a way of creatively ensuring that stubs are cleared and recreated if we are expecting different responses from the same url at different times.
@tomclement
Copy link
Member Author

Mimic added with PR 140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant