Created
December 27, 2017 10:42
-
-
Save gangrade-swati/5f396482f389f2031e652ba9a8fab726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Entered TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:26 +05:30] XQA: uname -s | |
#[2017-12-27 16:07:26 +05:30] XQA: Darwin | |
TestCaseData created: TestCreateBuildConsoleProject | |
TestCaseData created: TestCreateBuildLibrary | |
TestCaseData created: TestCreateBuildNUnitLibraryProject | |
Leaving TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:26 +05:30] XQA: sw_vers -productVersion | |
#[2017-12-27 16:07:27 +05:30] XQA: 10.12.6 | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.DotNetTemplateTests.TestCreateBuildDotNet' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildEmptyASPNoFramework | |
TestCaseData created: TestCreateBuildEmptyASPWithMVC | |
TestCaseData created: TestCreateBuildEmptyASPWithWebAPI | |
TestCaseData created: TestCreateBuildEmptyASPWithEverything | |
TestCaseData created: TestCreateASPMVC | |
TestCaseData created: TestCreateASPMVCAndWebAPI | |
TestCaseData created: TestCreateASPMVCWithAll | |
TestCaseData created: TestCreateASPForms | |
TestCaseData created: TestCreateASPFormsWithEverything | |
TestCaseData created: TestCreateASPFormsWithMVC | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildCocoaApp | |
TestCaseData created: TestCreateBuildSpriteKitGame | |
TestCaseData created: TestCreateBuildSceneKitGame | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildMetalGame | |
TestCaseData created: TestCreateBuildMacClassLibrary | |
TestCaseData created: TestCreateBuildMacBindingLibrary | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildMacTodayExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildMacFinderSyncExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildMacShareExtension | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildDroidApp | |
TestCaseData created: TestCreateBuildWearApp | |
TestCaseData created: TestCreateBuildWebViewApp | |
TestCaseData created: TestCreateBuildBlankAndroidApp | |
TestCaseData created: TestCreateBuildOpenGLGame | |
TestCaseData created: TestCreateBuildOpenGLES20Game | |
TestCaseData created: TestCreateBuildOpenGLES30Game | |
TestCaseData created: TestCreateBuildDroidAppFSharp | |
TestCaseData created: TestCreateBuildOpenGLGameFSharp | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildAndroidClassLibrary | |
TestCaseData created: TestCreateBuildAndroidClassLibraryFSharp | |
TestCaseData created: TestCreateBuildAndroidUITestApp | |
TestCaseData created: TestCreateBuildAndroidUnitTestApp | |
TestCaseData created: TestCreateBuildAndroidUnitTestAppFSharp | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildIOSSingleViewApp | |
TestCaseData created: TestCreateBuildFSharpIOSSingleViewApp | |
TestCaseData created: TestCreateBuildIOSMasterDetailApp | |
TestCaseData created: TestCreateBuildIOSTabbedApp | |
TestCaseData created: TestCreateBuildIOSPageBasedApp | |
TestCaseData created: TestCreateBuildIOSWebViewApp | |
TestCaseData created: TestCreateBuildIOSSpriteKitGame | |
TestCaseData created: TestCreateBuildIOSSceneKitGame | |
TestCaseData created: TestCreateBuildIOSOpenGLGame | |
TestCaseData created: TestCreateBuildIOSUnitTestApp | |
TestCaseData created: TestCreateBuildFSharpIOSUnitTestApp | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildIOSSingleViewApp | |
TestCaseData created: TestCreateBuildFSharpIOSSingleViewApp | |
TestCaseData created: TestCreateBuildIOSMasterDetailApp | |
TestCaseData created: TestCreateBuildIOSTabbedApp | |
TestCaseData created: TestCreateBuildIOSPageBasedApp | |
TestCaseData created: TestCreateBuildIOSWebViewApp | |
TestCaseData created: TestCreateBuildIOSSpriteKitGame | |
TestCaseData created: TestCreateBuildIOSSceneKitGame | |
TestCaseData created: TestCreateBuildIOSOpenGLGame | |
TestCaseData created: TestCreateBuildIOSUnitTestApp | |
TestCaseData created: TestCreateBuildFSharpIOSUnitTestApp | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildIOSClassLibraryProject | |
TestCaseData created: TestCreateBuildFSharpIOSClassLibraryProject | |
TestCaseData created: TestCreateBuildIOSBindingLibraryProject | |
TestCaseData created: TestCreateBuildIOSUITestProject | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildIOSActionExtension | |
TestCaseData created: TestCreateBuildIOSAudioUnitExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildIOSBroadcastUIExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildIOSBroadcastUploadExtension | |
TestCaseData created: TestCreateBuildIOSCallDirectoryExtension | |
TestCaseData created: TestCreateBuildIOSContentBlockerExtension | |
TestCaseData created: TestCreateBuildIOSCustomKeyboardExtension | |
TestCaseData created: TestCreateBuildIOSDocumentPickerExtension | |
TestCaseData created: TestCreateBuildIOSDocumentPickerFileProviderExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildIOSiMessageExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildIOSIntentsExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildIOSIntentsUIExtension | |
#[2017-12-27 16:07:27 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:27 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildIOSNotificationContentExtension | |
TestCaseData created: TestCreateBuildIOSNotificationServiceExtension | |
TestCaseData created: TestCreateBuildIOSPhotoEditingExtension | |
TestCaseData created: TestCreateBuildIOSShareExtension | |
TestCaseData created: TestCreateBuildIOSSharedLinksExtension | |
TestCaseData created: TestCreateBuildIOSSpotlightIndexExtension | |
TestCaseData created: TestCreateBuildIOSTodayExtension | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildFormsAndroidIOSMobileBackend | |
TestCaseData created: TestCreateBuildFormsIOSMobileBackend | |
TestCaseData created: TestCreateBuildFormsAndroidMobileBackend | |
TestCaseData created: TestCreateBuildFormsAndroidIOSWithOutMobileBackend | |
TestCaseData created: TestCreateBuildFormsIOSWithOutMobileBackend | |
TestCaseData created: TestCreateBuildFormsAndroidWithOutMobileBackend | |
TestCaseData created: TestCreateBuildNativeApp | |
TestCaseData created: TestCreateBuildMultiPlatformSpriteKitGame | |
TestCaseData created: TestCreateBuildMultiPlatformSceneKitGame | |
TestCaseData created: TestCreateBuildMultiPlatformSharedProject | |
TestCaseData created: TestCreateBuildMultiPlatformPortableLibrary | |
TestCaseData created: TestCreateBuildMultiPlatformClassLibrary | |
TestCaseData created: TestCreateBuildMultiPlatformUITestApp | |
TestCaseData created: TestCreateBuildBlankFormsPCLAndroidIOS | |
TestCaseData created: TestCreateBuildBlankFormsPCLIOS | |
TestCaseData created: TestCreateBuildBlankFormsPCLAndroid | |
TestCaseData created: TestCreateBuildBlankFormsSharedAndroidIOS | |
TestCaseData created: TestCreateBuildBlankFormsSharedIOS | |
TestCaseData created: TestCreateBuildBlankFormsSharedAndroid | |
TestCaseData created: TestCreateBuildBlankNativeAppPCLAndroidIOS | |
TestCaseData created: TestCreateBuildBlankNativeAppPCLIOS | |
TestCaseData created: TestCreateBuildBlankNativeAppPCLAndroid | |
TestCaseData created: TestCreateBuildBlankNativeAppSharedAndroidIOS | |
TestCaseData created: TestCreateBuildBlankNativeAppSharedIOS | |
TestCaseData created: TestCreateBuildBlankNativeAppSharedAndroid | |
Leaving TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.SimpleNuGetTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestIfReadmeTxtOpensiOS | |
TestCaseData created: TestIfReadmeTxtOpensAndroid | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestIfReadmeTxtOpensWhenUpdatingiOS | |
TestCaseData created: TestIfReadmeTxtOpensWhenUpdatingAndroid | |
Leaving TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.AndroidOrgIdentifierTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.IOSOrgIdentifierTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.MultiPlatformsOrgIdentifierTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildMiscGenericProject | |
TestCaseData created: TestCreateBuildMiscPackagingProject | |
TestCaseData created: TestCreateBuildCCPlusSharedLibrary | |
TestCaseData created: TestCreateBuildCCPlusStaticLibrary | |
TestCaseData created: TestCreateBuildCCPlusConsoleProject | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateDroidAppWithoutInsightsAndEnable | |
TestCaseData created: TestCreateDroidAppFSharpWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFormsAndroidIOSMobileBackendWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFormsIOSMobileBackendWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFormsAndroidMobileBackendWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFormsAndroidIOSWithOutMobileBackendWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFormsIOSWithOutMobileBackendWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFormsAndroidWithOutMobileBackendWithoutInsightsAndEnable | |
TestCaseData created: TestCreateIOSSingleViewAppWithoutInsightsAndEnable | |
TestCaseData created: TestCreateFSharpIOSSingleViewAppWithoutInsightsAndEnable | |
Leaving TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.CloneTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:27 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.StashManagerTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: WatchOS1App | |
TestCaseData created: WatchOS2App | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: WatchOSSceneKitGame | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: WatchOSSpriteKitGame | |
TestCaseData created: WatchOSLibrary | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildTvOSSingleViewApp | |
TestCaseData created: TestCreateBuildTvOSTabbedApp | |
TestCaseData created: TestCreateBuildTvOSSpriteKitGame | |
TestCaseData created: TestCreateBuildTvOSSceneKitGame | |
TestCaseData created: TestCreateBuildTvOSMetalGame | |
TestCaseData created: TestCreateBuildTvOSClassLibrary | |
TestCaseData created: TestCreateBuildTvOSBindingsLibrary | |
Leaving TestDataFactory ToTestCaseData | |
Entered TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildTvOSBroadcastUIExtension | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
TestCaseData created: TestCreateBuildTvOSBroadcastUploadExtension | |
TestCaseData created: TestCreateBuildTvOSExtensionServicesApp | |
Leaving TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: The value of USE_MSBUILD_XS is '' | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.IOSPublishingTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.AndroidPublishingTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.DotNetCoreTemplateTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
Entered TestDataFactory ToTestCaseData | |
TestCaseData created: TestCreateBuildConsoleApplication | |
TestCaseData created: TestCreateBuildFSharpConsoleApplication | |
TestCaseData created: TestCreateBuildASPDotNetCoreEmpty | |
TestCaseData created: TestCreateBuildASPDotNetCoreWebAppMVC | |
TestCaseData created: TestCreateBuildASPDotNetCoreWebAPI | |
TestCaseData created: TestCreateBuildDotNetStandardLibrary | |
TestCaseData created: TestCreateBuildFSharpDotNetStandardLibrary | |
TestCaseData created: TestCreateBuildXUnitTestProject | |
TestCaseData created: TestCreateBuildFSharpXUnitTestProject | |
TestCaseData created: TestCreateBuildASPDotNetCoreWebApp | |
TestCaseData created: TestCreateBuildMSTestProject | |
TestCaseData created: TestCreateBuildFSharpMSTestProject | |
Leaving TestDataFactory ToTestCaseData | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.DotNetCoreNuGetTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.AddDisableClearBreakpoint' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.ConnectedServicesTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.AndroidAOTTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA: xcode-select -p | |
#[2017-12-27 16:07:28 +05:30] XQA: /Applications/Xcode.app/Contents/Developer | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.AndroidProguardTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: MacOS SemVer required for test 'XQA.XS.Tests.EmbedAssemblyInNativeCodeTests' is [>=10.12]. Found: 10.12.0. The test/fixture would run: True | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.MacSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.TvOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.TvOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.AndroidSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.AndroidSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.IOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.IOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.IOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.IOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:28 +05:30] XQA_INFO: Skipping test [XQA.Ide.IOSSampleOptions] DispatchQueueException for Dispatch Queue exception - Dispatch Queue exception because one of these bugs is still not fixed - 58352 | |
#[2017-12-27 16:07:29 +05:30] XQA: defaults write "/Users/globallogic/Library/Preferences/com.microsoft.visual-studio.plist" com.monodevelop.AccessibilityEnabled true | |
#[2017-12-27 16:07:31 +05:30] XQA_INFO: Deleting the savedState for com.xamarin.visualstudio at /Users/globallogic/Library/Saved Application State/com.xamarin.visualstudio.savedState | |
#[2017-12-27 16:07:31 +05:30] XQA_INFO: Did not find saved state at '/Users/globallogic/Library/Saved Application State/com.xamarin.visualstudio.savedState' | |
#[2017-12-27 16:07:31 +05:30] XQA_INFO: Deleting the savedState for com.xamarin.visual-studio at /Users/globallogic/Library/Saved Application State/com.xamarin.visual-studio.savedState | |
#[2017-12-27 16:07:31 +05:30] XQA_INFO: Did not find saved state at '/Users/globallogic/Library/Saved Application State/com.xamarin.visual-studio.savedState' | |
#[2017-12-27 16:07:31 +05:30] XQA: pgrep -xil "VisualStudio" | |
The processes with name 'VisualStudio' is: | |
XQA.Core.ProcessResult | |
Command to kill processes: pkill -9 -xil "VisualStudio" | |
#[2017-12-27 16:07:31 +05:30] XQA: pkill -9 -xil "VisualStudio" | |
#[2017-12-27 16:07:31 +05:30] XQA: No matching processes belonging to you were found | |
#[2017-12-27 16:08:06 +05:30] XQA_INFO: [Resiliency.Polly.Policies]: Delegate has thrown System.TypeLoadException: Could not load type of field 'Microsoft.WindowsAzure.Storage.Blob.BlobEncryptionPolicy:<Key>k__BackingField' (1) due to: Could not load file or assembly 'Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:<unknown type> member:<none> | |
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.UploadFromStream (System.IO.Stream source, Microsoft.WindowsAzure.Storage.AccessCondition accessCondition, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions options, Microsoft.WindowsAzure.Storage.OperationContext operationContext) [0x00000] in <c69bf8bb7e9f4ff3a055a52f661f6fcd>:0 | |
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.UploadFromByteArray (System.Byte[] buffer, System.Int32 index, System.Int32 count, Microsoft.WindowsAzure.Storage.AccessCondition accessCondition, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions options, Microsoft.WindowsAzure.Storage.OperationContext operationContext) [0x00014] in <c69bf8bb7e9f4ff3a055a52f661f6fcd>:0 | |
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.UploadText (System.String content, System.Text.Encoding encoding, Microsoft.WindowsAzure.Storage.AccessCondition accessCondition, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions options, Microsoft.WindowsAzure.Storage.OperationContext operationContext) [0x0001c] in <c69bf8bb7e9f4ff3a055a52f661f6fcd>:0 | |
at XQA.Core.AzureStorageClient+<>c__DisplayClass8_0.<UploadStringWithContentType>b__0 () [0x00000] in /Users/globallogic/Documents/AndroidDeployArrayTakeTest/QualityAssurance/Automation/XQA/XQA.Core/Clients/AzureStorageClient.cs:69 | |
at Polly.RetrySyntax+<>c__DisplayClass10_0.<WaitAndRetry>b__1 () [0x00000] in <1b91e1eef2dd437f82921fe10cfdfe86>:0 | |
at (wrapper delegate-invoke) System.Func`1[Polly.Utilities.EmptyStruct]:invoke_TResult () | |
at Polly.Retry.RetryEngine.Implementation[TResult] (System.Func`1[TResult] action, System.Collections.Generic.IEnumerable`1[T] shouldRetryExceptionPredicates, System.Collections.Generic.IEnumerable`1[T] shouldRetryResultPredicates, System.Func`1[TResult] policyStateFactory) [0x0000e] in <1b91e1eef2dd437f82921fe10cfdfe86>:0 , retrying... | |
#[2017-12-27 16:08:09 +05:30] XQA: Command ls /usr/local/share/dotnet/shared/Microsoft.NETCore.App/ | |
#[2017-12-27 16:08:09 +05:30] XQA: 1.0.5 | |
1.1.2 | |
2.0.0 | |
2.0.0-preview2-25407-01 | |
#[2017-12-27 16:08:48 +05:30] XQA: /usr/local/bin/cliclick -m verbose "t:;" | |
#[2017-12-27 16:08:48 +05:30] XQA: Type: “;” | |
#[2017-12-27 16:08:50 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:08:54 +05:30] XQA: using System; | |
#[2017-12-27 16:08:54 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:08:54 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:08:54 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:08:54 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:08:54 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:08:54 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:08:54 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:08:54 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:08:54 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:08:54 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:08:54 +05:30] XQA: }, | |
#[2017-12-27 16:08:54 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:08:54 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:08:54 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: ); | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:08:54 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:08:54 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:08:54 +05:30] XQA: }, | |
#[2017-12-27 16:08:54 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:08:54 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:08:54 +05:30] XQA: }, | |
#[2017-12-27 16:08:54 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: ); | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:08:54 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:08:54 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:08:54 +05:30] XQA: }, | |
#[2017-12-27 16:08:54 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:08:54 +05:30] XQA: }); | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:08:54 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:08:54 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:08:54 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:08:54 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:08:54 +05:30] XQA: )); | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:08:54 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:08:54 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:08:54 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:08:54 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: return studio; | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:08:54 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:08:54 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: license | |
#[2017-12-27 16:08:54 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:08:54 +05:30] XQA: { | |
#[2017-12-27 16:08:54 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:08:54 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:08:54 +05:30] XQA: }); | |
#[2017-12-27 16:08:54 +05:30] XQA: }); | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:08:54 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:08:54 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:54 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:08:54 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:08:54 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: } | |
#[2017-12-27 16:08:54 +05:30] XQA: | |
#[2017-12-27 16:08:57 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:08:58 +05:30] XQA: using System; | |
#[2017-12-27 16:08:58 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:08:58 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:08:58 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:08:58 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:08:58 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:08:58 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:08:58 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:08:58 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:08:58 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:08:58 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:08:58 +05:30] XQA: }, | |
#[2017-12-27 16:08:58 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:08:58 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:08:58 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: ); | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:08:58 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:08:58 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:08:58 +05:30] XQA: }, | |
#[2017-12-27 16:08:58 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:08:58 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:08:58 +05:30] XQA: }, | |
#[2017-12-27 16:08:58 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: ); | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:08:58 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:08:58 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:08:58 +05:30] XQA: }, | |
#[2017-12-27 16:08:58 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:08:58 +05:30] XQA: }); | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:08:58 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:08:58 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:08:58 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:08:58 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:08:58 +05:30] XQA: )); | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:08:58 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:08:58 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:08:58 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:08:58 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: return studio; | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:08:58 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:08:58 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: license | |
#[2017-12-27 16:08:58 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:08:58 +05:30] XQA: { | |
#[2017-12-27 16:08:58 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:08:58 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:08:58 +05:30] XQA: }); | |
#[2017-12-27 16:08:58 +05:30] XQA: }); | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:08:58 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:08:58 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:08:58 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:08:58 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:08:58 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: } | |
#[2017-12-27 16:08:58 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:01 +05:30] XQA: using System; | |
#[2017-12-27 16:09:01 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:01 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:01 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:01 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:01 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:01 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:01 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:01 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:01 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:01 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:01 +05:30] XQA: }, | |
#[2017-12-27 16:09:01 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:01 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:01 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: ); | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:01 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:01 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:01 +05:30] XQA: }, | |
#[2017-12-27 16:09:01 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:01 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:01 +05:30] XQA: }, | |
#[2017-12-27 16:09:01 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: ); | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:01 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:01 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:01 +05:30] XQA: }, | |
#[2017-12-27 16:09:01 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:01 +05:30] XQA: }); | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:01 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:01 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:01 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:01 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:01 +05:30] XQA: )); | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:01 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:01 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:01 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:01 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:01 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:01 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: license | |
#[2017-12-27 16:09:01 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:01 +05:30] XQA: { | |
#[2017-12-27 16:09:01 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:01 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:01 +05:30] XQA: }); | |
#[2017-12-27 16:09:01 +05:30] XQA: }); | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:01 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:01 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:01 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:01 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:01 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: } | |
#[2017-12-27 16:09:01 +05:30] XQA: | |
#[2017-12-27 16:09:04 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:05 +05:30] XQA: using System; | |
#[2017-12-27 16:09:05 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:05 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:05 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:05 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:05 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:05 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:05 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:05 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:05 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:05 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:05 +05:30] XQA: }, | |
#[2017-12-27 16:09:05 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:05 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:05 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: ); | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:05 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:05 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:05 +05:30] XQA: }, | |
#[2017-12-27 16:09:05 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:05 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:05 +05:30] XQA: }, | |
#[2017-12-27 16:09:05 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: ); | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:05 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:05 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:05 +05:30] XQA: }, | |
#[2017-12-27 16:09:05 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:05 +05:30] XQA: }); | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:05 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:05 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:05 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:05 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:05 +05:30] XQA: )); | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:05 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:05 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:05 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:05 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:05 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:05 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: license | |
#[2017-12-27 16:09:05 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:05 +05:30] XQA: { | |
#[2017-12-27 16:09:05 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:05 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:05 +05:30] XQA: }); | |
#[2017-12-27 16:09:05 +05:30] XQA: }); | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:05 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:05 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:05 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:05 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:05 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: } | |
#[2017-12-27 16:09:05 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:08 +05:30] XQA: using System; | |
#[2017-12-27 16:09:08 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:08 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:08 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:08 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:08 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:08 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:08 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:08 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:08 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:08 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:08 +05:30] XQA: }, | |
#[2017-12-27 16:09:08 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:08 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:08 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: ); | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:08 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:08 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:08 +05:30] XQA: }, | |
#[2017-12-27 16:09:08 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:08 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:08 +05:30] XQA: }, | |
#[2017-12-27 16:09:08 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: ); | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:08 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:08 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:08 +05:30] XQA: }, | |
#[2017-12-27 16:09:08 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:08 +05:30] XQA: }); | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:08 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:08 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:08 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:08 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:08 +05:30] XQA: )); | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:08 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:08 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:08 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:08 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:08 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:08 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: license | |
#[2017-12-27 16:09:08 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:08 +05:30] XQA: { | |
#[2017-12-27 16:09:08 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:08 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:08 +05:30] XQA: }); | |
#[2017-12-27 16:09:08 +05:30] XQA: }); | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:08 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:08 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:08 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:08 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:08 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: } | |
#[2017-12-27 16:09:08 +05:30] XQA: | |
#[2017-12-27 16:09:11 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:12 +05:30] XQA: using System; | |
#[2017-12-27 16:09:12 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:12 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:12 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:12 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:12 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:12 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:12 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:12 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:12 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:12 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:12 +05:30] XQA: }, | |
#[2017-12-27 16:09:12 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:12 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:12 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: ); | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:12 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:12 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:12 +05:30] XQA: }, | |
#[2017-12-27 16:09:12 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:12 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:12 +05:30] XQA: }, | |
#[2017-12-27 16:09:12 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: ); | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:12 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:12 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:12 +05:30] XQA: }, | |
#[2017-12-27 16:09:12 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:12 +05:30] XQA: }); | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:12 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:12 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:12 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:12 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:12 +05:30] XQA: )); | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:12 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:12 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:12 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:12 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:12 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:12 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: license | |
#[2017-12-27 16:09:12 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:12 +05:30] XQA: { | |
#[2017-12-27 16:09:12 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:12 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:12 +05:30] XQA: }); | |
#[2017-12-27 16:09:12 +05:30] XQA: }); | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:12 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:12 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:12 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:12 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:12 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: } | |
#[2017-12-27 16:09:12 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:15 +05:30] XQA: using System; | |
#[2017-12-27 16:09:15 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:15 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:15 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:15 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:15 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:15 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:15 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:15 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:15 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:15 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:15 +05:30] XQA: }, | |
#[2017-12-27 16:09:15 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:15 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:15 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: ); | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:15 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:15 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:15 +05:30] XQA: }, | |
#[2017-12-27 16:09:15 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:15 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:15 +05:30] XQA: }, | |
#[2017-12-27 16:09:15 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: ); | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:15 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:15 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:15 +05:30] XQA: }, | |
#[2017-12-27 16:09:15 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:15 +05:30] XQA: }); | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:15 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:15 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:15 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:15 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:15 +05:30] XQA: )); | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:15 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:15 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:15 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:15 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:15 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:15 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: license | |
#[2017-12-27 16:09:15 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:15 +05:30] XQA: { | |
#[2017-12-27 16:09:15 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:15 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:15 +05:30] XQA: }); | |
#[2017-12-27 16:09:15 +05:30] XQA: }); | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:15 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:15 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:15 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:15 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:15 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: } | |
#[2017-12-27 16:09:15 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:18 +05:30] XQA: using System; | |
#[2017-12-27 16:09:18 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:18 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:18 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:18 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:18 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:18 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:18 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:18 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:18 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:18 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:18 +05:30] XQA: }, | |
#[2017-12-27 16:09:18 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:18 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:18 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: ); | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:18 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:18 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:18 +05:30] XQA: }, | |
#[2017-12-27 16:09:18 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:18 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:18 +05:30] XQA: }, | |
#[2017-12-27 16:09:18 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: ); | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:18 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:18 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:18 +05:30] XQA: }, | |
#[2017-12-27 16:09:18 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:18 +05:30] XQA: }); | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:18 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:18 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:18 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:18 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:18 +05:30] XQA: )); | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:18 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:18 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:18 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:18 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:18 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:18 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: license | |
#[2017-12-27 16:09:18 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:18 +05:30] XQA: { | |
#[2017-12-27 16:09:18 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:18 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:18 +05:30] XQA: }); | |
#[2017-12-27 16:09:18 +05:30] XQA: }); | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:18 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:18 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:18 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:18 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:18 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: } | |
#[2017-12-27 16:09:18 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:22 +05:30] XQA: using System; | |
#[2017-12-27 16:09:22 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:22 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:22 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:22 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:22 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:22 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:22 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:22 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:22 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:22 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:22 +05:30] XQA: }, | |
#[2017-12-27 16:09:22 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:22 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:22 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: ); | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:22 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:22 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:22 +05:30] XQA: }, | |
#[2017-12-27 16:09:22 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:22 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:22 +05:30] XQA: }, | |
#[2017-12-27 16:09:22 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: ); | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:22 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:22 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:22 +05:30] XQA: }, | |
#[2017-12-27 16:09:22 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:22 +05:30] XQA: }); | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:22 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:22 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:22 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:22 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:22 +05:30] XQA: )); | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:22 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:22 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:22 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:22 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:22 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:22 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: license | |
#[2017-12-27 16:09:22 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:22 +05:30] XQA: { | |
#[2017-12-27 16:09:22 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:22 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:22 +05:30] XQA: }); | |
#[2017-12-27 16:09:22 +05:30] XQA: }); | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:22 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:22 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:22 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:22 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:22 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: } | |
#[2017-12-27 16:09:22 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:25 +05:30] XQA: using System; | |
#[2017-12-27 16:09:25 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:25 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:25 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:25 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:25 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:25 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:25 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:25 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:25 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:25 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:25 +05:30] XQA: }, | |
#[2017-12-27 16:09:25 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:25 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:25 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: ); | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:25 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:25 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:25 +05:30] XQA: }, | |
#[2017-12-27 16:09:25 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:25 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:25 +05:30] XQA: }, | |
#[2017-12-27 16:09:25 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: ); | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:25 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:25 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:25 +05:30] XQA: }, | |
#[2017-12-27 16:09:25 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:25 +05:30] XQA: }); | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:25 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:25 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:25 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:25 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:25 +05:30] XQA: )); | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:25 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:25 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:25 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:25 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:25 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:25 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: license | |
#[2017-12-27 16:09:25 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:25 +05:30] XQA: { | |
#[2017-12-27 16:09:25 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:25 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:25 +05:30] XQA: }); | |
#[2017-12-27 16:09:25 +05:30] XQA: }); | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:25 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:25 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:25 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:25 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:25 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: } | |
#[2017-12-27 16:09:25 +05:30] XQA: | |
#[2017-12-27 16:09:28 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:29 +05:30] XQA: using System; | |
#[2017-12-27 16:09:29 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:29 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:29 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:29 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:29 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:29 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:29 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:29 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:29 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:29 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:29 +05:30] XQA: }, | |
#[2017-12-27 16:09:29 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:29 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:29 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: ); | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:29 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:29 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:29 +05:30] XQA: }, | |
#[2017-12-27 16:09:29 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:29 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:29 +05:30] XQA: }, | |
#[2017-12-27 16:09:29 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: ); | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:29 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:29 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:29 +05:30] XQA: }, | |
#[2017-12-27 16:09:29 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:29 +05:30] XQA: }); | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:29 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:29 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:29 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:29 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:29 +05:30] XQA: )); | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:29 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:29 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:29 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:29 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:29 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:29 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: license | |
#[2017-12-27 16:09:29 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:29 +05:30] XQA: { | |
#[2017-12-27 16:09:29 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:29 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:29 +05:30] XQA: }); | |
#[2017-12-27 16:09:29 +05:30] XQA: }); | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:29 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:29 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:29 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:29 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:29 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: } | |
#[2017-12-27 16:09:29 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:32 +05:30] XQA: using System; | |
#[2017-12-27 16:09:32 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:32 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:32 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:32 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:32 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:32 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:32 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:32 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:32 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:32 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:32 +05:30] XQA: }, | |
#[2017-12-27 16:09:32 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:32 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:32 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: ); | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:32 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:32 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:32 +05:30] XQA: }, | |
#[2017-12-27 16:09:32 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:32 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:32 +05:30] XQA: }, | |
#[2017-12-27 16:09:32 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: ); | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:32 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:32 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:32 +05:30] XQA: }, | |
#[2017-12-27 16:09:32 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:32 +05:30] XQA: }); | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:32 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:32 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:32 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:32 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:32 +05:30] XQA: )); | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:32 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:32 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:32 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:32 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:32 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:32 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: license | |
#[2017-12-27 16:09:32 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:32 +05:30] XQA: { | |
#[2017-12-27 16:09:32 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:32 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:32 +05:30] XQA: }); | |
#[2017-12-27 16:09:32 +05:30] XQA: }); | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:32 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:32 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:32 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:32 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:32 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: } | |
#[2017-12-27 16:09:32 +05:30] XQA: | |
#[2017-12-27 16:09:35 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:36 +05:30] XQA: using System; | |
#[2017-12-27 16:09:36 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:36 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:36 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:36 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:36 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:36 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:36 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:36 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:36 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:36 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:36 +05:30] XQA: }, | |
#[2017-12-27 16:09:36 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:36 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:36 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: ); | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:36 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:36 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:36 +05:30] XQA: }, | |
#[2017-12-27 16:09:36 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:36 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:36 +05:30] XQA: }, | |
#[2017-12-27 16:09:36 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: ); | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:36 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:36 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:36 +05:30] XQA: }, | |
#[2017-12-27 16:09:36 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:36 +05:30] XQA: }); | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:36 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:36 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:36 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:36 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:36 +05:30] XQA: )); | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:36 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:36 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:36 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:36 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:36 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:36 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: license | |
#[2017-12-27 16:09:36 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:36 +05:30] XQA: { | |
#[2017-12-27 16:09:36 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:36 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:36 +05:30] XQA: }); | |
#[2017-12-27 16:09:36 +05:30] XQA: }); | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:36 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:36 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:36 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:36 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:36 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: } | |
#[2017-12-27 16:09:36 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:39 +05:30] XQA: using System; | |
#[2017-12-27 16:09:39 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:39 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:39 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:39 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:39 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:39 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:39 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:39 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:39 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:39 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:39 +05:30] XQA: }, | |
#[2017-12-27 16:09:39 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:39 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:39 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: ); | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:39 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:39 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:39 +05:30] XQA: }, | |
#[2017-12-27 16:09:39 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:39 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:39 +05:30] XQA: }, | |
#[2017-12-27 16:09:39 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: ); | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:39 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:39 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:39 +05:30] XQA: }, | |
#[2017-12-27 16:09:39 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:39 +05:30] XQA: }); | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:39 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:39 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:39 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:39 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:39 +05:30] XQA: )); | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:39 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:39 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:39 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:39 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:39 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:39 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: license | |
#[2017-12-27 16:09:39 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:39 +05:30] XQA: { | |
#[2017-12-27 16:09:39 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:39 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:39 +05:30] XQA: }); | |
#[2017-12-27 16:09:39 +05:30] XQA: }); | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:39 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:39 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:39 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:39 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:39 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: } | |
#[2017-12-27 16:09:39 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:42 +05:30] XQA: using System; | |
#[2017-12-27 16:09:42 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:42 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:42 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:42 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:42 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:42 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:42 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:42 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:42 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:42 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:42 +05:30] XQA: }, | |
#[2017-12-27 16:09:42 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:42 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:42 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: ); | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:42 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:42 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:42 +05:30] XQA: }, | |
#[2017-12-27 16:09:42 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:42 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:42 +05:30] XQA: }, | |
#[2017-12-27 16:09:42 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: ); | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:42 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:42 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:42 +05:30] XQA: }, | |
#[2017-12-27 16:09:42 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:42 +05:30] XQA: }); | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:42 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:42 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:42 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:42 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:42 +05:30] XQA: )); | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:42 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:42 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:42 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:42 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:42 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:42 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: license | |
#[2017-12-27 16:09:42 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:42 +05:30] XQA: { | |
#[2017-12-27 16:09:42 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:42 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:42 +05:30] XQA: }); | |
#[2017-12-27 16:09:42 +05:30] XQA: }); | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:42 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:42 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:42 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:42 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:42 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: } | |
#[2017-12-27 16:09:42 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:46 +05:30] XQA: using System; | |
#[2017-12-27 16:09:46 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:46 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:46 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:46 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:46 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:46 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:46 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:46 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:46 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:46 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:46 +05:30] XQA: }, | |
#[2017-12-27 16:09:46 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:46 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:46 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: ); | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:46 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:46 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:46 +05:30] XQA: }, | |
#[2017-12-27 16:09:46 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:46 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:46 +05:30] XQA: }, | |
#[2017-12-27 16:09:46 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: ); | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:46 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:46 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:46 +05:30] XQA: }, | |
#[2017-12-27 16:09:46 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:46 +05:30] XQA: }); | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:46 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:46 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:46 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:46 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:46 +05:30] XQA: )); | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:46 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:46 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:46 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:46 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:46 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:46 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: license | |
#[2017-12-27 16:09:46 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:46 +05:30] XQA: { | |
#[2017-12-27 16:09:46 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:46 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:46 +05:30] XQA: }); | |
#[2017-12-27 16:09:46 +05:30] XQA: }); | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:46 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:46 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:46 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:46 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:46 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: } | |
#[2017-12-27 16:09:46 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:49 +05:30] XQA: using System; | |
#[2017-12-27 16:09:49 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:49 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:49 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:49 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:49 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:49 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:49 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:49 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:49 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:49 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:49 +05:30] XQA: }, | |
#[2017-12-27 16:09:49 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:49 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:49 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: ); | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:49 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:49 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:49 +05:30] XQA: }, | |
#[2017-12-27 16:09:49 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:49 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:49 +05:30] XQA: }, | |
#[2017-12-27 16:09:49 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: ); | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:49 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:49 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:49 +05:30] XQA: }, | |
#[2017-12-27 16:09:49 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:49 +05:30] XQA: }); | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:49 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:49 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:49 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:49 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:49 +05:30] XQA: )); | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:49 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:49 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:49 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:49 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:49 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:49 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: license | |
#[2017-12-27 16:09:49 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:49 +05:30] XQA: { | |
#[2017-12-27 16:09:49 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:49 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:49 +05:30] XQA: }); | |
#[2017-12-27 16:09:49 +05:30] XQA: }); | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:49 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:49 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:49 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:49 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:49 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: } | |
#[2017-12-27 16:09:49 +05:30] XQA: | |
#[2017-12-27 16:09:52 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:53 +05:30] XQA: using System; | |
#[2017-12-27 16:09:53 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:53 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:53 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:53 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:53 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:53 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:53 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:53 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:53 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:53 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:53 +05:30] XQA: }, | |
#[2017-12-27 16:09:53 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:53 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:53 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: ); | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:53 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:53 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:53 +05:30] XQA: }, | |
#[2017-12-27 16:09:53 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:53 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:53 +05:30] XQA: }, | |
#[2017-12-27 16:09:53 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: ); | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:53 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:53 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:53 +05:30] XQA: }, | |
#[2017-12-27 16:09:53 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:53 +05:30] XQA: }); | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:53 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:53 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:53 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:53 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:53 +05:30] XQA: )); | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:53 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:53 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:53 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:53 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:53 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:53 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: license | |
#[2017-12-27 16:09:53 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:53 +05:30] XQA: { | |
#[2017-12-27 16:09:53 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:53 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:53 +05:30] XQA: }); | |
#[2017-12-27 16:09:53 +05:30] XQA: }); | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:53 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:53 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:53 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:53 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:53 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: } | |
#[2017-12-27 16:09:53 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:56 +05:30] XQA: using System; | |
#[2017-12-27 16:09:56 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:56 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:56 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:56 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:56 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:56 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:56 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:56 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:56 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:56 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:56 +05:30] XQA: }, | |
#[2017-12-27 16:09:56 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:56 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:56 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: ); | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:56 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:56 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:56 +05:30] XQA: }, | |
#[2017-12-27 16:09:56 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:56 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:56 +05:30] XQA: }, | |
#[2017-12-27 16:09:56 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: ); | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:56 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:56 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:56 +05:30] XQA: }, | |
#[2017-12-27 16:09:56 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:56 +05:30] XQA: }); | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:56 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:56 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:56 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:56 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:56 +05:30] XQA: )); | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:56 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:56 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:56 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:56 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:56 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:56 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: license | |
#[2017-12-27 16:09:56 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:56 +05:30] XQA: { | |
#[2017-12-27 16:09:56 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:56 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:56 +05:30] XQA: }); | |
#[2017-12-27 16:09:56 +05:30] XQA: }); | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:56 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:56 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:56 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:56 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:56 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: } | |
#[2017-12-27 16:09:56 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:09:59 +05:30] XQA: using System; | |
#[2017-12-27 16:09:59 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:09:59 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:09:59 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:09:59 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:09:59 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:09:59 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:59 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:09:59 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:09:59 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:09:59 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:09:59 +05:30] XQA: }, | |
#[2017-12-27 16:09:59 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:09:59 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:59 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: ); | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:09:59 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:59 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:59 +05:30] XQA: }, | |
#[2017-12-27 16:09:59 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:09:59 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:09:59 +05:30] XQA: }, | |
#[2017-12-27 16:09:59 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: ); | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:09:59 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:09:59 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:09:59 +05:30] XQA: }, | |
#[2017-12-27 16:09:59 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:09:59 +05:30] XQA: }); | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:09:59 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:09:59 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:09:59 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:09:59 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:09:59 +05:30] XQA: )); | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:09:59 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:09:59 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:09:59 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:09:59 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: return studio; | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:09:59 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:09:59 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: license | |
#[2017-12-27 16:09:59 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:09:59 +05:30] XQA: { | |
#[2017-12-27 16:09:59 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:09:59 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:09:59 +05:30] XQA: }); | |
#[2017-12-27 16:09:59 +05:30] XQA: }); | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:09:59 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:09:59 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:09:59 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:09:59 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:09:59 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: } | |
#[2017-12-27 16:09:59 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:03 +05:30] XQA: using System; | |
#[2017-12-27 16:10:03 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:03 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:03 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:03 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:03 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:03 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:03 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:03 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:03 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:03 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:03 +05:30] XQA: }, | |
#[2017-12-27 16:10:03 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:03 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:03 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: ); | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:03 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:03 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:03 +05:30] XQA: }, | |
#[2017-12-27 16:10:03 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:03 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:03 +05:30] XQA: }, | |
#[2017-12-27 16:10:03 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: ); | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:03 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:03 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:03 +05:30] XQA: }, | |
#[2017-12-27 16:10:03 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:03 +05:30] XQA: }); | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:03 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:03 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:03 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:03 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:03 +05:30] XQA: )); | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:03 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:03 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:03 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:03 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:03 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:03 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: license | |
#[2017-12-27 16:10:03 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:03 +05:30] XQA: { | |
#[2017-12-27 16:10:03 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:03 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:03 +05:30] XQA: }); | |
#[2017-12-27 16:10:03 +05:30] XQA: }); | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:03 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:03 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:03 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:03 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:03 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: } | |
#[2017-12-27 16:10:03 +05:30] XQA: | |
#[2017-12-27 16:10:09 +05:30] XQA: /usr/local/bin/cliclick -m verbose m:0,0 | |
#[2017-12-27 16:10:09 +05:30] XQA: Move to 0,0 | |
#[2017-12-27 16:10:24 +05:30] XQA: /usr/local/bin/cliclick -m verbose "t:;" | |
#[2017-12-27 16:10:24 +05:30] XQA: Type: “;” | |
#[2017-12-27 16:10:27 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:27 +05:30] XQA: using System; | |
#[2017-12-27 16:10:27 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:27 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:27 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:27 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:27 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:27 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:27 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:27 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:27 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:27 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:27 +05:30] XQA: }, | |
#[2017-12-27 16:10:27 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:27 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:27 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: ); | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:27 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:27 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:27 +05:30] XQA: }, | |
#[2017-12-27 16:10:27 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:27 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:27 +05:30] XQA: }, | |
#[2017-12-27 16:10:27 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: ); | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:27 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:27 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:27 +05:30] XQA: }, | |
#[2017-12-27 16:10:27 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:27 +05:30] XQA: }); | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:27 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:27 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:27 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:27 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:27 +05:30] XQA: )); | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:27 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:27 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:27 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:27 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:27 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:27 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: license | |
#[2017-12-27 16:10:27 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:27 +05:30] XQA: { | |
#[2017-12-27 16:10:27 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:27 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:27 +05:30] XQA: }); | |
#[2017-12-27 16:10:27 +05:30] XQA: }); | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:27 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:27 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:27 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:27 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:27 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: } | |
#[2017-12-27 16:10:27 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:30 +05:30] XQA: using System; | |
#[2017-12-27 16:10:30 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:30 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:30 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:30 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:30 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:30 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:30 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:30 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:30 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:30 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:30 +05:30] XQA: }, | |
#[2017-12-27 16:10:30 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:30 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:30 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: ); | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:30 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:30 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:30 +05:30] XQA: }, | |
#[2017-12-27 16:10:30 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:30 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:30 +05:30] XQA: }, | |
#[2017-12-27 16:10:30 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: ); | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:30 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:30 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:30 +05:30] XQA: }, | |
#[2017-12-27 16:10:30 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:30 +05:30] XQA: }); | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:30 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:30 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:30 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:30 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:30 +05:30] XQA: )); | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:30 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:30 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:30 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:30 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:30 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:30 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: license | |
#[2017-12-27 16:10:30 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:30 +05:30] XQA: { | |
#[2017-12-27 16:10:30 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:30 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:30 +05:30] XQA: }); | |
#[2017-12-27 16:10:30 +05:30] XQA: }); | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:30 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:30 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:30 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:30 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:30 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: } | |
#[2017-12-27 16:10:30 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:34 +05:30] XQA: using System; | |
#[2017-12-27 16:10:34 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:34 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:34 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:34 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:34 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:34 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:34 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:34 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:34 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:34 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:34 +05:30] XQA: }, | |
#[2017-12-27 16:10:34 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:34 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:34 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: ); | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:34 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:34 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:34 +05:30] XQA: }, | |
#[2017-12-27 16:10:34 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:34 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:34 +05:30] XQA: }, | |
#[2017-12-27 16:10:34 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: ); | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:34 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:34 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:34 +05:30] XQA: }, | |
#[2017-12-27 16:10:34 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:34 +05:30] XQA: }); | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:34 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:34 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:34 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:34 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:34 +05:30] XQA: )); | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:34 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:34 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:34 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:34 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:34 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:34 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: license | |
#[2017-12-27 16:10:34 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:34 +05:30] XQA: { | |
#[2017-12-27 16:10:34 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:34 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:34 +05:30] XQA: }); | |
#[2017-12-27 16:10:34 +05:30] XQA: }); | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:34 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:34 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:34 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:34 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:34 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: } | |
#[2017-12-27 16:10:34 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:37 +05:30] XQA: using System; | |
#[2017-12-27 16:10:37 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:37 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:37 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:37 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:37 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:37 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:37 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:37 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:37 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:37 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:37 +05:30] XQA: }, | |
#[2017-12-27 16:10:37 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:37 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:37 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: ); | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:37 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:37 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:37 +05:30] XQA: }, | |
#[2017-12-27 16:10:37 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:37 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:37 +05:30] XQA: }, | |
#[2017-12-27 16:10:37 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: ); | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:37 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:37 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:37 +05:30] XQA: }, | |
#[2017-12-27 16:10:37 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:37 +05:30] XQA: }); | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:37 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:37 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:37 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:37 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:37 +05:30] XQA: )); | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:37 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:37 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:37 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:37 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:37 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:37 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: license | |
#[2017-12-27 16:10:37 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:37 +05:30] XQA: { | |
#[2017-12-27 16:10:37 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:37 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:37 +05:30] XQA: }); | |
#[2017-12-27 16:10:37 +05:30] XQA: }); | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:37 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:37 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:37 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:37 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:37 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: } | |
#[2017-12-27 16:10:37 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:41 +05:30] XQA: using System; | |
#[2017-12-27 16:10:41 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:41 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:41 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:41 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:41 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:41 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:41 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:41 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:41 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:41 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:41 +05:30] XQA: }, | |
#[2017-12-27 16:10:41 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:41 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:41 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: ); | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:41 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:41 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:41 +05:30] XQA: }, | |
#[2017-12-27 16:10:41 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:41 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:41 +05:30] XQA: }, | |
#[2017-12-27 16:10:41 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: ); | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:41 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:41 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:41 +05:30] XQA: }, | |
#[2017-12-27 16:10:41 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:41 +05:30] XQA: }); | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:41 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:41 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:41 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:41 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:41 +05:30] XQA: )); | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:41 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:41 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:41 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:41 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:41 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:41 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: license | |
#[2017-12-27 16:10:41 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:41 +05:30] XQA: { | |
#[2017-12-27 16:10:41 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:41 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:41 +05:30] XQA: }); | |
#[2017-12-27 16:10:41 +05:30] XQA: }); | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:41 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:41 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:41 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:41 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:41 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: } | |
#[2017-12-27 16:10:41 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:44 +05:30] XQA: using System; | |
#[2017-12-27 16:10:44 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:44 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:44 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:44 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:44 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:44 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:44 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:44 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:44 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:44 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:44 +05:30] XQA: }, | |
#[2017-12-27 16:10:44 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:44 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:44 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: ); | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:44 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:44 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:44 +05:30] XQA: }, | |
#[2017-12-27 16:10:44 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:44 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:44 +05:30] XQA: }, | |
#[2017-12-27 16:10:44 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: ); | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:44 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:44 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:44 +05:30] XQA: }, | |
#[2017-12-27 16:10:44 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:44 +05:30] XQA: }); | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:44 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:44 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:44 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:44 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:44 +05:30] XQA: )); | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:44 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:44 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:44 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:44 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:44 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:44 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: license | |
#[2017-12-27 16:10:44 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:44 +05:30] XQA: { | |
#[2017-12-27 16:10:44 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:44 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:44 +05:30] XQA: }); | |
#[2017-12-27 16:10:44 +05:30] XQA: }); | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:44 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:44 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:44 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:44 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:44 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: } | |
#[2017-12-27 16:10:44 +05:30] XQA: | |
#[2017-12-27 16:10:47 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:48 +05:30] XQA: using System; | |
#[2017-12-27 16:10:48 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:48 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:48 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:48 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:48 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:48 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:48 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:48 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:48 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:48 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:48 +05:30] XQA: }, | |
#[2017-12-27 16:10:48 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:48 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:48 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: ); | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:48 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:48 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:48 +05:30] XQA: }, | |
#[2017-12-27 16:10:48 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:48 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:48 +05:30] XQA: }, | |
#[2017-12-27 16:10:48 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: ); | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:48 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:48 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:48 +05:30] XQA: }, | |
#[2017-12-27 16:10:48 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:48 +05:30] XQA: }); | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:48 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:48 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:48 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:48 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:48 +05:30] XQA: )); | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:48 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:48 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:48 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:48 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:48 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:48 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: license | |
#[2017-12-27 16:10:48 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:48 +05:30] XQA: { | |
#[2017-12-27 16:10:48 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:48 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:48 +05:30] XQA: }); | |
#[2017-12-27 16:10:48 +05:30] XQA: }); | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:48 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:48 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:48 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:48 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:48 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: } | |
#[2017-12-27 16:10:48 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:51 +05:30] XQA: using System; | |
#[2017-12-27 16:10:51 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:51 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:51 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:51 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:51 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:51 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:51 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:51 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:51 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:51 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:51 +05:30] XQA: }, | |
#[2017-12-27 16:10:51 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:51 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:51 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: ); | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:51 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:51 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:51 +05:30] XQA: }, | |
#[2017-12-27 16:10:51 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:51 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:51 +05:30] XQA: }, | |
#[2017-12-27 16:10:51 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: ); | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:51 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:51 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:51 +05:30] XQA: }, | |
#[2017-12-27 16:10:51 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:51 +05:30] XQA: }); | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:51 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:51 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:51 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:51 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:51 +05:30] XQA: )); | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:51 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:51 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:51 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:51 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:51 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:51 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: license | |
#[2017-12-27 16:10:51 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:51 +05:30] XQA: { | |
#[2017-12-27 16:10:51 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:51 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:51 +05:30] XQA: }); | |
#[2017-12-27 16:10:51 +05:30] XQA: }); | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:51 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:51 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:51 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:51 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:51 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: } | |
#[2017-12-27 16:10:51 +05:30] XQA: | |
#[2017-12-27 16:10:54 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:55 +05:30] XQA: using System; | |
#[2017-12-27 16:10:55 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:55 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:55 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:55 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:55 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:55 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:55 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:55 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:55 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:55 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:55 +05:30] XQA: }, | |
#[2017-12-27 16:10:55 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:55 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:55 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: ); | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:55 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:55 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:55 +05:30] XQA: }, | |
#[2017-12-27 16:10:55 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:55 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:55 +05:30] XQA: }, | |
#[2017-12-27 16:10:55 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: ); | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:55 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:55 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:55 +05:30] XQA: }, | |
#[2017-12-27 16:10:55 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:55 +05:30] XQA: }); | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:55 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:55 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:55 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:55 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:55 +05:30] XQA: )); | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:55 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:55 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:55 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:55 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:55 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:55 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: license | |
#[2017-12-27 16:10:55 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:55 +05:30] XQA: { | |
#[2017-12-27 16:10:55 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:55 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:55 +05:30] XQA: }); | |
#[2017-12-27 16:10:55 +05:30] XQA: }); | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:55 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:55 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:55 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:55 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:55 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: } | |
#[2017-12-27 16:10:55 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:10:58 +05:30] XQA: using System; | |
#[2017-12-27 16:10:58 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:10:58 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:10:58 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:10:58 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:10:58 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:10:58 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:58 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:10:58 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:10:58 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:10:58 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:10:58 +05:30] XQA: }, | |
#[2017-12-27 16:10:58 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:10:58 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:58 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: ); | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:10:58 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:58 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:58 +05:30] XQA: }, | |
#[2017-12-27 16:10:58 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:10:58 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:10:58 +05:30] XQA: }, | |
#[2017-12-27 16:10:58 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: ); | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:10:58 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:10:58 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:10:58 +05:30] XQA: }, | |
#[2017-12-27 16:10:58 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:10:58 +05:30] XQA: }); | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:10:58 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:10:58 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:10:58 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:10:58 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:10:58 +05:30] XQA: )); | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:10:58 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:10:58 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:10:58 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:10:58 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: return studio; | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:10:58 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:10:58 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: license | |
#[2017-12-27 16:10:58 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:10:58 +05:30] XQA: { | |
#[2017-12-27 16:10:58 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:10:58 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:10:58 +05:30] XQA: }); | |
#[2017-12-27 16:10:58 +05:30] XQA: }); | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:10:58 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:10:58 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:10:58 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:10:58 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:10:58 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: } | |
#[2017-12-27 16:10:58 +05:30] XQA: | |
#[2017-12-27 16:11:01 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:02 +05:30] XQA: using System; | |
#[2017-12-27 16:11:02 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:02 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:02 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:02 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:02 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:02 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:02 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:02 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:02 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:02 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:02 +05:30] XQA: }, | |
#[2017-12-27 16:11:02 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:02 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:02 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: ); | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:02 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:02 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:02 +05:30] XQA: }, | |
#[2017-12-27 16:11:02 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:02 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:02 +05:30] XQA: }, | |
#[2017-12-27 16:11:02 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: ); | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:02 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:02 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:02 +05:30] XQA: }, | |
#[2017-12-27 16:11:02 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:02 +05:30] XQA: }); | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:02 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:02 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:02 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:02 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:02 +05:30] XQA: )); | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:02 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:02 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:02 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:02 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:02 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:02 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: license | |
#[2017-12-27 16:11:02 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:02 +05:30] XQA: { | |
#[2017-12-27 16:11:02 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:02 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:02 +05:30] XQA: }); | |
#[2017-12-27 16:11:02 +05:30] XQA: }); | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:02 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:02 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:02 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:02 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:02 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: } | |
#[2017-12-27 16:11:02 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:05 +05:30] XQA: using System; | |
#[2017-12-27 16:11:05 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:05 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:05 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:05 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:05 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:05 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:05 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:05 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:05 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:05 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:05 +05:30] XQA: }, | |
#[2017-12-27 16:11:05 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:05 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:05 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: ); | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:05 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:05 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:05 +05:30] XQA: }, | |
#[2017-12-27 16:11:05 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:05 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:05 +05:30] XQA: }, | |
#[2017-12-27 16:11:05 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: ); | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:05 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:05 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:05 +05:30] XQA: }, | |
#[2017-12-27 16:11:05 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:05 +05:30] XQA: }); | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:05 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:05 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:05 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:05 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:05 +05:30] XQA: )); | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:05 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:05 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:05 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:05 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:05 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:05 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: license | |
#[2017-12-27 16:11:05 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:05 +05:30] XQA: { | |
#[2017-12-27 16:11:05 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:05 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:05 +05:30] XQA: }); | |
#[2017-12-27 16:11:05 +05:30] XQA: }); | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:05 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:05 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:05 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:05 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:05 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: } | |
#[2017-12-27 16:11:05 +05:30] XQA: | |
#[2017-12-27 16:11:08 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:09 +05:30] XQA: using System; | |
#[2017-12-27 16:11:09 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:09 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:09 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:09 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:09 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:09 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:09 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:09 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:09 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:09 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:09 +05:30] XQA: }, | |
#[2017-12-27 16:11:09 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:09 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:09 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: ); | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:09 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:09 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:09 +05:30] XQA: }, | |
#[2017-12-27 16:11:09 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:09 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:09 +05:30] XQA: }, | |
#[2017-12-27 16:11:09 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: ); | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:09 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:09 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:09 +05:30] XQA: }, | |
#[2017-12-27 16:11:09 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:09 +05:30] XQA: }); | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:09 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:09 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:09 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:09 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:09 +05:30] XQA: )); | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:09 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:09 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:09 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:09 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:09 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:09 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: license | |
#[2017-12-27 16:11:09 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:09 +05:30] XQA: { | |
#[2017-12-27 16:11:09 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:09 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:09 +05:30] XQA: }); | |
#[2017-12-27 16:11:09 +05:30] XQA: }); | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:09 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:09 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:09 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:09 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:09 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: } | |
#[2017-12-27 16:11:09 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:12 +05:30] XQA: using System; | |
#[2017-12-27 16:11:12 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:12 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:12 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:12 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:12 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:12 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:12 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:12 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:12 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:12 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:12 +05:30] XQA: }, | |
#[2017-12-27 16:11:12 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:12 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:12 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: ); | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:12 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:12 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:12 +05:30] XQA: }, | |
#[2017-12-27 16:11:12 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:12 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:12 +05:30] XQA: }, | |
#[2017-12-27 16:11:12 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: ); | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:12 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:12 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:12 +05:30] XQA: }, | |
#[2017-12-27 16:11:12 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:12 +05:30] XQA: }); | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:12 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:12 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:12 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:12 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:12 +05:30] XQA: )); | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:12 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:12 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:12 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:12 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:12 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:12 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: license | |
#[2017-12-27 16:11:12 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:12 +05:30] XQA: { | |
#[2017-12-27 16:11:12 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:12 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:12 +05:30] XQA: }); | |
#[2017-12-27 16:11:12 +05:30] XQA: }); | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:12 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:12 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:12 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:12 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:12 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: } | |
#[2017-12-27 16:11:12 +05:30] XQA: | |
#[2017-12-27 16:11:15 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:16 +05:30] XQA: using System; | |
#[2017-12-27 16:11:16 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:16 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:16 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:16 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:16 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:16 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:16 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:16 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:16 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:16 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:16 +05:30] XQA: }, | |
#[2017-12-27 16:11:16 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:16 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:16 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: ); | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:16 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:16 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:16 +05:30] XQA: }, | |
#[2017-12-27 16:11:16 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:16 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:16 +05:30] XQA: }, | |
#[2017-12-27 16:11:16 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: ); | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:16 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:16 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:16 +05:30] XQA: }, | |
#[2017-12-27 16:11:16 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:16 +05:30] XQA: }); | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:16 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:16 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:16 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:16 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:16 +05:30] XQA: )); | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:16 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:16 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:16 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:16 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:16 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:16 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: license | |
#[2017-12-27 16:11:16 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:16 +05:30] XQA: { | |
#[2017-12-27 16:11:16 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:16 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:16 +05:30] XQA: }); | |
#[2017-12-27 16:11:16 +05:30] XQA: }); | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:16 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:16 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:16 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:16 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:16 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: } | |
#[2017-12-27 16:11:16 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:19 +05:30] XQA: using System; | |
#[2017-12-27 16:11:19 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:19 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:19 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:19 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:19 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:19 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:19 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:19 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:19 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:19 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:19 +05:30] XQA: }, | |
#[2017-12-27 16:11:19 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:19 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:19 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: ); | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:19 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:19 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:19 +05:30] XQA: }, | |
#[2017-12-27 16:11:19 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:19 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:19 +05:30] XQA: }, | |
#[2017-12-27 16:11:19 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: ); | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:19 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:19 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:19 +05:30] XQA: }, | |
#[2017-12-27 16:11:19 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:19 +05:30] XQA: }); | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:19 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:19 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:19 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:19 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:19 +05:30] XQA: )); | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:19 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:19 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:19 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:19 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:19 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:19 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: license | |
#[2017-12-27 16:11:19 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:19 +05:30] XQA: { | |
#[2017-12-27 16:11:19 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:19 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:19 +05:30] XQA: }); | |
#[2017-12-27 16:11:19 +05:30] XQA: }); | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:19 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:19 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:19 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:19 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:19 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: } | |
#[2017-12-27 16:11:19 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:22 +05:30] XQA: using System; | |
#[2017-12-27 16:11:22 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:22 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:22 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:22 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:22 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:22 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:22 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:22 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:22 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:22 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:22 +05:30] XQA: }, | |
#[2017-12-27 16:11:22 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:22 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:22 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: ); | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:22 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:22 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:22 +05:30] XQA: }, | |
#[2017-12-27 16:11:22 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:22 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:22 +05:30] XQA: }, | |
#[2017-12-27 16:11:22 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: ); | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:22 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:22 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:22 +05:30] XQA: }, | |
#[2017-12-27 16:11:22 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:22 +05:30] XQA: }); | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:22 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:22 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:22 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:22 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:22 +05:30] XQA: )); | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:22 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:22 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:22 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:22 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:22 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:22 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: license | |
#[2017-12-27 16:11:22 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:22 +05:30] XQA: { | |
#[2017-12-27 16:11:22 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:22 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:22 +05:30] XQA: }); | |
#[2017-12-27 16:11:22 +05:30] XQA: }); | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:22 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:22 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:22 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:22 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:22 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: } | |
#[2017-12-27 16:11:22 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:26 +05:30] XQA: using System; | |
#[2017-12-27 16:11:26 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:26 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:26 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:26 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:26 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:26 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:26 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:26 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:26 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:26 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:26 +05:30] XQA: }, | |
#[2017-12-27 16:11:26 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:26 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:26 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: ); | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:26 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:26 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:26 +05:30] XQA: }, | |
#[2017-12-27 16:11:26 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:26 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:26 +05:30] XQA: }, | |
#[2017-12-27 16:11:26 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: ); | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:26 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:26 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:26 +05:30] XQA: }, | |
#[2017-12-27 16:11:26 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:26 +05:30] XQA: }); | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:26 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:26 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:26 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:26 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:26 +05:30] XQA: )); | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:26 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:26 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:26 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:26 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:26 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:26 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: license | |
#[2017-12-27 16:11:26 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:26 +05:30] XQA: { | |
#[2017-12-27 16:11:26 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:26 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:26 +05:30] XQA: }); | |
#[2017-12-27 16:11:26 +05:30] XQA: }); | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:26 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:26 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:26 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:26 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:26 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: } | |
#[2017-12-27 16:11:26 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:29 +05:30] XQA: using System; | |
#[2017-12-27 16:11:29 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:29 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:29 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:29 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:29 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:29 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:29 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:29 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:29 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:29 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:29 +05:30] XQA: }, | |
#[2017-12-27 16:11:29 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:29 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:29 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: ); | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:29 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:29 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:29 +05:30] XQA: }, | |
#[2017-12-27 16:11:29 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:29 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:29 +05:30] XQA: }, | |
#[2017-12-27 16:11:29 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: ); | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:29 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:29 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:29 +05:30] XQA: }, | |
#[2017-12-27 16:11:29 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:29 +05:30] XQA: }); | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:29 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:29 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:29 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:29 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:29 +05:30] XQA: )); | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:29 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:29 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:29 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:29 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:29 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:29 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: license | |
#[2017-12-27 16:11:29 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:29 +05:30] XQA: { | |
#[2017-12-27 16:11:29 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:29 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:29 +05:30] XQA: }); | |
#[2017-12-27 16:11:29 +05:30] XQA: }); | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:29 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:29 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:29 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:29 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:29 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: } | |
#[2017-12-27 16:11:29 +05:30] XQA: | |
#[2017-12-27 16:11:32 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:33 +05:30] XQA: using System; | |
#[2017-12-27 16:11:33 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:33 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:33 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:33 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:33 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:33 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:33 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:33 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:33 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:33 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:33 +05:30] XQA: }, | |
#[2017-12-27 16:11:33 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:33 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:33 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: ); | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:33 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:33 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:33 +05:30] XQA: }, | |
#[2017-12-27 16:11:33 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:33 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:33 +05:30] XQA: }, | |
#[2017-12-27 16:11:33 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: ); | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:33 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:33 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:33 +05:30] XQA: }, | |
#[2017-12-27 16:11:33 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:33 +05:30] XQA: }); | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:33 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:33 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:33 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:33 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:33 +05:30] XQA: )); | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:33 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:33 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:33 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:33 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:33 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:33 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: license | |
#[2017-12-27 16:11:33 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:33 +05:30] XQA: { | |
#[2017-12-27 16:11:33 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:33 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:33 +05:30] XQA: }); | |
#[2017-12-27 16:11:33 +05:30] XQA: }); | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:33 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:33 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:33 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:33 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:33 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: } | |
#[2017-12-27 16:11:33 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: /usr/bin/osascript /var/folders/fm/yfq_4fs54jqfypjp_xspjpx80000gn/T/GetTextEditorText.scpt | |
#[2017-12-27 16:11:36 +05:30] XQA: using System; | |
#[2017-12-27 16:11:36 +05:30] XQA: using System.Collections.Generic; | |
#[2017-12-27 16:11:36 +05:30] XQA: using System.Linq; | |
#[2017-12-27 16:11:36 +05:30] XQA: using XQA.Core.Extensions; | |
#[2017-12-27 16:11:36 +05:30] XQA: using XQA.Core.Resiliency; | |
#[2017-12-27 16:11:36 +05:30] XQA: using XQA.Ide.Utilities; | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: namespace XQA.XS.Controllers | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: public static class StatusBarExtensions | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1, bool checkForNugetLicenseAcceptance = false) | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: studio.Util.Repro.ReproStep(string.Format("Wait for one the following status messages: [{0}]", | |
#[2017-12-27 16:11:36 +05:30] XQA: string.Join(", ", statusMessage.Select(x => $"'{x}'")))); | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:36 +05:30] XQA: new StatusMessageOptions { | |
#[2017-12-27 16:11:36 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance { | |
#[2017-12-27 16:11:36 +05:30] XQA: AcceptLicense = checkForNugetLicenseAcceptance, | |
#[2017-12-27 16:11:36 +05:30] XQA: CheckForDialog = checkForNugetLicenseAcceptance | |
#[2017-12-27 16:11:36 +05:30] XQA: }, | |
#[2017-12-27 16:11:36 +05:30] XQA: PollRate = new WaitAndRetryOptions { | |
#[2017-12-27 16:11:36 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:36 +05:30] XQA: RetryCount = timeoutInSecs/pollStepInSecs | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: ); | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: public static XamarinStudio WaitForStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? new StatusMessageOptions()); | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, string[] statusMessage, int timeoutInSecs = 240, int pollStepInSecs = 1) | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage.ToList(), new List<string> { }, | |
#[2017-12-27 16:11:36 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:36 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:36 +05:30] XQA: }, | |
#[2017-12-27 16:11:36 +05:30] XQA: PollRate = new WaitAndRetryOptions | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: WaitDuration = TimeSpan.FromSeconds(pollStepInSecs), | |
#[2017-12-27 16:11:36 +05:30] XQA: RetryCount = timeoutInSecs / pollStepInSecs | |
#[2017-12-27 16:11:36 +05:30] XQA: }, | |
#[2017-12-27 16:11:36 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: ); | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: public static XamarinStudio WaitForNoStatusMessage(this XamarinStudio studio, List<string> statusMessage, List<string> failureMessage, StatusMessageOptions statusMessageOptions = null) | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: return studio.PollStatusMessage(statusMessage, failureMessage, statusMessageOptions ?? | |
#[2017-12-27 16:11:36 +05:30] XQA: new StatusMessageOptions | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: License = new StatusMessageOptions.LicenseAcceptance | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: AcceptLicense = false, | |
#[2017-12-27 16:11:36 +05:30] XQA: CheckForDialog = false | |
#[2017-12-27 16:11:36 +05:30] XQA: }, | |
#[2017-12-27 16:11:36 +05:30] XQA: WaitForStatusMessage = false | |
#[2017-12-27 16:11:36 +05:30] XQA: }); | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: public static XamarinStudio PollStatusMessage (this XamarinStudio studio, List<string> statusMessages, | |
#[2017-12-27 16:11:36 +05:30] XQA: List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: studio.Util.Log.Debug(string.Format("Wait for {0} message: [ {1} ] and fail if one of these is found [ {2} ]", | |
#[2017-12-27 16:11:36 +05:30] XQA: pollOptions.WaitForStatusMessage ? "" : "no", | |
#[2017-12-27 16:11:36 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), | |
#[2017-12-27 16:11:36 +05:30] XQA: failureMessages.JoinListCollections(stringQuote: "'") | |
#[2017-12-27 16:11:36 +05:30] XQA: )); | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: RetryForResult<bool>.CreateForTrue(pollOptions.PollRate.RetryCount, (int)pollOptions.PollRate.WaitDuration.TotalSeconds) | |
#[2017-12-27 16:11:36 +05:30] XQA: .Wait(() => studio.PollStatusMessageOnce(statusMessages, failureMessages, pollOptions), | |
#[2017-12-27 16:11:36 +05:30] XQA: () => string.Format("Timed out waiting for status message\n{0} one of these: {1}\nFound:\n'{2}'", | |
#[2017-12-27 16:11:36 +05:30] XQA: pollOptions.WaitForStatusMessage ? "Expected" :"Didn't expect", | |
#[2017-12-27 16:11:36 +05:30] XQA: statusMessages.JoinListCollections(stringQuote: "'"), IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(1, false))); | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: return studio; | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: public static bool PollStatusMessageOnce(this XamarinStudio studio, List<string> statusMessages, List<string> failureMessages, StatusMessageOptions pollOptions) | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: string actualStatusMessage = string.Empty; | |
#[2017-12-27 16:11:36 +05:30] XQA: IoC.XamarinStudio.NuGetLicenseAcceptance | |
#[2017-12-27 16:11:36 +05:30] XQA: .If(license => pollOptions.License.CheckForDialog && license.Exists(), license => | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: license | |
#[2017-12-27 16:11:36 +05:30] XQA: .If(pollOptions.License.AcceptLicense, l => | |
#[2017-12-27 16:11:36 +05:30] XQA: { | |
#[2017-12-27 16:11:36 +05:30] XQA: studio.Util.Screenshot.TakeScreenshot("Accept-NuGet-License"); | |
#[2017-12-27 16:11:36 +05:30] XQA: l.Accept(); | |
#[2017-12-27 16:11:36 +05:30] XQA: }); | |
#[2017-12-27 16:11:36 +05:30] XQA: }); | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: actualStatusMessage = IoC.XamarinStudio.Toolbar.StatusBar.GetStatusMessage(20, false); | |
#[2017-12-27 16:11:36 +05:30] XQA: studio.Util.Log.Debug($"Polling status message. Current value: '{actualStatusMessage}'"); | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: if (failureMessages != null && MatchStatusMessage(failureMessages, actualStatusMessage)) | |
#[2017-12-27 16:11:36 +05:30] XQA: throw new TimeoutException($"Found a failure message: '{actualStatusMessage}'. List of failure messages: [ {failureMessages.JoinListCollections()} ]"); | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: return pollOptions.WaitForStatusMessage == MatchStatusMessage(statusMessages, actualStatusMessage); | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:36 +05:30] XQA: static bool MatchStatusMessage(List<string> messageCollection, string needle) => | |
#[2017-12-27 16:11:36 +05:30] XQA: messageCollection.Any(x => !string.IsNullOrEmpty(needle) && | |
#[2017-12-27 16:11:36 +05:30] XQA: ((x.IndexOf(needle, StringComparison.OrdinalIgnoreCase) >= 0 || needle.IndexOf(x, StringComparison.OrdinalIgnoreCase) >= 0))); | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: } | |
#[2017-12-27 16:11:36 +05:30] XQA: | |
#[2017-12-27 16:11:41 +05:30] XQA: /usr/local/bin/cliclick -m verbose m:0,0 | |
#[2017-12-27 16:11:41 +05:30] XQA: Move to 0,0 | |
#[2017-12-27 16:11:53 +05:30] XQA: pgrep -xil "VisualStudio" | |
The processes with name 'VisualStudio' is: | |
XQA.Core.ProcessResult | |
Command to kill processes: pkill -9 -xil "VisualStudio" | |
#[2017-12-27 16:11:53 +05:30] XQA: pkill -9 -xil "VisualStudio" | |
#[2017-12-27 16:11:53 +05:30] XQA: No matching processes belonging to you were found | |
#[2017-12-27 16:11:54 +05:30] XQA_INFO: Uploaded file /Users/globallogic/Documents/AndroidDeployArrayTakeTest/QualityAssurance/Automation/XQA/XQA.XS.Tests/bin/VSMac/TestResults/VerifyExceptionWindowMoreInfoLink/VerifyExceptionWindowMoreInfoLink.txt.171227161153 to http://xqa.blob.core.windows.net/gist/VerifyExceptionWindowMoreInfoLink.txt.171227161153-2f9807ad783944639ec3ad996e3a46eb.txt | |
#[2017-12-27 16:11:57 +05:30] XQA_INFO: Uploaded file /Users/globallogic/Documents/AndroidDeployArrayTakeTest/QualityAssurance/Automation/XQA/XQA.XS.Tests/bin/VSMac/TestResults/VerifyExceptionWindowMoreInfoLink/VerifyExceptionWindowMoreInfoLink.Ide.log.171227161154 to http://xqa.blob.core.windows.net/gist/VerifyExceptionWindowMoreInfoLink.Ide.log.171227161154-2562254471414eceae3a302649fa418f.txt | |
#[2017-12-27 16:11:58 +05:30] XQA_INFO: Uploaded file /Users/globallogic/Library/Preferences/VisualStudio/7.0/MonoDevelopProperties.xml.171227161157 to http://xqa.blob.core.windows.net/gist/MonoDevelopProperties.xml.171227161157-e6112a869a314f8987f929e3c54c5aa5.txt | |
#[2017-12-27 16:11:58 +05:30] XQA_INFO: { | |
"Product": "Visual Studio for Mac", | |
"id": null, | |
"TestFullName": "XQA.XS.Tests.NewExceptionCaughtWindowTests.VerifyExceptionWindowMoreInfoLink", | |
"TestShortName": "VerifyExceptionWindowMoreInfoLink", | |
"Description": "Verify that 'More Information' is shown on the right side when only InnerException has HelpLink set", | |
"Milliseconds": 0.0, | |
"Date": "2017-12-27T16:11:53.99793+05:30", | |
"Duration": "00:04:24.9650000", | |
"Performance": { | |
"Operations": [ | |
{ | |
"Guid": "deac7592-8b42-47fe-a78f-f2c1975ae120", | |
"Id": "StartIde", | |
"Category": "Shell", | |
"Description": "Starting IDE from path '/Applications/Visual Studio.app/Contents/MacOS/VisualStudio'", | |
"Duration": "00:00:31.1389940", | |
"StartMemoryUsage": null, | |
"EndMemoryUsage": { | |
"PrivateMemory": 294, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 3940, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"SupplementalInformation": { | |
"ExecutablePath": "/Applications/Visual Studio.app/Contents/MacOS/VisualStudio" | |
}, | |
"Logs": [], | |
"Artifacts": [] | |
}, | |
{ | |
"Guid": "0cfe158e-05c1-4bae-97b0-719da7f195ab", | |
"Id": "CreateNewSolution", | |
"Category": "NewProject", | |
"Description": "Create a new solution/project 'ConsoleProject'", | |
"Duration": "00:00:09.5685880", | |
"StartMemoryUsage": { | |
"PrivateMemory": 352, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 3994, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"EndMemoryUsage": { | |
"PrivateMemory": 484, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4142, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"SupplementalInformation": { | |
"CategoryRoot": "Other", | |
"Category": ".NET", | |
"TemplateKindRoot": "General", | |
"TemplateKind": "Console Project", | |
"SolutionName": "ConsoleProject", | |
"ProjectName": "ConsoleProject" | |
}, | |
"Logs": [], | |
"Artifacts": [] | |
}, | |
{ | |
"Guid": "845b38c9-a94a-4146-8a25-5e72c3e9b860", | |
"Id": "BuildAll", | |
"Category": "Build", | |
"Description": "Build project 'ConsoleProject'", | |
"Duration": "00:00:02.8209040", | |
"StartMemoryUsage": { | |
"PrivateMemory": 663, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4367, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"EndMemoryUsage": { | |
"PrivateMemory": 667, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4374, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"SupplementalInformation": { | |
"TargetName": "Build", | |
"ProjectName": "ConsoleProject" | |
}, | |
"Logs": [], | |
"Artifacts": [] | |
}, | |
{ | |
"Guid": "d8c29688-94cc-44fa-9933-025f8b575e80", | |
"Id": "DebugOther", | |
"Category": "Debugging", | |
"Description": "Debugging project Other .NET Console Project", | |
"Duration": "00:00:01.3010420", | |
"StartMemoryUsage": { | |
"PrivateMemory": 677, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4380, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"EndMemoryUsage": { | |
"PrivateMemory": 687, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4401, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"SupplementalInformation": { | |
"ProjectName": "ConsoleProject" | |
}, | |
"Logs": [], | |
"Artifacts": [] | |
}, | |
{ | |
"Guid": "16fdd23b-4103-49fd-a986-37463f4d0eb4", | |
"Id": "BuildAll", | |
"Category": "Build", | |
"Description": "Build project 'ConsoleProject'", | |
"Duration": "00:00:02.4158700", | |
"StartMemoryUsage": { | |
"PrivateMemory": 707, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4404, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"EndMemoryUsage": { | |
"PrivateMemory": 707, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4406, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"SupplementalInformation": { | |
"TargetName": "Build", | |
"ProjectName": "ConsoleProject" | |
}, | |
"Logs": [], | |
"Artifacts": [] | |
}, | |
{ | |
"Guid": "92279715-30c6-4184-b1a5-a4c334731d3f", | |
"Id": "DebugOther", | |
"Category": "Debugging", | |
"Description": "Debugging project Other .NET Console Project", | |
"Duration": "00:00:00.9946860", | |
"StartMemoryUsage": { | |
"PrivateMemory": 714, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4413, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"EndMemoryUsage": { | |
"PrivateMemory": 710, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4423, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"SupplementalInformation": { | |
"ProjectName": "ConsoleProject" | |
}, | |
"Logs": [], | |
"Artifacts": [] | |
} | |
] | |
}, | |
"Result": "Passed", | |
"Log": null, | |
"DidExecute": true, | |
"TotalAsserts": 0, | |
"Message": null, | |
"StackTrace": null, | |
"CommitHash": "54e0a0247ce488f81f6c7806c9bae93307e66c2b", | |
"CIInfo": null, | |
"BuildRepository": null, | |
"LaneName": null, | |
"Category": "Regression", | |
"SupplementalInformation": { | |
"AboutInformationGist": "http://xqa.blob.core.windows.net/gist/log-e9fcac0e1f394dab9b2c237398f3f66e.txt" | |
}, | |
"Environment": { | |
"BotName": "172.18.41.68", | |
"OperatingSystem": "Mac OS X 10.12.6", | |
"XIVersion": "11.6.1.2", | |
"XMVersion": "4.0.0.214", | |
"XAVersion": "8.1.0.23", | |
"MonoVersion": "5.4.1.7 (2017-06/e66d9abbb27) (64-bit)", | |
"JavaVersion": "1.8.0_101", | |
"XcodeVersion": "9.2 (13772)", | |
"XVSVersion": null, | |
"DotNetVersion": null, | |
"XSVersion": "7.3 Preview (7.3 build 764)", | |
"VSVersion": null | |
}, | |
"Projects": [ | |
{ | |
"Id": 0, | |
"Name": "ConsoleProject", | |
"AssemblyName": null, | |
"ProjectPath": "/Users/globallogic/Documents/AndroidDeployArrayTakeTest/QualityAssurance/Automation/XQA/XQA.XS.Tests/bin/VSMac/TestResults/VerifyExceptionWindowMoreInfoLink/Temp/ConsoleProject/ConsoleProject/ConsoleProject.csproj", | |
"ProjectGuid": null, | |
"CommitHash": null, | |
"ProjectConfig": null, | |
"Device": { | |
"Name": null, | |
"Manufacturer": null, | |
"Model": null, | |
"Identifier": null, | |
"OSVersion": null, | |
"FormFactor": null, | |
"CpuArchitecture": null, | |
"DeviceInfo": null | |
}, | |
"UnitTestResults": [], | |
"BuildTargetResults": [ | |
{ | |
"Id": 0, | |
"TargetName": "Build", | |
"Milliseconds": 0.0, | |
"Outcome": false, | |
"Duration": "00:00:00", | |
"Errors": [], | |
"Warnings": [ | |
"[Line]: 10\n [Description]: Unreachable code detected (CS0162)\n [File]: Program.cs\n [Project]: ConsoleProject" | |
], | |
"Messages": [], | |
"OutputAsGist": "http://xqa.blob.core.windows.net/gist/log-6f5b490d259540459ebe998cc8fdcfe2.txt", | |
"AppArchive": null, | |
"Artifacts": [] | |
}, | |
{ | |
"Id": 0, | |
"TargetName": "Build", | |
"Milliseconds": 0.0, | |
"Outcome": false, | |
"Duration": "00:00:00", | |
"Errors": [], | |
"Warnings": [ | |
"[Line]: 11\n [Description]: Unreachable code detected (CS0162)\n [File]: Program.cs\n [Project]: ConsoleProject" | |
], | |
"Messages": [], | |
"OutputAsGist": "http://xqa.blob.core.windows.net/gist/log-6de1bc59748b4fda84ce995bec0210d7.txt", | |
"AppArchive": null, | |
"Artifacts": [] | |
} | |
] | |
} | |
], | |
"TestRailCases": [ | |
"1067729", | |
"1067728" | |
], | |
"BugzillaBugs": [], | |
"Screenshots": [], | |
"ReproductionSteps": [ | |
"Under MenuBar, File > New > Solution", | |
"Select Template Category '.NET' under 'Other'", | |
"Select Template 'Console Project' under 'General'", | |
"Click Next", | |
"Enter Project Name as 'ConsoleProject'", | |
"Enter Solution Name as 'ConsoleProject'", | |
"Enter Solution Location as '/Users/globallogic/Documents/AndroidDeployArrayTakeTest/QualityAssurance/Automation/XQA/XQA.XS.Tests/bin/VSMac/TestResults/VerifyExceptionWindowMoreInfoLink/Temp'", | |
"Select 'Create a project directory within the solution directory.'", | |
"Select 'Use git for version control.'", | |
"Select 'Create a .gitignore file to ignore inessential files.'", | |
"Click button 'Create'", | |
"Under MenuBar, View > Pads > Solution", | |
"Select project: ConsoleProject", | |
"Right click on ConsoleProject > ConsoleProject and select Options", | |
"Wait for Default Run Config panel to show", | |
"Unselect 'Run on external console'", | |
"Unselect 'User-specific configuration'", | |
"Click button 'OK'", | |
"Under MenuBar, View > Pads > Solution", | |
"Select project: ConsoleProject", | |
"Select in Solution explorer: ConsoleProject > ConsoleProject > Program.cs", | |
"Wait for tab 'Program.cs' to open", | |
"Enter search term '8' in Goto field", | |
"Verify that caret is on Line number '8'", | |
"Go to end of line", | |
"Insert new line", | |
"Enter text 'throw new TimeoutException(\"Timed out\", new Exception(\"whattever man\") { HelpLink = \"https://aka.ms/j8lu5v\" } );' in text editor", | |
"Under MenuBar, Build > Build All", | |
"Under MenuBar, File > Save All", | |
"Click Cancel", | |
"Click on Run button", | |
"Check if the toolbar button shows a 'Stop' icon", | |
"Waiting for breakpoint to be hit", | |
"Under MenuBar, View > Debug Windows > Call Stack", | |
"Wait for exception to be thrown and 'Show Details' link to be visible", | |
"Click on 'Show Details'", | |
"Wait for a dialog with title 'Exception Caught' to appear", | |
"Check Exception type System.TimeoutException is displayed", | |
"Check Exception type Timed out is displayed", | |
"Assert more information link", | |
"Check Inner Exception type System.TimeoutException is displayed", | |
"Check Inner Exception type is displayed", | |
"Check Inner Exception type System.Exception is displayed", | |
"Check Inner Exception type is displayed", | |
"Click on button 'Close' in Dialog with title 'Exception Caught'", | |
"Wait for exception to be thrown and 'Show Details' link to be visible", | |
"Click on Stop button", | |
"Wait for tab 'Program.cs' to open", | |
"Enter search term '9' in Goto field", | |
"Verify that caret is on Line number '9'", | |
"Toggle line comment", | |
"Go to end of line", | |
"Insert new line", | |
"Enter text 'throw new Exception(\"whattever man\");' in text editor", | |
"Under MenuBar, Build > Build All", | |
"Under MenuBar, File > Save All", | |
"Click Cancel", | |
"Click on Run button", | |
"Check if the toolbar button shows a 'Stop' icon", | |
"Waiting for breakpoint to be hit", | |
"Under MenuBar, View > Debug Windows > Call Stack", | |
"Wait for exception to be thrown and 'Show Details' link to be visible", | |
"Click on 'Show Details'", | |
"Wait for a dialog with title 'Exception Caught' to appear", | |
"Check Exception type System.Exception is displayed", | |
"Check Exception type whattever man is displayed", | |
"Assert more information link", | |
"Click on button 'Close' in Dialog with title 'Exception Caught'", | |
"Wait for exception to be thrown and 'Show Details' link to be visible", | |
"Click on Stop button", | |
"Under MenuBar, File > Save All" | |
], | |
"Command": { | |
"InitCommand": "git clone git@github.com:xamarin/QualityAssurance.git && cd QualityAssurance:Automation:XQA", | |
"BuildCommand": "./build.sh --target Build --configuration VSMac", | |
"RunCommand": "./build.sh --target XSTest --configuration VSMac -where=\"test == XQA.XS.Tests.NewExceptionCaughtWindowTests.VerifyExceptionWindowMoreInfoLink\"" | |
}, | |
"Logs": { | |
"IdeLog": [ | |
"http://xqa.blob.core.windows.net/gist/VerifyExceptionWindowMoreInfoLink.Ide.log.171227161154-2562254471414eceae3a302649fa418f.txt", | |
"http://xqa.blob.core.windows.net/gist/MonoDevelopProperties.xml.171227161157-e6112a869a314f8987f929e3c54c5aa5.txt" | |
], | |
"TestLog": "http://xqa.blob.core.windows.net/gist/VerifyExceptionWindowMoreInfoLink.txt.171227161153-2f9807ad783944639ec3ad996e3a46eb.txt" | |
}, | |
"AboutInformation": "http://xqa.blob.core.windows.net/gist/log-e9fcac0e1f394dab9b2c237398f3f66e.txt", | |
"MemoryStats": { | |
"PrivateMemory": 714, | |
"VirtualMemory": 0, | |
"WorkingSet": 0, | |
"PeakVirtualMemory": 4416, | |
"PagedSystemMemory": 0, | |
"PagedMemory": 0, | |
"NonPagedSystemMemory": 0 | |
}, | |
"XALicense": null, | |
"XILicense": null, | |
"XMLicense": null | |
} | |
#[2017-12-27 16:11:58 +05:30] XQA_INFO: Test Results processed | |
| Automated | Id | Title | |
+-----------+---------+-------- | |
| Yes | 1067729 | Verify that "More Information" is shown on the right side when only InnerException has HelpLink set | |
| Yes | 1067728 | When Exception's HelpLink property is not set, "More Information" link should not be visible at all | |
+-----------+---------+-------- | |
| Automated | Id | Title | |
+-----------+---------+-------- | |
| Yes | 1067729 | Verify that "More Information" is shown on the right side when only InnerException has HelpLink set | |
| Yes | 1067728 | When Exception's HelpLink property is not set, "More Information" link should not be visible at all | |
+-----------+---------+-------- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment