0

I want to write UI-Test with tools like Calabash / Xamarin UITest.

My app uses an REST-API to fetch data from a server. Should I write my UITest in a way that the "final release" build is testet and the test data comes from the production server? Or should I create a special test build which includes a mocked REST-API client which always returns the same data.

Ranga B.
  • 627
  • 10
  • 20
  • It depends on what your tests should show. I for myself test the final release that should go into the stores to be sure all systems and the UI work together like expected. If you only want to see if your UI shows the desired behavior than using a mocked API endpoint is totally valid and in this case it necessary to obtain comparable test results. – tequila slammer Aug 30 '16 at 11:48
  • How do you adress the problem that if you test against production data and some test-relevant items are missing? For example: Imagine a basic shopping list app where you can add items provided by the server to your shopping list. What if your test says "Add Milk to shopping list" but sometimes Milk isn't available. – Ranga B. Aug 30 '16 at 11:55
  • Would you write your tests just with relative data like "Add item #1" to shopping list and test if "item #1" however the real name is was put on the shopping list? – Ranga B. Aug 30 '16 at 11:56
  • @JimBooba `Add Milk to shopping list" but sometimes Milk isn't available` : Personally I would have a test that "finds" items in stock to test the Add2Basket function and a test that "finds" items not in stock to test the action (non-action, disabled Add button, `Sorry, out of stock` dialog...). We also "live test" our release builds against "live test" endpoints that are running the same API-level that commerical users/consumers would see in their live app via a sync'd "live-2-live test" datastore (i.e. Full end to end testing). If your "live" backend supports "test" accounts, even better. – SushiHangover Aug 30 '16 at 15:41
  • @JimBooba Just as SushiHangover has written. We are testing for such edge-cases too with dedicated tests. – tequila slammer Aug 31 '16 at 06:55

0 Answers0