Exemplo n.º 1
0
        public void ItCreatesFirefoxDriver()
        {
            var factory = new FirefoxDriverFactory();
            var driver  = factory.CreateDriver();

            Assert.IsInstanceOfType(driver, typeof(RemoteFirefox));
        }
Exemplo n.º 2
0
        public void Init()
        {
            var driverFactory = new FirefoxDriverFactory();

            _driver = driverFactory.Create();
            _wait   = new WebDriverWait(_driver, TimeSpan.FromSeconds(20));
            _wait.IgnoreExceptionTypes(typeof(NoSuchElementException));
            _logger = LogManager.GetLogger(GetType());

            _logger.Debug($"{TestContext.CurrentContext.Test.ClassName} OneTimeSetup");
        }
Exemplo n.º 3
0
        private static IDriverFactory _GetDriverFactory(DriverSettings driverSettings)
        {
            IDriverFactory driverFactory = null;

            if (driverSettings.HubType.EnumValue.Equals(HubType.None))
            {
                switch (driverSettings.Browser.EnumValue)
                {
                case Browser.Chrome:
                {
                    driverFactory = new ChromeDriverFactory();
                    break;
                }

                case Browser.Firefox:
                {
                    driverFactory = new FirefoxDriverFactory();
                    break;
                }
                    //TODO: handle all cases
                }
            }
            switch (driverSettings.Platform.EnumValue)
            {
            case Platform.Windows:
            case Platform.Linux:
            case Platform.Mac:
            {
                driverFactory = new RemoteWebDriverFactory();
                break;
            }

            case Platform.iOS:
            {
                driverFactory = new IOSDriverFactory();
                break;
            }

            case Platform.Android:
            {
                driverFactory = new AndroidDriverFactory();
                break;
            }
            }
            return(driverFactory);
        }