static void LogReproSteps(UITestBase testContext, string message, params object[] info)
 {
     if (testContext != null)
     {
         testContext.ReproStep(message, info);
     }
 }
Ejemplo n.º 2
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");
		}
Ejemplo 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");
     }
 }
Ejemplo n.º 4
0
		public static void UpdatePackage (NuGetPackageOptions packageOptions, UITestBase testContext = null)
		{
			Action<string> screenshotAction = delegate { };
			if (testContext != null) {
				testContext.ReproStep (string.Format ("Update NuGet package '{0}'", packageOptions.PackageName), packageOptions);
				screenshotAction = testContext.TakeScreenShot;
			}
			AddUpdatePackage (packageOptions, screenshotAction, true);
		}
Ejemplo n.º 5
0
        public static void CloseDocument(UITestBase testContext = null)
        {
            testContext?.ReproStep("Close current workspace");
            Action <string> takeScreenshot = GetScreenshotAction(testContext);

            takeScreenshot("About-To-Close-Workspace");
            Session.ExecuteCommand(FileCommands.CloseFile);
            takeScreenshot("Closed-Workspace");
        }
Ejemplo n.º 6
0
        public static void OpenWorkspace(string solutionPath, UITestBase testContext = null)
        {
            testContext?.ReproStep(string.Format("Open solution path '{0}'", solutionPath));
            Action <string> takeScreenshot = GetScreenshotAction(testContext);

            Session.GlobalInvoke("MonoDevelop.Ide.IdeApp.Workspace.OpenWorkspaceItem", new FilePath(solutionPath), true);
            Ide.WaitForIdeIdle();
            takeScreenshot("Solution-Opened");
        }
Ejemplo n.º 7
0
        public static void UpdatePackage(NuGetPackageOptions packageOptions, UITestBase testContext = null)
        {
            Action <string> screenshotAction = delegate { };

            if (testContext != null)
            {
                testContext.ReproStep(string.Format("Update NuGet package '{0}'", packageOptions.PackageName), packageOptions);
                screenshotAction = testContext.TakeScreenShot;
            }
            AddUpdatePackage(packageOptions, screenshotAction, true);
        }
Ejemplo n.º 8
0
        public static Action <string> GetScreenshotAction(UITestBase testContext)
        {
            Action <string> takeScreenshot = delegate {
            };

            if (testContext != null)
            {
                takeScreenshot = testContext.TakeScreenShot;
            }

            return(takeScreenshot);
        }
		public static void Create (NewFileOptions options, UITestBase testContext = null)
		{
			options.PrintData ();
			Action<string> screenshotAction = (s) => {};
			if (testContext != null) {
				testContext.ReproStep (string.Format ("Add a new file of type '{0}' named '{1}'", 
					options.FileType, options.FileName), options);
				screenshotAction = testContext.TakeScreenShot;
			}

			var ctrl = new NewFileController (screenshotAction);
			ctrl.Open ();
			ctrl.ConfigureAddToProject (!string.IsNullOrEmpty (options.AddToProjectName), options.AddToProjectName);
			ctrl.SelectFileTypeCategory (options.FileTypeCategory, options.FileTypeCategoryRoot);
			ctrl.SelectFileType (options.FileType);
			ctrl.EnterFileName (options.FileName);
			ctrl.Done ();
		}
Ejemplo n.º 10
0
        public static void Create(NewFileOptions options, UITestBase testContext = null)
        {
            options.PrintData();
            Action <string> screenshotAction = (s) => {};

            if (testContext != null)
            {
                testContext.ReproStep(string.Format("Add a new file of type '{0}' named '{1}'",
                                                    options.FileType, options.FileName), options);
                screenshotAction = testContext.TakeScreenShot;
            }

            var ctrl = new NewFileController(screenshotAction);

            ctrl.Open();
            ctrl.ConfigureAddToProject(!string.IsNullOrEmpty(options.AddToProjectName), options.AddToProjectName);
            ctrl.SelectFileTypeCategory(options.FileTypeCategory, options.FileTypeCategoryRoot);
            ctrl.SelectFileType(options.FileType);
            ctrl.EnterFileName(options.FileName);
            ctrl.Done();
        }
Ejemplo n.º 11
0
 public static void AddSuccess(string packageName, bool waitForWarning = true, UITestBase testContext = null)
 {
     Success(packageName, NuGetOperations.Add, waitForWarning, testContext);
 }
Ejemplo n.º 12
0
 public ProjectOptionsController(UITestBase testContext = null) : base(windowQuery, testContext)
 {
 }
Ejemplo n.º 13
0
 public ProjectOptionsController(string solutionName, string projectName, UITestBase testContext = null) : base(windowQuery, testContext)
 {
     this.solutionName = solutionName;
     this.projectName  = projectName;
 }
Ejemplo n.º 14
0
		public static void CloseWorkspace (UITestBase testContext = null)
		{
			if (testContext != null)
				testContext.ReproStep ("Close current workspace");
			Action<string> takeScreenshot = GetScreenshotAction (testContext);
			takeScreenshot ("About-To-Close-Workspace");
			Session.ExecuteCommand (FileCommands.CloseWorkspace);
			takeScreenshot ("Closed-Workspace");
		}
Ejemplo n.º 15
0
		public static void OpenWorkspace (string solutionPath, UITestBase testContext = null)
		{
			if (testContext != null)
				testContext.ReproStep (string.Format ("Open solution path '{0}'", solutionPath));
			Action<string> takeScreenshot = GetScreenshotAction (testContext);
			Session.GlobalInvoke ("MonoDevelop.Ide.IdeApp.Workspace.OpenWorkspaceItem", new FilePath (solutionPath), true);
			Ide.WaitForIdeIdle ();
			takeScreenshot ("Solution-Opened");
		}
Ejemplo n.º 16
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 ProjectOptionsController (string solutionName, string projectName, UITestBase testContext = null) : base (windowQuery,testContext)
		{
			this.solutionName = solutionName;
			this.projectName = projectName;
		}
		public static bool SelectSingleReference (string solutionName, string projectName, string referenceName, bool fromPackage = false, UITestBase testContext = null)
		{
			LogReproSteps (testContext, string.Format ("Under Solution Explorer, select NuGet package '{0}' under '{1}' > '{2}' > From Packages",
				referenceName, projectName.StripBold (), solutionName.StripBold ()));
			return fromPackage ? Select (solutionName, projectName, "From Packages", referenceName) : Select (solutionName, projectName, referenceName);
		}
		public static bool SelectPackage (string solutionName, string projectName, string package, UITestBase testContext = null)
		{
			LogReproSteps (testContext, string.Format ("Under Solution Explorer, select package '{0}' under '{1}' > '{2}' > 'Packages'", package, projectName.StripBold (), solutionName.StripBold ()));
			return Select (solutionName, projectName, "Packages", package);
		}
		public static bool SelectReferenceFolder (string solutionName, string projectName, UITestBase testContext = null)
		{
			LogReproSteps (testContext, string.Format ("Under Solution Explorer, expand References node under '{0}'> '{1}'", projectName.StripBold (), solutionName.StripBold ()));
			return Select (solutionName, projectName, "References");
		}
		public static bool SelectSolution (string solutionName, UITestBase testContext = null)
		{
			LogReproSteps (testContext, string.Format ("Under Solution Explorer, select Solution '{0}'", solutionName.StripBold ()));
			return Select (solutionName);
		}
		static void LogReproSteps (UITestBase testContext, string message, params object[] info)
		{
			if (testContext != null) {
				testContext.ReproStep (message, info);
			}
		}
Ejemplo n.º 23
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 bool SelectSingleReference(string solutionName, string projectName, string referenceName, bool fromPackage = false, UITestBase testContext = null)
 {
     LogReproSteps(testContext, string.Format("Under Solution Explorer, select NuGet package '{0}' under '{1}' > '{2}' > From Packages",
                                              referenceName, projectName.StripBold(), solutionName.StripBold()));
     return(fromPackage ? Select(solutionName, projectName, "From Packages", referenceName) : Select(solutionName, projectName, referenceName));
 }
		public ProjectOptionsController (UITestBase testContext = null) : base (windowQuery, testContext) { }
 public static bool SelectReferenceFolder(string solutionName, string projectName, UITestBase testContext = null)
 {
     LogReproSteps(testContext, string.Format("Under Solution Explorer, expand References node under '{0}'> '{1}'", projectName.StripBold(), solutionName.StripBold()));
     return(Select(solutionName, projectName, "References"));
 }
		protected OptionsController (Func<AppQuery, AppQuery> windowQuery, UITestBase testContext) : this (windowQuery, testContext.TakeScreenShot)
		{
			this.testContext = testContext;
		}
 public static bool SelectSolution(string solutionName, UITestBase testContext = null)
 {
     LogReproSteps(testContext, string.Format("Under Solution Explorer, select Solution '{0}'", solutionName.StripBold()));
     return(Select(solutionName));
 }
Ejemplo n.º 29
0
		public static Action<string> GetScreenshotAction (UITestBase testContext)
		{
			Action<string> takeScreenshot = delegate {
			};
			if (testContext != null)
				takeScreenshot = testContext.TakeScreenShot;

			return takeScreenshot;
		}
Ejemplo n.º 30
0
 protected OptionsController(Func <AppQuery, AppQuery> windowQuery, UITestBase testContext) : this(windowQuery, testContext.TakeScreenShot)
 {
     this.testContext = testContext;
 }
Ejemplo n.º 31
0
		public static void AddSuccess (string packageName, bool waitForWarning = true, UITestBase testContext = null)
		{
			Success (packageName, NuGetOperations.Add, waitForWarning, testContext);
		}
 public static bool SelectPackage(string solutionName, string projectName, string package, UITestBase testContext = null)
 {
     LogReproSteps(testContext, string.Format("Under Solution Explorer, select package '{0}' under '{1}' > '{2}' > 'Packages'", package, projectName.StripBold(), solutionName.StripBold()));
     return(Select(solutionName, projectName, "Packages", package));
 }