Forum Xamarin Test Cloud (Read Only)

Possible to detect a rest api result with UI Test

Hi, i've got to a particular section of my app as to where i would like to start testing the product flow using UI Tests. I've managed to get the setup accomplished and the AppLaunches test passes. Upon the app launching i make a rest api call to my backend database to check what the User State is.

Depending on the User State (eg. Has created pincode, user been verified, goal been set etcc) will then determine the next page of the app. While this code executes to the webapi i display an activity indicator.

Is there a way using nUnit UI test to recieve the value that is returned from the web api? The CheckUserState method is in the code behind of the xmal view.

Im basicilly checking for either a 1 , 2, 3, or a 4 which will then determine which view to display and then i can continue writing the test. Is this possible?



  • SebastianSeidel.9226SebastianSeidel.9226 DEInsider, University ✭✭✭✭

    Yes it is possible through backdoor methods.

  • CostasAletrariCostasAletrari USMember ✭✭

    @SebastianSeidel.9226 Thank you for your reply, i did notice the invoke method in the test framework.

    Currently my user state checking occurs on the OnAppearing Method so its not really a manual invoke of the method,

    I need to grab the result once the onAppearing method has finished.

    In my onAppearing method i call another async method call checkuserstate

Sign In or Register to comment.