diff options
author | Manish Sinha <manish.sinha@xamarin.com> | 2015-10-08 22:22:42 +0300 |
---|---|---|
committer | Manish Sinha <manish.sinha@xamarin.com> | 2015-10-08 22:22:42 +0300 |
commit | 5db145c3f6249ed51d2ed68869f7d7d5bc9f2e88 (patch) | |
tree | a8ce8f1392195ffdba9f718bb0e80971c6e7ea98 /main/tests/UserInterfaceTests/UITestBase.cs | |
parent | 1b2a488032298c6e7102a7cf3861ae3bda2d151f (diff) |
[UITest] Copy MonoDevelopProperties.xml to test profile and disable updater
Diffstat (limited to 'main/tests/UserInterfaceTests/UITestBase.cs')
-rw-r--r-- | main/tests/UserInterfaceTests/UITestBase.cs | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/main/tests/UserInterfaceTests/UITestBase.cs b/main/tests/UserInterfaceTests/UITestBase.cs index 924dcbfa09..c9805395a8 100644 --- a/main/tests/UserInterfaceTests/UITestBase.cs +++ b/main/tests/UserInterfaceTests/UITestBase.cs @@ -77,7 +77,7 @@ namespace UserInterfaceTests SetupScreenshotsFolder (); SetupIdeLogFolder (); - var mdProfile = Util.CreateTmpDir (); + var mdProfile = CreateProfileAndInitSettings (); TestService.StartSession (MonoDevelopBinPath, mdProfile); TestService.Session.DebugObject = new UITestDebug (); @@ -85,19 +85,34 @@ namespace UserInterfaceTests Session.WaitForElement (IdeQuery.DefaultWorkbench); TakeScreenShot ("Application-Started"); - CloseIfXamarinUpdateOpen (); TakeScreenShot ("Application-Ready"); } + static FilePath CreateProfileAndInitSettings () + { + const string mdPropertiesFile = "MonoDevelopProperties.xml"; + + var mdProfile = Util.CreateTmpDir (); + var profileDir = Path.Combine (mdProfile, BrandingService.ApplicationName + "-" + MonoDevelop.BuildInfo.CompatVersion, "Config"); + Directory.CreateDirectory (profileDir); + + var fromMDFile = Path.Combine (UserProfile.Current.ConfigDir, mdPropertiesFile); + var toMDFile = Path.Combine (profileDir, mdPropertiesFile); + File.Copy (fromMDFile, toMDFile); + Console.WriteLine ("Using Settings file: " + toMDFile); + + var property = Properties.Load (toMDFile); + property.Set ("MonoDevelop.Ide.AddinUpdater.CheckForUpdates", false); + property.Save (toMDFile); + Console.WriteLine ("Disabled AddinUpdater.CheckForUpdates"); + + return mdProfile; + } + [TearDown] public virtual void Teardown () { try { - if (TestContext.CurrentContext.Result.Status != TestStatus.Passed) { - var updateOpened = Session.Query (IdeQuery.XamarinUpdate); - if (updateOpened != null && updateOpened.Any ()) - Assert.Inconclusive ("Xamarin Update is blocking the application focus"); - } ValidateIdeLogMessages (); LoggingService.RemoveLogger (Logger.Name); @@ -131,18 +146,6 @@ namespace UserInterfaceTests LogMessageValidator.Validate (Environment.GetEnvironmentVariable ("MONODEVELOP_LOG_FILE")); } - protected void CloseIfXamarinUpdateOpen () - { - try { - Session.WaitForElement (IdeQuery.XamarinUpdate, 10 * 1000); - TakeScreenShot ("Xamarin-Update-Opened"); - Session.ClickElement (c => IdeQuery.XamarinUpdate (c).Children ().Button ().Text ("Close")); - } - catch (TimeoutException) { - TestService.Session.DebugObject.Debug ("Xamarin Update did not open"); - } - } - void SetupTestResultFolder () { currentTestResultFolder = Path.Combine (testResultFolder, TestContext.CurrentContext.Test.Name); |