public void SuccessfulLoginTest()
 {
     BrowserFactory.InitBrowser("Chrome");
     BrowserFactory.LoadApplication(ConfigurationManager.AppSettings["URL"]);
     new LoginAsserts(Page.Login).AssertLoginSuccessful(Credencials.GetValidRandom());
     BrowserFactory.CloseAllDrivers();
 }
Ejemplo n.º 2
0
        public LoginAsserts AssertLoginSuccessful(Credencials credencials)
        {
            Assert.NotNull(credencials);
            var logger = NLog.LogManager.GetCurrentClassLogger();

            logger.Info(string.Format("using credentials: username={0} password={1}", credencials.Username,
                                      credencials.Password));
            var expected = typeof(LoginPage);

            Assert.IsType(expected, currentPage);
            var startTime    = DateTime.UtcNow;
            var signedinPage =
                (this.currentPage as LoginPage).LoginToApplication(credencials.Username, credencials.Password);
            var actualTime = DateTime.UtcNow.Subtract(startTime);

            logger.Info(string.Format("sign in took: {0}s", actualTime.TotalSeconds));

            Assert.True(signedinPage.AllElementsPresentAsExpected);

            return(this);
        }