IOS Test wont start after app initializer.

Hi All,

Im new to Xamarin UI test and Im trying to get a basic test up and running on a physical iOS device.

I can get android working fine. When I try to get IOS working, I can get the App itself to launch but the tests wont run.

App initializer:

        return ConfigureApp
            .iOS
                .PreferIdeSettings()
                .StartApp();

Test:

IApp app;
Platform platform;

    public Tests(Platform platform)
    {
        this.platform = platform;
    }

    [SetUp]
    public void BeforeEachTest()
    {
        Console.WriteLine("Set up started");
        app = AppInitializer.StartApp(platform);
        Console.WriteLine("Set up finished");
    }

    [Test]
    public void AppLaunches()
    {
        //app.Screenshot("First screen.");
        Console.WriteLine("In the test");
    }

I dont get any error messages. Instead, I get:

Full log file: /var/folders/p8/6y_pbc996q37r67j430_z88c0000gq/T/uitest/log-2016-06-21_15-07-23-020.txt

iOS test running Xamarin.UITest version: 1.3.8

Thread started: #12
Attempting IDE connection through pipe 1a0ccb084af745938467fc74fc7f8491.

Skipped IDE integration, connection failed.

Thread finished: #12
Skipping local screenshots. Can be enabled with EnableScreenshots() when configuring app.

Ideas would greatly be appreciated.

I cant seem to add the ios project as a reference to the ui test project:

TestCrossPlatform.iOS (Incompatible target framework: Xamarin.iOS, Version=v1.0)

When I run the test, the app initializer will run when called from the setup method of the ui test, but it hangs after that.

Thanks for your help.

Tagged:

Answers

  • NEREANEREA ✭✭ USMember ✭✭

    I have the same problem.
    AppInitializer:
    public static IApp StartApp(Platform platform)
    {

            if (platform == Platform.Android)
            {
                return ConfigureApp
                    .Android
                    .ApkFile(apkPath)
                    .StartApp();
            }
    
            return ConfigureApp
                .iOS
                .InstalledApp(appPackageName)
                .DeviceIdentifier("E11C8F36-48A8-404D-BA5A-24CDD94F2308")
                .StartApp();
        }
    

    Test.cs:

    public class Tests
    {
    IApp app;
    Platform platform;

        public Tests(Platform platform)
        {
            this.platform = platform;
        }
    
        [SetUp]
        public void BeforeEachTest()
        {
            app = AppInitializer.StartApp(platform);
        }
    
        [Test]
        public void AppLaunches()
        {
            app.Screenshot("First screen.");
            app.SetOrientationLandscape();
        }
    
        [Test]
        public void Repl()
        {
            app.Repl();
        }
    }
    

    I have linked iOS project to calabash and I can get android working fine.
    When I try to get IOS working, I can get the App itself to launch but the tests wont run.

    Thanks

  • MnetKrishnaMnetKrishna USMember

    Similar, if not same scenario here:

    Xamarin Studio, on a Mac. Trying to add my Xamarin.iOS project as a reference to the UITests.

    Add reference dialogue, on the "Projects" tab lists my Xamarin.iOS project, but it is disabled (greyed out) with

    "(Incompatible target framework: Xamarin.iOS,Version=v1.0)" after the name of the project.

    Is this a recent issue? Any work arounds?

    Thanks,k.

  • ThomasLundbergThomasLundberg USMember

    Having the exact same issue as the person above.

  • Glenn.WilsonGlenn.Wilson Xamurai USXamarin Team Xamurai

    Add reference dialogue, on the "Projects" tab lists my Xamarin.iOS project, but it is disabled (greyed out) with

    "(Incompatible target framework: Xamarin.iOS,Version=v1.0)" after the name of the project.

    Add the projects as Test Apps under the Unit Tests pad. See attached sceenshots.

  • SelectorDesignTeamSelectorDesignTeam NLMember

    @Glenn.Wilson said:

    Add reference dialogue, on the "Projects" tab lists my Xamarin.iOS project, but it is disabled (greyed out) with

    "(Incompatible target framework: Xamarin.iOS,Version=v1.0)" after the name of the project.

    Add the projects as Test Apps under the Unit Tests pad. See attached sceenshots.

    Should this be the solution? I still have the same problem as mentioned by others here. I created the UITest in Visual Studio and have the Android part working perfectly, even on Test Cloud.
    Since UITest for IOS is not supported in Windows I had to switch to Xamarin Studio on my MAC. Anybody any ideas?

  • iltafkhalidiltafkhalid USMember

    I am unable to get instance of IApp by using the following line of code:

    app = ConfigureApp.iOS.StartApp();

Sign In or Register to comment.