如何启动Android.App?使用Nunit3的Specflow测试失败,并显示以下错误:“ OneTimeSetUp:未找到合适的构造函数”

时间:2019-05-16 13:43:39

标签: c# android nunit specflow

该应用程序无法启动。我认为故障是由于属性[TestFixture(Platform.Android)]和[OneTimeSetUp]中的某些东西而出现的。如何使用specflow启动App?

注意:该项目中的常规测试(不使用specflow)具有相同的固定装置设置。

using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Android;

namespace AAP.UITests
{
    [TestFixture(Platform.Android)]

    public class TestBase
    {
        protected AppManager appm;
        protected IApp app => AppManager.App;
        protected AndroidApp androidApp;
        protected bool OnAndroid => AppManager.Platform == Platform.Android;
        protected bool OniOS => AppManager.Platform == Platform.iOS;

        public TestBase(Platform platform)
        {
            AppManager.Platform = platform;
        }

        public TestBase()
            { }

        [OneTimeSetUp]

        public void BeforeEachTest()
        {
            AppManager.StartApp();
            appm = AppManager.Appm;

        }     
    }
}

I am using:
SpecFlow, SpecFlow.Nunit, SpecFlow.Tools.MsBuild.Generation - 3.0.199
NUnit, NUnit3TestAdapter - 3.12.0
Xamarin.UITest 2.2.7

0 个答案:

没有答案