public IWebDriver Init(string profile, string environment)
        {
            NameValueCollection caps     = ConfigurationManager.GetSection("capabilities/" + profile) as NameValueCollection;
            NameValueCollection settings = ConfigurationManager.GetSection("environments/" + environment) as NameValueCollection;

            DesiredCapabilities capability = new DesiredCapabilities();

            foreach (string key in caps.AllKeys)
            {
                capability.SetCapability(key, caps[key]);
            }

            foreach (string key in settings.AllKeys)
            {
                capability.SetCapability(key, settings[key]);
            }

            var username = AzureConfig.GetConfig().BrowserStackUser;

            var accesskey = AzureConfig.GetConfig().BrowserStackKey;

            capability.SetCapability("browserstack.user", username);
            capability.SetCapability("browserstack.key", accesskey);
            capability.SetCapability("project", "das-psrs");
            capability.SetCapability("build", "build x.x");

            File.AppendAllText("C:\\Users\\Matt\\Desktop\\sf.log", "Starting local");

            if (capability.GetCapability("browserstack.local") != null && capability.GetCapability("browserstack.local").ToString() == "true")
            {
                browserStackLocal = new Local();
                List <KeyValuePair <string, string> > bsLocalArgs = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("key", accesskey)
                };
                browserStackLocal.start(bsLocalArgs);
            }

            File.AppendAllText("C:\\Users\\Matt\\Desktop\\sf.log", "Starting driver");
            driver = new RemoteWebDriver(new Uri("http://" + ConfigurationManager.AppSettings.Get("BrowserStack.Server") + "/wd/hub/"), capability);
            return(driver);
        }
예제 #2
0
 public string GetDBConnectionString()
 {
     return(AzureConfig.GetConfig().ConnectionString);
 }
예제 #3
0
 public TestUser GetViewUser()
 {
     return(AzureConfig.GetConfig().ViewAccessUser);
 }
예제 #4
0
 public TestUser GetEditUser()
 {
     return(AzureConfig.GetConfig().EditAccessUser);
 }
예제 #5
0
 public TestUser GetSuperUser()
 {
     return(AzureConfig.GetConfig().SubmitAccessUser);
 }
예제 #6
0
 public string GetEmployerId()
 {
     return(AzureConfig.GetConfig().EmployerId);
 }