Exemplo n.º 1
0
        public void CanCreateLoanTest()
        {
            try
            {
                // Arrange
                if (!AuthenticationHelpers.IsLoggedIn(_driver))
                {
                    AuthenticationHelpers.LoginAsTestUser(_driver);
                }

                bool isCreateLoanConfirmationShown = false;

                // Act
                ElementHelpers.ClickElement(_driver, By.PartialLinkText("New Loan"));
                ElementHelpers.SendKeys(_driver, By.Id("LoanerCardBarcode"), "10000");
                ElementHelpers.SendKeys(_driver, By.Id("CopyBarcode"), "100001");
                ElementHelpers.SelectElementByText(_driver, By.Id("LibraryName"), "Georgia Tech Library");
                ElementHelpers.ClickElement(_driver, By.Id("Create"));

                isCreateLoanConfirmationShown = ElementHelpers.IsElementPresent(_driver, By.ClassName("alert-success"));

                // Assert
                Assert.True(isCreateLoanConfirmationShown);
            }
            finally
            {
                DriverHelpers.CleanUpTest(_driver);
            }
        }
Exemplo n.º 2
0
        public void CanLogoutTest()
        {
            try
            {
                // Arrange
                if (!AuthenticationHelpers.IsLoggedIn(_driver))
                {
                    AuthenticationHelpers.LoginAsTestUser(_driver);
                }

                // Act
                AuthenticationHelpers.Logout(_driver);

                // Assert
                Assert.False(AuthenticationHelpers.IsLoggedIn(_driver));
            }
            finally
            {
                DriverHelpers.CleanUpTest(_driver);
            }
        }