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 e) { if (i == packageOptions.RetryCount - 1) { Assert.Inconclusive("Unable to find NuGet package, could be network related.", e); } } } nuget.ClickAdd(); Session.WaitForNoElement(nugetWindow); takeScreenshot("NuGet-Update-Is-" + isUpdate); try { WaitForNuGet.Success(packageOptions.PackageName, isUpdate ? NuGetOperations.Update : NuGetOperations.Add); } catch (TimeoutException) { takeScreenshot("Wait-For-NuGet-Operation-Failed"); throw; } takeScreenshot("NuGet-Operation-Finished"); }
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"); } }
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(); }