public void TestFixtureSetUp()
 {
     Process[] processes = Process.GetProcessesByName("iexplore");
     foreach (var process in processes)
     {
         try
         {
             process.Kill();
         }
         catch
         {
         }
     }
     browserWindow = InternetExplorer.Launch("http://localhost/white.testsilverlight/TestSilverlightApplicationTestPage.aspx",
                                             "TestSilverlightApplication - Windows Internet Explorer");
     PostSetup();
 }
 public void TestFixtureSetUp()
 {
     Process[] processes = Process.GetProcessesByName("iexplore");
     foreach (var process in processes)
     {
         try
         {
             process.Kill();
         }
         catch
         {
         }
     }
     browserWindow = InternetExplorer.Launch("http://localhost/white.testsilverlight/TestSilverlightApplicationTestPage.aspx",
                                             "TestSilverlightApplication - Windows Internet Explorer");
     PostSetup();
 }
        protected SilverlightTestFixture()
        {
            string fullPath;
            var    checkoutDir = Environment.GetEnvironmentVariable("checkoutDir");

            if (string.IsNullOrEmpty(checkoutDir))
            {
                fullPath = Path.GetFullPath
                           (
                    Path.Combine
                    (
                        Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                        @"..\..\..\..\..\..\TestApplications\TestSilverlightApplication.Web"
                    )
                           );
            }
            else
            {
                const string pathToApp = @"SilverlightTestApplication";
                fullPath = Path.GetFullPath(Path.Combine(checkoutDir, pathToApp));
            }
            var          appcmd     = string.Format(@"{0}\system32\inetsrv\AppCmd.exe", Environment.GetEnvironmentVariable("windir"));
            var          addArgs    = string.Format("add app /site.name:\"Default Web Site\" /path:/TestSilverlightApplication.Web /physicalPath:\"{0}\"", fullPath);
            const string deleteArgs = "delete app /app.name:\"Default Web Site\\TestSilverlightApplication.Web\"";

            var logger = CoreAppXmlConfiguration.Instance.LoggerFactory.Create(typeof(SilverlightTestFixture));

            logger.Info(string.Format("Running {0} {1}", appcmd, deleteArgs));
            Process.Start(appcmd, deleteArgs).WaitForExit();
            logger.Info(string.Format("Running {0} {1}", appcmd, addArgs));
            Process.Start(appcmd, addArgs).WaitForExit();

            var processes = Process.GetProcessesByName("iexplore");

            foreach (var process in processes)
            {
                try
                {
                    process.Kill();
                }
                catch { }
            }
            BrowserWindow = InternetExplorer.Launch("http://localhost/TestSilverlightApplication.Web/TestSilverlightApplicationTestPage.aspx",
                                                    "TestSilverlightApplication - Windows Internet Explorer");
            PostSetup();
        }
Example #4
0
        public void TestFixtureSetUp()
        {
            string fullPath;
            var checkoutDir = Environment.GetEnvironmentVariable("checkoutDir");
            if (string.IsNullOrEmpty(checkoutDir))
            {
                fullPath = Path.GetFullPath
                    (
                        Path.Combine
                            (
                                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                @"..\..\..\..\..\..\TestApplications\TestSilverlightApplication.Web"
                            )
                    );
            }
            else
            {
                const string pathToApp = @"SilverlightTestApplication";
                fullPath = Path.GetFullPath(Path.Combine(checkoutDir, pathToApp));
            }
            var appcmd = string.Format(@"{0}\system32\inetsrv\AppCmd.exe", Environment.GetEnvironmentVariable("windir"));
            var addArgs = string.Format("add app /site.name:\"Default Web Site\" /path:/TestSilverlightApplication.Web /physicalPath:\"{0}\"", fullPath);
            const string deleteArgs = "delete app /app.name:\"Default Web Site\\TestSilverlightApplication.Web\"";

            var logger = CoreAppXmlConfiguration.Instance.LoggerFactory.Create(typeof (SilverlightTestFixture));
            logger.Info(string.Format("Running {0} {1}", appcmd, deleteArgs));
            Process.Start(appcmd, deleteArgs).WaitForExit();
            logger.Info(string.Format("Running {0} {1}", appcmd, addArgs));
            Process.Start(appcmd, addArgs).WaitForExit();

            var processes = Process.GetProcessesByName("iexplore");
            foreach (var process in processes)
            {
                try
                {
                    process.Kill();
                }
                catch { }
            }
            BrowserWindow = InternetExplorer.Launch("http://localhost/TestSilverlightApplication.Web/TestSilverlightApplicationTestPage.aspx",
                                                    "TestSilverlightApplication - Windows Internet Explorer");
            PostSetup();
        }