Пример #1
0
        public void Payment_EnterCreditCardInformation_ReturnsSuccessMessage()
        {
            _driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            _loginHelper.LoginUser();

            // Make sure we find the preferences save button
            _page.FindSaveButton();

            // Accept cookies so the status message will appear
            _page.ClickAcceptCookies();

            string creditCard = "4123450131003313";
            string exp        = "12/23";
            string cvc        = "343";
            string name       = "Lucas Winkler";

            // Populate the elements and submit form
            _page.ClearCreditCard();
            _page.ClearCreditCardName();
            _page.ClearCVC();
            _page.ClearExpiryDate();

            _page.PopulateCreditCard(creditCard.Replace("4123450131003313", "4123450131003312"));
            _page.PopulateExpiryDate(exp.Replace("12/23", "01/19"));
            _page.PopulateCVC(cvc.Replace("343", "312"));
            _page.PopulateCreditCardName(name.Replace("Lucas Winkler", "Bob Smith"));
            _page.ClickSave();

            // Checks to see if the status message exists
            _page.FindStatusMessage();

            // Make sure we're on the preferences page and check the source for the StatusMessage text
            Assert.Equal("Payment information", _page.Title);
            Assert.Contains("Your payment information has been updated", _page.Source);
        }