/// <summary> /// A method is used to check whether the SUT product supports the MS-WOPI protocol. If the SUT does not support, this method will raise an inconclusive assertion. /// </summary> /// <param name="site">A parameter represents the site.</param> public static void PerformSupportProductsCheck(ITestSite site) { TestSuiteHelper.CheckInputParameterNullOrEmpty <ITestSite>(site, "siteInstance", "PerformSupportProductsCheck"); if (!hasCheckSupportWOPI) { isCurrentSUTSupportWOPI = Common.GetConfigurationPropertyValue <bool>("MS-WOPI_Supported", site); hasCheckSupportWOPI = true; } if (!isCurrentSUTSupportWOPI) { SutVersion currentSutVersion = Common.GetConfigurationPropertyValue <SutVersion>("SutVersion", site); site.Assume.Inconclusive(@"The server does not support this specification [MS-WOPI]. It is determined by ""MS-WOPI_Supported"" SHOULDMAY property of the [{0}_{1}_SHOULDMAY.deployment.ptfconfig] configuration file.", WopiProtocolShortName, currentSutVersion); } }
/// <summary> /// This method is used to initialize the share test case helper. This method will also initialize all helpers which are required to initialize during test suite running. /// </summary> /// <param name="siteInstance">A parameter represents the ITestSite instance.</param> public static void InitializeHelper(ITestSite siteInstance) { TestSuiteHelper.CheckInputParameterNullOrEmpty <ITestSite>(siteInstance, "siteInstance", "InitializeHelper"); if (string.IsNullOrEmpty(currentTestClientName)) { currentTestClientName = Common.GetConfigurationPropertyValue("TestClientName", siteInstance); } if (null == wopiSutControlAdapter) { wopiSutControlAdapter = siteInstance.GetAdapter <IMS_WOPISUTControlAdapter>(); } if (null == wopiSutManagedCodeControlAdapter) { wopiSutManagedCodeControlAdapter = siteInstance.GetAdapter <IMS_WOPIManagedCodeSUTControlAdapter>(); } if (null == wopiProtocolAdapter) { wopiProtocolAdapter = siteInstance.GetAdapter <IMS_WOPIAdapter>(); } InitializeRequiredHelpers(wopiSutManagedCodeControlAdapter, siteInstance); if (string.IsNullOrEmpty(relativeSourceFileUrl)) { relativeSourceFileUrl = Common.GetConfigurationPropertyValue("NormalFile", siteInstance); } progId = Common.GetConfigurationPropertyValue("ProgIdForDiscoveryProcess", siteInstance); // Setting the endpoint name according to the current http transport. if (string.IsNullOrEmpty(currentSharedTestCasesEndpointName)) { TransportProtocol currentTransport = Common.GetConfigurationPropertyValue <TransportProtocol>("TransportType", siteInstance); switch (currentTransport) { case TransportProtocol.HTTP: { currentSharedTestCasesEndpointName = Common.GetConfigurationPropertyValue("SharedTestCaseEndPointNameForHTTP", siteInstance); break; } case TransportProtocol.HTTPS: { currentSharedTestCasesEndpointName = Common.GetConfigurationPropertyValue("SharedTestCaseEndPointNameForHTTPS", siteInstance); break; } default: { throw new InvalidOperationException(string.Format("The test suite only support HTTP or HTTPS transport. Current:[{0}]", currentTransport)); } } } // Set the protocol name of current test suite siteInstance.DefaultProtocolDocShortName = WopiProtocolShortName; hasInitializedHelperStatus = true; }