Exemplo n.º 1
0
        static void AddUpdatePackage(NuGetPackageOptions packageOptions, Action <string> takeScreenshot, bool isUpdate = false)
        {
            packageOptions.PrintData();
            var nuget = new NuGetController(takeScreenshot, isUpdate);

            nuget.Open();
            nuget.EnterSearchText(packageOptions.PackageName, packageOptions.Version, packageOptions.IsPreRelease);
            for (int i = 0; i < packageOptions.RetryCount; i++)
            {
                try {
                    nuget.SelectResultByPackageName(packageOptions.PackageName, packageOptions.Version);
                    break;
                } catch (NuGetException) {
                    if (i == packageOptions.RetryCount - 1)
                    {
                        throw;
                    }
                }
            }
            nuget.ClickAdd();
            Session.WaitForNoElement(nugetWindow);
            takeScreenshot("NuGet-Update-Is-" + isUpdate);
            try {
                WaitForNuGet.Success(packageOptions.PackageName, isUpdate ? NuGetOperations.Update : NuGetOperations.Add);
            } catch (TimeoutException e) {
                takeScreenshot("Wait-For-NuGet-Operation-Failed");
                throw;
            }
            takeScreenshot("NuGet-Operation-Finished");
        }
Exemplo n.º 2
0
 public void TestDontShowWarningWithPowerShellScripts()
 {
     CreateProject();
     NuGetController.AddPackage(new NuGetPackageOptions {
         PackageName = "Newtonsoft.Json",
     }, this);
     WaitForNuGet.Success("Newtonsoft.Json", NuGetOperations.Add, false, this);
     TakeScreenShot("NewtonSoftJson-Package-Added-Without-Warning");
 }
Exemplo n.º 3
0
 public static void UpdateAllNuGetPackages(UITestBase testContext = null)
 {
     Session.ExecuteCommand("MonoDevelop.PackageManagement.Commands.UpdateAllPackagesInSolution");
     WaitForNuGet.UpdateSuccess(string.Empty);
     if (testContext != null)
     {
         testContext.TakeScreenShot("All-NuGet-Packages-Updated");
     }
 }
Exemplo n.º 4
0
        public static void Success(string packageName, NuGetOperations operation, bool waitForWarning = true, UITestBase testContext = null)
        {
            var waitPackage = new WaitForNuGet {
                Operation      = operation,
                PackageName    = packageName,
                WaitForSuccess = true,
                WaitForWarning = waitForWarning
            };

            if (testContext != null)
            {
                testContext.ReproStep(string.Format("Wait for one of these messages:\n\t{0}",
                                                    string.Join("\t\n", waitPackage.ToMessages())));
            }
            waitPackage.Wait();
        }
		public static void Success (string packageName, NuGetOperations operation, bool waitForWarning = true, UITestBase testContext = null)
		{
			var waitPackage = new WaitForNuGet {
				Operation = operation,
				PackageName = packageName,
				WaitForSuccess = true,
				WaitForWarning = waitForWarning
			};
			if (testContext != null) {
				testContext.ReproStep (string.Format ("Wait for one of these messages:\n\t{0}",
					string.Join ("\t\n", waitPackage.ToMessages ())));
			}
			waitPackage.Wait ();
		}