protected string CheckoutOrClone (string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180) { cloneToLocation = cloneToLocation ?? Util.CreateTmpDir ("clone"); ReproStep ("Click on Version Control > Checkout from Menu Bar"); Session.ExecuteCommand (MonoDevelop.VersionControl.Commands.Checkout); WaitForElement (c => c.Window ().Marked ("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog"), "Select Repository window should open", "Select Reprository window did not open"); TakeScreenShot ("Checkout-Window-Ready"); ReproStep (string.Format ("Select Type to '{0}'", cvsType)); Assert.IsTrue (Session.SelectElement (c => c.Marked ("repCombo").Model ().Text (cvsType.ToString ()))); ReproStep (string.Format ("Enter URL as '{0}'", repoUrl)); Assert.IsTrue (Session.EnterText (c => c.Textfield ().Marked ("repositoryUrlEntry"), repoUrl)); Assert.IsTrue (Session.EnterText (c => c.Textfield ().Marked ("entryFolder"), cloneToLocation)); Session.WaitForElement (c => c.Textfield ().Marked ("entryFolder").Text (cloneToLocation)); TakeScreenShot ("Before-Clicking-OK"); ReproStep ("Click OK"); Assert.IsTrue (Session.ClickElement (c => c.Window ().Marked ("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog").Children ().Button ().Marked ("buttonOk"))); Session.WaitForElement (c => c.Window ().Marked ("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), 15000); TakeScreenShot ("CheckoutClone-In-Progress"); ReproStep ("Wait for Clone to Finish"); WaitForElement (c => c.Window ().Marked ("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), string.Format ("Clone should finish within {0} seconds", cloneTimeoutSecs), string.Format ("Clone failed to finish within {0} seconds", cloneTimeoutSecs), cloneTimeoutSecs * 1000); return cloneToLocation; }
protected string CheckoutOrClone (string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180) { cloneToLocation = cloneToLocation ?? Util.CreateTmpDir ("clone"); Session.ExecuteCommand (MonoDevelop.VersionControl.Commands.Checkout); Session.WaitForElement (c => c.Window ().Marked ("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog")); TakeScreenShot ("Checkout-Window-Ready"); Assert.IsTrue (Session.SelectElement (c => c.Marked ("repCombo").Model ().Text (cvsType.ToString ()))); Assert.IsTrue (Session.EnterText (c => c.Textfield ().Marked ("repositoryUrlEntry"), repoUrl)); Assert.IsTrue (Session.EnterText (c => c.Textfield ().Marked ("entryFolder"), cloneToLocation)); Session.WaitForElement (c => c.Textfield ().Marked ("entryFolder").Text (cloneToLocation)); TakeScreenShot ("Before-Clicking-OK"); Assert.IsTrue (Session.ClickElement (c => c.Window ().Marked ("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog").Children ().Button ().Marked ("buttonOk"))); Session.WaitForElement (c => c.Window ().Marked ("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), 15000); TakeScreenShot ("CheckoutClone-In-Progress"); Session.WaitForNoElement (c => c.Window ().Marked ("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), cloneTimeoutSecs * 1000); return cloneToLocation; }
protected string CheckoutOrClone(string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180) { cloneToLocation = cloneToLocation ?? Util.CreateTmpDir("clone"); ReproStep("Click on Version Control > Checkout from Menu Bar"); Session.ExecuteCommand(MonoDevelop.VersionControl.Commands.Checkout); WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog"), "Select Repository window should open", "Select Reprository window did not open"); TakeScreenShot("Checkout-Window-Ready"); ReproStep(string.Format("Select Type to '{0}'", cvsType)); Assert.IsTrue(Session.SelectElement(c => c.Marked("repCombo").Model().Text(cvsType.ToString()))); ReproStep(string.Format("Enter URL as '{0}'", repoUrl)); Assert.IsTrue(Session.EnterText(c => c.Textfield().Marked("repositoryUrlEntry"), repoUrl)); Assert.IsTrue(Session.EnterText(c => c.Textfield().Marked("entryFolder"), cloneToLocation)); Session.WaitForElement(c => c.Textfield().Marked("entryFolder").Text(cloneToLocation)); TakeScreenShot("Before-Clicking-OK"); ReproStep("Click OK"); Assert.IsTrue(Session.ClickElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog").Children().Button().Marked("buttonOk"))); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), 15000); TakeScreenShot("CheckoutClone-In-Progress"); ReproStep("Wait for Clone to Finish"); WaitForElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), string.Format("Clone should finish within {0} seconds", cloneTimeoutSecs), string.Format("Clone failed to finish within {0} seconds", cloneTimeoutSecs), cloneTimeoutSecs * 1000); return(cloneToLocation); }
protected string CheckoutOrClone(string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180) { cloneToLocation = cloneToLocation ?? Util.CreateTmpDir("clone"); Session.ExecuteCommand(MonoDevelop.VersionControl.Commands.Checkout); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog")); TakeScreenShot("Checkout-Window-Ready"); Assert.IsTrue(Session.SelectElement(c => c.Marked("repCombo").Model().Text(cvsType.ToString()))); Assert.IsTrue(Session.EnterText(c => c.Textfield().Marked("repositoryUrlEntry"), repoUrl)); Assert.IsTrue(Session.EnterText(c => c.Textfield().Marked("entryFolder"), cloneToLocation)); Session.WaitForElement(c => c.Textfield().Marked("entryFolder").Text(cloneToLocation)); TakeScreenShot("Before-Clicking-OK"); Assert.IsTrue(Session.ClickElement(c => c.Window().Marked("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog").Children().Button().Marked("buttonOk"))); Session.WaitForElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), 15000); TakeScreenShot("CheckoutClone-In-Progress"); Session.WaitForNoElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.Dialogs.ProgressDialog"), cloneTimeoutSecs * 1000); return(cloneToLocation); }