Example #1
0
        public override void KillApplication(TestApplication testApplication, KillApplicationConext context)
        {
            ScreenCaptureCommand.Stop();
            webBrowsers.KillAllWebBrowsers();
            var isSingleWebDev = testApplication.ParameterValue <bool>(ApplicationParams.SingleWebDev);

            if (!testApplication.ParameterValue <bool>(ApplicationParams.DontKillWebDev) && _process != null)
            {
                if (isSingleWebDev)
                {
                    if (context != KillApplicationConext.TestNormalEnded)
                    {
                        IISExpressServerHelper.Stop(_process);
                    }
                }
                else
                {
                    IISExpressServerHelper.Stop(_process);
                }
            }
        }
Example #2
0
        public override void RunApplication(TestApplication testApplication)
        {
            if (!GetParamValue("UseIISExpress", false, testApplication))
            {
                base.RunApplication(testApplication);
            }
            else
            {
                string url            = testApplication.GetParamValue(UrlParamName);
                var    uri            = new Uri(url);
                string webBrowserType = testApplication.FindParamValue("WebBrowserType");
                webBrowsers = string.IsNullOrEmpty(webBrowserType) ? (IWebBrowserCollection) new WebBrowserCollection() : new StandaloneWebBrowserCollection();

                if (!WebDevWebServerHelper.IsWebDevServerStarted(uri))
                {
                    IISExpressServerHelper.Run(testApplication, uri);
                }
                if (testApplication.FindParamValue("DefaultWindowSize") != null)
                {
                    WebBrowserCollection.DefaultFormSize = GetWindowSize(testApplication.GetParamValue("DefaultWindowSize"));
                }
                this.CallMethod("CreateBrowser", url);
            }
        }
Example #3
0
        private void RunApplicationCore(TestApplication testApplication)
        {
            var defaultWindowSize = testApplication.ParameterValue <string>(ApplicationParams.DefaultWindowSize);

            if (defaultWindowSize != null)
            {
                WebBrowserCollection.DefaultFormSize = GetWindowSize(defaultWindowSize);
            }
            if (!testApplication.ParameterValue <bool>(ApplicationParams.UseIISExpress))
            {
                RunApplicationBase(testApplication);
            }
            else
            {
                var url = testApplication.ParameterValue <string>(ApplicationParams.Url);
                var uri = new Uri(url);
                webBrowsers = CreateWebBrowsers(testApplication);
                if (!WebDevWebServerHelper.IsWebDevServerStarted(uri))
                {
                    _process = IISExpressServerHelper.Run(testApplication, uri);
                }
                this.CreateBrowser(url);
            }
        }