Hi all,
When I ran my tests on android the app always starts at the beginning and no prev configurations are set. But with iOS the app always starts with the page where it last has been. So when I ran test A and i'm on screen X and after that I ran test B then the app will start at screen X instead of the initial beginning screen.
I already set the AppDataMode to clear but this didn't do the trick.
Thanks in advance!
I was just able to verify this issue with a simple Xamarin.Forms app. I reached out to see if this is a known issue or not.
Turns out it is a known issue and the workaround is to set an Environment variable in the AppInitializer
, e.g.:
public class AppInitializer
{
public static IApp StartApp(Platform platform)
{
if (platform == Platform.Android)
{
return ConfigureApp.Android.StartApp();
}
Environment.SetEnvironmentVariable("UITEST_FORCE_IOS_SIM_RESTART", "1"); // <---- Add this line
return ConfigureApp.iOS.StartApp();
}
}
Answers
@llaurenss
Support for UI test is through App Center support portal: https://intercom.help/appcenter/getting-started/getting-help-with-app-center
I was just able to verify this issue with a simple Xamarin.Forms app. I reached out to see if this is a known issue or not.
Turns out it is a known issue and the workaround is to set an Environment variable in the
AppInitializer
, e.g.:https://github.com/King-of-Spades/AppCenter-Test-Samples/blob/master/Xamarin.UITest/UITestDemo/UITestDemo.UITest/AppInitializer.cs#L36
HI @JGoldberger
Well after I used another simulator it didn't occure anymore but never the last I added the line and it didn't happend again. Anyway thanks for the help!