Reputation: 847
I'm writing UI tests in Xamarin UITest and when I run several tests behind the app never really is in a "clean" state. So when test A is executed and it is on screen y, test B will start and the app will be on screen y. Also some configurations are also present.
I tried to set the AppDataMode to clear in the AppInitializer.cs but this has no effect at all. On Android this problem does not occure. Tips and suggestions are more then welcome!
Thanks in advance
Upvotes: 0
Views: 163
Reputation: 847
Apparently this is a known issue and the solution will be to force the ios simulator
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();
}
}
According to JGoldbverger from Xamarin. Source => https://forums.xamarin.com/discussion/149966/xamarin-uitest-does-not-clean-my-app-on-ios/.
Upvotes: 0