예제 #1
0
		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;
		}
예제 #2
0
        /// <summary>
        /// 开启下载方案
        /// </summary>
        /// <param name="isSucess"></param>
        /// <param name="msg"></param>
        protected void InitVersionContrl(bool isSucess, string msg)
        {
            // 方便开发者
            VersionControlType contype = Application.isEditor ? VersionControlType.kDev : (VersionControlType)Config.Instance.GetVersionControlType();

            // 初始化控制方案
            InitControlByType(contype);
            _versionControl.Init(_gameManager);
            _versionControl.StartUpdate();
        }
예제 #3
0
		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;
		}
예제 #4
0
        /// <summary>
        /// 获得控制方案
        /// </summary>
        /// <param name="controltype"></param>
        protected void InitControlByType(VersionControlType controltype)
        {
            switch (controltype)
            {
            case VersionControlType.kApp:
                _versionControl = UtilCommon.AddComponent <VersionControlApp>(mGameManager.gameObject) as VersionControlApp;
                break;

            case VersionControlType.kDev:
                _versionControl = UtilCommon.AddComponent <VersionControlDev>(mGameManager.gameObject) as VersionControlDev;
                break;

            case VersionControlType.kArt:
                _versionControl = UtilCommon.AddComponent <VersionControlArt>(mGameManager.gameObject) as VersionControlArt;
                break;

            default:
                _versionControl = UtilCommon.AddComponent <VersionControlApp>(mGameManager.gameObject) as VersionControlApp;
                break;
            }
        }
예제 #5
0
        protected void TestClone(string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180)
        {
            var checkoutFolder = CheckoutOrClone(repoUrl, cloneToLocation, cvsType, cloneTimeoutSecs);

            FoldersToClean.Add(checkoutFolder);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
		protected void TestClone (string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180)
		{
			var checkoutFolder = CheckoutOrClone (repoUrl, cloneToLocation, cvsType, cloneTimeoutSecs);
			FoldersToClean.Add (checkoutFolder);
		}