I am writing some UITests
using the Xamarin.UITest
library. but every test I run always runs twice regardless of whether it has passed or failed?
My app configuration looks like this:
app = ConfigureApp.Android.ApkFile(PathToAPK).WaitTimes(new WaitTimes()).EnableLocalScreenshots().StartApp(Xamarin.UITest.Configuration.AppDataMode.DoNotClear);
and all my test classes are marked with the following attributes:
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
I run the test on Android and it will run twice on Android regardless of whether it has passed or failed.
How do I stop this? / What is causing this?
Ok so I found the problem here.
all my TestClasses
inherited from my own UITestBase
. I had declarated UITestBase
with the TestFixture
attributes. and I had also declarated my TestClasses
with the same attribute. which resulted in this:
Test Class
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
class TestClass : UITestBase
{
}
Base class
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
class UITestBase
{
}
Therefore ended up with my tests all running twice
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With