예제 #1
0
        public IAutomationBrowser CreateBrowser(ISweetPotatoSettings sweetPotatoSettings)
        {
            ScenarioContext.Current.Set(sweetPotatoSettings.GetExecutingAssemblyName(),
                                        Constants.ImplementingAssemblyName);
            ScenarioContext.Current.Set(sweetPotatoSettings.GetWaitTimeMilliseconds(),
                                        Constants.WaitTimeMilliseconds);
            ScenarioContext.Current.Set(sweetPotatoSettings.IsElementHighlighterEnabled(),
                                        Constants.IsElementHighlighterEnabled);

            switch (sweetPotatoSettings.GetDriverType())
            {
            case DriverType.Selenium:
                var automationBrowser = GetSeleniumBrowser(sweetPotatoSettings);
                SetAutomationBrowserToScenarioContext(automationBrowser);
                return(automationBrowser);

            default:
                var seleniumBrowser = GetSeleniumBrowser(sweetPotatoSettings);
                SetAutomationBrowserToScenarioContext(seleniumBrowser);
                return(seleniumBrowser);
            }
        }
예제 #2
0
        public TimeSpan GetElementWaitTimeSpan()
        {
            var waitTimeMilliseconds = _sweetPotatoSettings.GetWaitTimeMilliseconds();

            return(new TimeSpan(0, 0, 0, 0, Convert.ToInt16(waitTimeMilliseconds)));
        }