Exemplo n.º 1
0
        private IWebDriver InitialiseLocalDriver()
        {
            SetDefaultSettings(false);
            DriverSetupValidator.ValidateDriver(_driverOptions);
            var drivers = GetDrivers();

            drivers[_driverOptions.TargetBrowser].BuildPath           = FileManager.GetAssemblyDirectory();
            drivers[_driverOptions.TargetBrowser].DeviceName          = _driverOptions.TargetDeviceName;
            drivers[_driverOptions.TargetBrowser].HeadlessMode        = _driverOptions.HeadlessMode;
            drivers[_driverOptions.TargetBrowser].LocalDesktopTimeout = TimeSpan.FromSeconds(_driverOptions.LocalCommandTimeoutInSeconds);
            drivers[_driverOptions.TargetBrowser].LocalAppiumTimeout  = TimeSpan.FromSeconds(_driverOptions.LocalAppiumCommandTimeoutInSeconds);
            drivers[_driverOptions.TargetBrowser].LoggingEnabled      = false;
            drivers[_driverOptions.TargetBrowser].PlatformVersion     = _driverOptions.PlatformVersion;
            drivers[_driverOptions.TargetBrowser].Proxy      = _proxy;
            drivers[_driverOptions.TargetBrowser].RealDevice = _driverOptions.RealDevice;
            drivers[_driverOptions.TargetBrowser].ResetDeviceBetweenTests = _driverOptions.ResetDeviceBetweenTests;
            StartLocalServices(drivers);
            return(drivers[_driverOptions.TargetBrowser].InitialiseForLocal());
        }
Exemplo n.º 2
0
        private IWebDriver InitialiseSauceLabsDriver()
        {
            SetDefaultSettings(true);
            var sauceOptions = new SauceLabsOptionsBuilder(_driverOptions, SauceLabsOptions, _sauceLabsSettings).Build();

            DriverSetupValidator.ValidateDriver(_driverOptions);
            DriverSetupValidator.ValidateSauceLabs(_driverOptions.TargetDevice, SauceLabsOptions);

            var drivers = GetDrivers();

            drivers[_driverOptions.TargetBrowser].AppiumVersion       = SauceLabsOptions.AppiumVersion;
            drivers[_driverOptions.TargetBrowser].BrowserVersion      = _driverOptions.TargetBrowserVersion;
            drivers[_driverOptions.TargetBrowser].DeviceName          = _driverOptions.TargetDeviceName;
            drivers[_driverOptions.TargetBrowser].LoggingEnabled      = SauceLabsOptions.EnableLogging;
            drivers[_driverOptions.TargetBrowser].MacPlatform         = SauceLabsOptions.MacPlatformVersion;
            drivers[_driverOptions.TargetBrowser].Orientation         = _driverOptions.TargetDeviceOrientation;
            drivers[_driverOptions.TargetBrowser].PlatformVersion     = _driverOptions.PlatformVersion;
            drivers[_driverOptions.TargetBrowser].RealDevice          = _driverOptions.RealDevice;
            drivers[_driverOptions.TargetBrowser].RealDeviceApiKey    = _sauceLabsSettings.RealDeviceApiKey;
            drivers[_driverOptions.TargetBrowser].RealDeviceServerUrl = _sauceLabsSettings.RemoteRealDeviceServerUrl;
            drivers[_driverOptions.TargetBrowser].SauceOptions        = sauceOptions;
            drivers[_driverOptions.TargetBrowser].Uri = new Uri(_sauceLabsSettings.RemoteServerUrl);
            return(drivers[_driverOptions.TargetBrowser].InitialiseForSauceLabs());
        }