示例#1
0
        public TelasFluxoCompleto(Browser browser)
        {
            _browser = browser;

            string caminhoDriver = ConfigurationManager.AppSettings["Selenium"];

            _driver = WebDriveFactory.CreateWebDriver(_browser, caminhoDriver);
        }
        public TelaMatematica(Browser browser)
        {
            this._browser = browser;

            //Tell, don't ask
            _caminhoDriver = CaminhoDoBrowser.PegaCaminho(_browser.ToString());

            //Tell, don't ask
            _driver = WebDriveFactory.ObterWebDriver(_browser, _caminhoDriver);
        }
示例#3
0
        public AlarmsObjects(Browser browser)
        {
            _browser = browser;

            //Tell, don't ask
            _caminhoDriver = CaminhoDoBrowser.PegaCaminho(_browser.ToString());

            //Tell, don't ask
            _driver = WebDriveFactory.ObterWebDriver(_browser, _caminhoDriver);
        }
示例#4
0
        public AdvancedObjects(Browser browser)
        {
            _browser = browser;

            //Tell, don't ask
            _caminhoDriver = CaminhoDoBrowser.PegaCaminho(_browser.ToString());

            //Tell, don't ask
            _driver = WebDriveFactory.ObterWebDriver(_browser, _caminhoDriver);

            _areaPlotter = new Trend(_driver);
        }
示例#5
0
        public TelaHome(IConfiguration configuration, Browser browser)
        {
            _configuration = configuration;
            _browser       = browser;

            string caminhoDriver = null;

            if (browser == Browser.Chrome)
            {
                caminhoDriver = _configuration.GetSection("Selenium:CaminhoDriverChrome").Value;
            }

            _driver = WebDriveFactory.CreateWebDriver(browser, caminhoDriver);
        }
示例#6
0
        private static void RegisterDependencies(ContainerBuilder builder)
        {
            FlurlHttp.Configure(settings => settings.HttpClientFactory = new PollyHttpClientFactory());

            //using log module, best way create nuget for this
            builder.RegisterModule(new LogModule());
            builder.RegisterType <PageObject>().As <IPageObject>();
            builder.RegisterType <SendDataToSampleApi>().As <ISendDataToSampleApi>();

            builder.Register(x => Configuration.GetSection("selenium").Get <SeleniumConfig>()).As <SeleniumConfig>();
            builder.Register(x => Configuration.GetSection("sibApi").Get <SibApiConfig>()).As <SibApiConfig>();

            builder.Register(x =>
            {
                var seleniumConfig = x.Resolve <SeleniumConfig>();
                return(WebDriveFactory.CreateWebDrive(seleniumConfig.Browser, seleniumConfig.DrivePath,
                                                      seleniumConfig.Headless));
            }).As <IWebDriver>();
        }