Пример #1
0
        static WebTest()
        {
            var mapper = new AssemblyScanningMappingProvider();

            mapper.Scan(typeof(AccountRepository).Assembly);
            EntityMappingProvider.Provider = mapper;

            _databaseManager.CreateEmptyDatabase();
            _databaseManager.InitSchema();

            AppDomain.CurrentDomain.DomainUnload += (o, e) =>
            {
                _iisExpress?.Stop();
                _databaseManager.Dispose();
            };

            // Disables database migration in codeRR.Server.Web project, should be up-to-date already
            // SchemaUpdateModule does not handle coderr_ConnectionString environment variable
            // This should only be run on build server due to changes in web.config
            if (Environment.GetEnvironmentVariable("TF_BUILD") != null)
            {
                DisableDatabaseMigrations();
            }

            var configPath =
                Path.Combine(Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\..\")),
                             "applicationhost.config");

            Console.WriteLine($"Path to IIS Express configuration file '{configPath}'");

            _iisExpress = new IisExpressHelper
            {
                ConfigPath = configPath,

                // Pass on connectionstring to codeRR.Server.Web during testing, overriding connectionstring in web.config
                EnvironmentVariables = new Dictionary <string, string> {
                    { "coderr_ConnectionString", _databaseManager.ConnectionString }
                }
            };
            _iisExpress.Start("codeRR.Server.Web");

            // Warmup request only on build server
            if (Environment.GetEnvironmentVariable("TF_BUILD") != null)
            {
                var webClient = new WebClient();
                webClient.DownloadString(_iisExpress.BaseUrl);
            }

            TestUser = new TestUser {
                Username = "******", Password = "******", Email = "*****@*****.**"
            };

            TestData = new TestDataManager(_databaseManager.OpenConnection)
            {
                TestUser = TestUser
            };

            WebDriver = DriverFactory.Create(BrowserType.Chrome);
            AppDomain.CurrentDomain.DomainUnload += (o, e) => { DisposeWebDriver(); };
        }
        public void SetUp()
        {
            var appConfig = ConfigHelper.Get();

            _driver = DriverFactory.Create(appConfig);
            _driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(appConfig.DriverToUse.TimeOuts.ImplicitWait);
            _driver.Navigate().GoToUrl(appConfig.BaseURL);
            _wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(appConfig.DriverToUse.TimeOuts.ExplicitWait));
        }
Пример #3
0
        static void Main(string[] args)
        {
            var action = new ActionAmexDownload(DriverFactory.Create(), new Dictionary <string, string>()
            {
                { "loginUrl", "https://global.americanexpress.com/login" },
                { "userName", ConfigurationManager.AppSettings["userName"] },
                { "password", ConfigurationManager.AppSettings["password"] },
            });

            action.Execute();
        }
Пример #4
0
 public void RegisterDriver(List <string> commandArgs)
 {
     try
     {
         var driver = DriverFactory.Create(commandArgs);
         activeDrivers.Add(driver.Name, driver);
     }
     catch
     {
     }
 }
Пример #5
0
        //[TestCase("Firefox")]
        //[TestCase("edge")]
        // given I am at the youtube home page
        // when I search for a title
        // then should see videos related to the title
        public void WhenSearchinForATitleShouldReturnAnyVideoRelated(string browser)
        {
            this.driver = DriverFactory.Create(browser, "https://www.youtube.com/");

            HomePage homePage = new HomePage(driver);

            homePage.SearchTitle("Tibia");

            SearchPage searchPage = new SearchPage(driver);

            searchPage.HasAvailableTitles("Tibia").Should().BeTrue();
        }
 public void RegisterDriver(List <string> commandArgs)
 {
     if (currentLap > 0)
     {
         Console.WriteLine("The race has already begun!");
     }
     else
     {
         Driver driver = driverFactory.Create(commandArgs);
         drivers.Add(driver);
     }
 }
        public WebDriverContext(IObjectContainer container)
        {
            // maybe create a factory...
            //https://stackoverflow.com/questions/4822568/how-do-i-test-multiple-browsers-with-selenium-and-a-single-nunit-suite-and-keep
            //IWebDriver driver = DriverFactory.Create(TestConfig.Browser);

            // delay initialising

            Driver.Driver driver = new Driver.Driver(DriverFactory.Create(TestConfig.Browser, new ReportingSeleniumEventHandler()));
            //Driver driver = new ExtentReportDriver(new Driver());
            container.RegisterInstanceAs(driver);
        }
Пример #8
0
 public void SetupDriver()
 {
     DebugLogger.Instance().LogRecord("Changing driver type to " + m_printerinfo.m_driverconfig.m_drivertype.ToString());
     if (m_deviceinterface.Driver != null)
     {
         if (m_deviceinterface.Driver.Connected == true)
         {
             // be sure to close the old driver to play nice
             m_deviceinterface.Driver.Disconnect();
         }
     }
     m_deviceinterface.Driver = DriverFactory.Create(m_printerinfo.m_driverconfig.m_drivertype);
 }
Пример #9
0
 public void SetupDriverProjector()
 {
     DebugLogger.Instance().LogRecord("Changing monitor driver type to " + eDriverType.eGENERIC.ToString());
     if (m_deviceinterface.DriverProjector != null)
     {
         if (m_deviceinterface.DriverProjector.Connected == true)
         {
             // be sure to close the old driver to play nice
             m_deviceinterface.DriverProjector.Disconnect();
         }
     }
     m_deviceinterface.DriverProjector = DriverFactory.Create(eDriverType.eGENERIC);
 }
Пример #10
0
 public void RegisterDriver(List <string> commandArgs)
 {
     try
     {
         Tyre   tyre   = TyreFactory.Create(commandArgs);
         Car    car    = CarFactory.Create(commandArgs, tyre);
         Driver driver = DriverFactory.Create(commandArgs, car);
         string name   = commandArgs[1];
         racingDrivers.Add(driver);
     }
     catch (ArgumentException)
     { }
 }
Пример #11
0
        } //OK

        public void RegisterDriver(List <string> commandArgs)
        {
            this.stringBuilder.Clear();

            try
            {
                Driver driver = driverFactory.Create(commandArgs);
                this.drivers.Add(driver);
            }
            catch (Exception ex)
            {
                this.stringBuilder.Append(ex.Message);
            }
        } //OK
Пример #12
0
        public void CreateDriver(DriverDTO driverDto)
        {
            var driver = _unitOfWork.DriverRepository.Find(d => d.LicenseNumber == driverDto.LicenseNumber)
                         .FirstOrDefault();

            if (driver != null)
            {
                throw new Exception($"Driver with {driverDto.LicenseNumber} license number already exists.");
            }
            driver = _driverFactory.Create(driverDto.Id, driverDto.LicenseNumber, driverDto.FirstName,
                                           driverDto.LastName);
            _unitOfWork.DriverRepository.Insert(driver);
            _unitOfWork.Commit();
        }
 /// <summary>
 /// This function removes all previous device drivers for the projector
 /// serial ports, it will then re-create the drivers, configure them, and
 /// add them to the device interface for later use.
 /// </summary>
 private void RegenProjectorSerialPorts()
 {
     // this will remove all projector device drivers.
     UVDLPApp.Instance().m_deviceinterface.RemoveAllProjDrivers();
     foreach (MonitorConfig mc in UVDLPApp.Instance().m_printerinfo.m_lstMonitorconfigs)
     {
         //check to see if we're recreatiung the port
         if (mc.m_displayconnectionenabled == true)
         {
             DeviceDriver dev = DriverFactory.Create(eDriverType.eGENERIC);
             dev.Configure(mc.m_displayconnection);
             UVDLPApp.Instance().m_deviceinterface.AddDriver(dev);
         }
     }
 }
Пример #14
0
        public void WhenClcickingShareShouldSeeAvailableLink(string browser)
        {
            var driver = DriverFactory.Create(browser, "https://www.youtube.com/results?search_query=tibia");

            SearchPage searchPage = new SearchPage(driver);

            searchPage.AccessFirstVideo();

            VideoPage videoPage = new VideoPage(driver);

            videoPage.ClickShareButton();
            Uri url = videoPage.GetSharingUrl();

            url.Should().NotBeNull();
            url.Host.Should().Be("youtu.be");
            url.Scheme.Should().Be("https");
        }
Пример #15
0
        public static void InitializeFeatureContext(FeatureContext featureContext)
        {
            var adminUser = new LoginUser()
            {
                UserType  = _adminUserConfig.UserType,
                Username  = _adminUserConfig.Username,
                Password  = _adminUserConfig.Password,
                FirstName = _adminUserConfig.FirstName,
                LastName  = _adminUserConfig.LastName
            };

            var businessUser = new LoginUser()
            {
                UserType  = _businessUserConfig.UserType,
                Username  = _businessUserConfig.Username,
                Password  = _businessUserConfig.Password,
                FirstName = _businessUserConfig.FirstName,
                LastName  = _businessUserConfig.LastName
            };

            var driver = DriverFactory.Create(_testConfig.BrowserType);

            var testContext = new UITestContext()
            {
                BaseUrl         = _testConfig.Url,
                BrowserType     = _testConfig.BrowserType,
                Driver          = driver,
                DriverTimeout   = _testConfig.DriverTimeoutMilliseconds,
                Reporter        = _reporter,
                UserCredentials = new List <LoginUser>
                {
                    adminUser,
                    businessUser
                },
            };

            driver.Navigate().GoToUrl(testContext.BaseUrl);
            _reporter.CreateFeature(featureContext.FeatureInfo.Title);

            featureContext.FeatureContainer.RegisterInstanceAs(testContext);
        }
Пример #16
0
 public void BeforeScenario()
 {
     driver = DriverFactory.Create();
     driver.Manage().Timeouts().AsynchronousJavaScript = TimeSpan.FromSeconds(5);
     objectContainer.RegisterInstanceAs <IWebDriver>(driver);
 }
Пример #17
0
 public void BeforeScenario()
 {
     this.appiumServers.Start(DriverFactory.DriverInfo);
     driver = DriverFactory.Create();
     objectContainer.RegisterInstanceAs<IWebDriver>(driver);
 }
 private void NavigateToPage()
 {
     this._webDriver     = DriverFactory.Create("chrome");
     this._webDriver.Url = "https://login.yahoo.com/account/create?";
 }
Пример #19
0
 public void CreateDriver()
 {
     Driver = DriverFactory.Create(_driverType);
     Driver.Manage().Window.Maximize();
 }
Пример #20
0
 public void SetupDriver()
 {
     DebugLogger.Instance().LogRecord("Changing driver type to " + m_printerinfo.m_driverconfig.m_drivertype.ToString());
     m_deviceinterface.Driver = DriverFactory.Create(m_printerinfo.m_driverconfig.m_drivertype);
 }
 /// <summary>
 /// This method is use for instance driver
 /// </summary>
 /// <param name="factoryType"></param>
 /// <param name="type"></param>
 /// <param name="configuaration"></param>
 public static void StartDriver(Browser type)
 {
     //DriverFactory.Create(type, new ReportingSeleniumEventHandler());
     DriverStored = new Driver(DriverFactory.Create(type, new ReportingSeleniumEventHandler()));
 }
Пример #22
0
 public void BeforeScenario()
 {
     driver = DriverFactory.Create();
     driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
     objectContainer.RegisterInstanceAs <IWebDriver>(driver);
 }