Пример #1
0
        public void TestCloudTest()
        {
            Cake.NuGetRestore("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.sln");

            // Try and find a test-cloud-exe from the installed nugets
            var testCloudExePath = Cake.GetFiles("./TestProjects/HelloWorldAndroid/**/test-cloud.exe")
                                   .FirstOrDefault();

            // Build the sln so the unit tests assembly gets built
            Cake.DotNetBuild("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.sln");

            // Build the .apk to test
            var apk = Cake.AndroidPackage("./TestProjects/HelloWorldAndroid/HelloWorldAndroid/HelloWorldAndroid.csproj", true);

            var xtcApiKey = Cake.TransformTextFile("../xtc-api-key").ToString();
            var xtcEmail  = Cake.TransformTextFile("../xtc-email").ToString();

            // Run testcloud
            Cake.TestCloud(apk,
                           xtcApiKey,
                           "2b9b256d",
                           xtcEmail,
                           "./TestProjects/HelloWorldAndroid/HelloWorldAndroid.UITests/bin/Debug/",
                           new TestCloudSettings {
                ToolPath = testCloudExePath
            });

            Cake.UITest("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.UITests/bin/Debug/HelloWorldAndroid.UITests.dll",
                        new Cake.Common.Tools.NUnit.NUnitSettings {
                ToolPath = testCloudExePath
            });
        }
Пример #2
0
        public void UITestsTest()
        {
            Cake.NuGetRestore("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.sln");

            // Try and find a console runner from the installed nugets
            var nunitConsolePath = Cake.GetFiles("./TestProjects/HelloWorldAndroid/**/nunit-console.exe")
                                   .FirstOrDefault();

            // Build the sln so the unit tests assembly gets built
            Cake.DotNetBuild("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.sln");

            // Build the .apk to test
            var apk = Cake.AndroidPackage("./TestProjects/HelloWorldAndroid/HelloWorldAndroid/HelloWorldAndroid.csproj");

            // Copy to the expected location of the UITests
            Cake.CopyFile(apk, "./TestProjects/HelloWorldAndroid/HelloWorldAndroid.UITests/bin/Debug/app.apk");

            // Run the uitests
            Cake.UITest("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.UITests/bin/Debug/HelloWorldAndroid.UITests.dll",
                        new Cake.Common.Tools.NUnit.NUnitSettings {
                ToolPath = nunitConsolePath
            });
        }
Пример #3
0
        void androidPackageTest(bool signed)
        {
            var projectFile = base.WorkingDirectory
                              .Combine("TestProjects/HelloWorldAndroid/HelloWorldAndroid/")
                              .CombineWithFilePath("HelloWorldAndroid.csproj");

            projectFile = new FilePath("./TestProjects/HelloWorldAndroid/HelloWorldAndroid/HelloWorldAndroid.csproj");

            FilePath apkFile = null;

            apkFile = Cake.AndroidPackage(
                projectFile,
                signed,
                c => {
                c.Verbosity     = Verbosity.Diagnostic;
                c.Configuration = "Release";
            });

            Assert.NotNull(apkFile);
            Assert.NotNull(apkFile.FullPath);
            Assert.NotEmpty(apkFile.FullPath);
            Assert.True(System.IO.File.Exists(apkFile.FullPath));
        }