protected void TestCommit(string commitMsg) { ReproStep("Click on Version Control > Review Solution and Commit from Menu Bar"); Session.ExecuteCommand(MonoDevelop.VersionControl.Commands.SolutionStatus); ReproStep("Wait for diff to be available"); WaitForElement(c => c.Button().Marked("buttonCommit").Sensitivity(true), "Commit button should become enabled", "Commit button was not enabled"); ReproStep("Click on Commit Button"); Session.ClickElement(c => c.Button().Marked("buttonCommit"), false); WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog"), "Commit Dialog should open", "Commit Dialog did not open"); TakeScreenShot("Commit-Dialog-Opened"); ReproStep("Enter commit message and click on Commit"); Session.EnterText(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog").Children().TextView().Marked("textview"), commitMsg); TakeScreenShot("Commit-Msg-Entered"); Session.ClickElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog").Children().Button().Marked("buttonCommit"), false); CheckIfNameEmailNeeded(); CheckIfUserConflict(); WaitForElement(() => Ide.WaitForStatusMessage(new [] { "Commit operation completed." }), "Status bar should show 'Commit operation completed.'", "Status bar did not show 'Commit operation completed.'"); TakeScreenShot("Commit-Completed"); ReproStep("Close currently commit tab"); Session.ExecuteCommand(FileCommands.CloseFile); Session.WaitForElement(IdeQuery.TextArea); }
protected void TestGitUnstash() { ReproStep("Click on Version Control > Pop Stash"); Session.ExecuteCommand(MonoDevelop.VersionControl.Git.Commands.StashPop); WaitForElement(() => Ide.WaitForStatusMessage(new[] { "Stash successfully applied" }, 10), "Stash should apply successfully", "Stash failed to apply"); }
protected void ComvertToBranch(int index, string branchName) { SelectStashEntry(index); TakeScreenShot("About-To-Click-Convert-To-Branch"); Session.ClickElement(c => c.Window().Marked("Stash Manager").Children().Button().Text("Convert to Branch"), false); EnterBranchName(branchName); Ide.WaitForStatusMessage(new [] { "Stash successfully applied" }); }
protected void TestGitStash(string stashMsg, int timeoutStashSecs = 10) { Session.ExecuteCommand(MonoDevelop.VersionControl.Git.Commands.Stash); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Git.NewStashDialog")); TakeScreenShot("Stash-Dialog-Opened"); Session.EnterText(c => c.Window().Marked("MonoDevelop.VersionControl.Git.NewStashDialog").Children().Textfield().Marked("entryComment"), stashMsg); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Git.NewStashDialog").Children().Textfield().Marked("entryComment").Text(stashMsg)); TakeScreenShot("Stash-Message-Entered"); Session.ClickElement(c => c.Window().Marked("MonoDevelop.VersionControl.Git.NewStashDialog").Children().Button().Marked("buttonOk")); Ide.WaitForStatusMessage(new [] { "Changes successfully stashed" }, timeoutStashSecs); }
public static void UpdateAllNuGetPackages(Action <string> takeScreenshot = null) { Session.ExecuteCommand("MonoDevelop.PackageManagement.Commands.UpdateAllPackagesInSolution"); Ide.WaitForStatusMessage(new [] { "Packages are up to date.", "No updates found but warnings were reported.", "Packages successfully updated.", "Packages updated with warnings." }, timeoutInSecs: 120, pollStepInSecs: 5); takeScreenshot("All-NuGet-Packages-Updated"); }
protected void TestCommit(string commitMsg) { Session.ExecuteCommand(MonoDevelop.VersionControl.Commands.SolutionStatus); Session.WaitForElement(c => c.Button().Marked("buttonCommit").Sensitivity(true)); Session.ClickElement(c => c.Button().Marked("buttonCommit"), false); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog")); TakeScreenShot("Commit-Dialog-Opened"); Session.EnterText(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog").Children().TextView().Marked("textview"), commitMsg); TakeScreenShot("Commit-Msg-Entered"); Session.ClickElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog").Children().Button().Marked("buttonCommit"), false); CheckIfNameEmailNeeded(); CheckIfUserConflict(); Ide.WaitForStatusMessage(new[] { "Commit operation completed." }); TakeScreenShot("Commit-Completed"); }
static void AddUpdatePackage(NuGetPackageOptions packageOptions, Action <string> takeScreenshot, bool isUpdate) { var nuget = new NuGetController(takeScreenshot, isUpdate); nuget.Open(); nuget.EnterSearchText(packageOptions.PackageName, packageOptions.Version, packageOptions.IsPreRelease); nuget.SelectResultByPackageName(packageOptions.PackageName, packageOptions.Version); nuget.ClickAdd(); Ide.WaitForStatusMessage(new[] { string.Format("{0} successfully {1}.", packageOptions.PackageName, isUpdate ? "updated": "added") }); if (takeScreenshot != null) { takeScreenshot("NuGet-Operation-Finished"); } }
public static void AddPackage(NuGetPackageOptions packageOptions, Action <string> takeScreenshot = null) { var nuget = new NuGetController(takeScreenshot); nuget.Open(); nuget.EnterSearchText(packageOptions.PackageName, packageOptions.Version, packageOptions.IsPreRelease); nuget.SelectResultByPackageName(packageOptions.PackageName, packageOptions.Version); nuget.ClickAdd(); Ide.WaitForStatusMessage(new [] { string.Format("{0} successfully added.", packageOptions.PackageName) }); if (takeScreenshot != null) { takeScreenshot("Package-Added"); } }
protected void TestCommit(string commitMsg) { Session.ExecuteCommand(MonoDevelop.VersionControl.Commands.SolutionStatus); Session.ClickElement(c => c.Button().Marked("buttonCommit"), false); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog")); TakeScreenShot("Commit-Dialog-Opened"); Session.EnterText(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog").Children().TextView().Marked("textview"), commitMsg); TakeScreenShot("Commit-Msg-Entered"); Session.ClickElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.CommitDialog").Children().Button().Marked("buttonCommit"), false); try { Session.WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Git.UserGitConfigDialog")); TakeScreenShot("Git-User-Not-Configured"); EnterGitUserConfig("John Doe", "*****@*****.**"); } catch (TimeoutException e) { } Ide.WaitForStatusMessage(new[] { "Commit operation completed." }); TakeScreenShot("Commit-Completed"); }
public void TestNoChangesStashOperation () { var templateOptions = new TemplateSelectionOptions { CategoryRoot = OtherCategoryRoot, Category = ".NET", TemplateKindRoot = GeneralKindRoot, TemplateKind = "Console Project" }; CreateProject (templateOptions, new ProjectDetails (templateOptions), new GitOptions { UseGit = true, UseGitIgnore = true}); Session.WaitForElement (IdeQuery.TextArea); TestCommit ("First commit"); Session.ExecuteCommand (FileCommands.CloseAllFiles); Assert.Throws <TimeoutException> (() => TestGitStash ("No changes stash attempt")); Ide.WaitForStatusMessage (new [] {"No changes were available to stash"}, 20); }
protected void TestGitUnstash() { Session.ExecuteCommand(MonoDevelop.VersionControl.Git.Commands.StashPop); Ide.WaitForStatusMessage(new[] { "Stash successfully applied" }, 10); }
public void Wait() { Ide.WaitForStatusMessage(ToMessages(), TimeOutSeconds, PollStepSeconds); }