Example #1
0
        public AutomationBase()
        {
            if (Driver == null)
            {
                var simulator = new HttpSimulator.HttpSimulator();
                simulator.SimulateRequest();

                InstallComponents();

                LoadDnnProviders("data;logging;caching;authentication;members;roles;profiles;permissions;folder");

                //fix Globals.ApplicationMapPath
                var appPath = ConfigurationManager.AppSettings["DefaultPhysicalAppPath"];
                if (!string.IsNullOrEmpty(appPath))
                {
                    var mappath = typeof(Globals).GetField("_applicationMapPath", BindingFlags.Static | BindingFlags.NonPublic);
                    mappath.SetValue(null, appPath);
                }

                //fix membership
                var providerProp = typeof(Membership).GetField("s_Provider", BindingFlags.Static | BindingFlags.NonPublic);
                providerProp.SetValue(null, Membership.Providers["AspNetSqlMembershipProvider"]);

                var objPortalAliasInfo = new DotNetNuke.Entities.Portals.PortalAliasInfo {
                    PortalID = _portalId
                };
                var ps = new DotNetNuke.Entities.Portals.PortalSettings(59, objPortalAliasInfo);
                System.Web.HttpContext.Current.Items.Add("PortalSettings", ps);
                SqlProvider = new SqlDataProvider();
                PortalId    = _portalId;

                switch (_browser)
                {
                case Common.BrowserType.firefox:
                    _ffp = new FirefoxProfile {
                        AcceptUntrustedCertificates = true
                    };
                    Driver = new FirefoxDriver(_ffp);
                    Driver.Navigate().GoToUrl(SiteUrl);
                    break;

                case Common.BrowserType.ie:
                    Driver = new InternetExplorerDriver();
                    Driver.Navigate().GoToUrl(SiteUrl);
                    break;

                case Common.BrowserType.chrome:
                    Driver = new ChromeDriver();
                    Driver.Navigate().GoToUrl(SiteUrl);
                    break;
                }
            }
        }
Example #2
0
 public ConfigMapPath(HttpSimulator simulation)
 {
     _requestSimulation = simulation;
 }
Example #3
0
 public ConfigMapPath(HttpSimulator simulation)
 {
     _requestSimulation = simulation;
 }