public void WhenIPayForTheAdoptionUsingThisTypeOfPayment(Table table)
        {
            List<PaymentInfo_2> paymentInfos = new PaymentInfo_2().Transform(table);
            var paymentInfo = paymentInfos[0];

            adoptingSteps.pay_for_the_adoption(paymentInfo);
        }
Пример #2
0
 public List<PaymentInfo_2> Transform(Table table)
 {
     List<PaymentInfo_2> paymentInfos = new List<PaymentInfo_2>();
     foreach (TableRow row in table.Rows)
     {
         PaymentInfo_2 paymentInfo = new PaymentInfo_2();
         paymentInfo.paymentType = row["paymentType"];
         paymentInfo.orderName = row["orderName"];
         paymentInfo.orderAddress = row["orderAddress"];
         paymentInfo.orderEmail = row["orderEmail"];
         paymentInfos.Add(paymentInfo);
     }
     return paymentInfos;
 }
Пример #3
0
 public void pay_for_the_adoption(PaymentInfo_2 paymentInfo)
 {
     IWebElement orderNameField = driver.FindElement(By.Id("order_name"));
     IWebElement orderAddressField = driver.FindElement(By.Id("order_address"));
     IWebElement orderEmailField = driver.FindElement(By.Id("order_email"));
     IWebElement orderPayTypeElement = driver.FindElement(By.Id("order_pay_type"));
     IWebElement placeOrderButton = driver.FindElement(By.XPath("//input[@value='Place Order']"));
     orderNameField.SendKeys(paymentInfo.orderName);
     orderAddressField.SendKeys(paymentInfo.orderAddress);
     orderEmailField.SendKeys(paymentInfo.orderEmail);
     SelectElement select = new SelectElement(orderPayTypeElement);
     foreach (IWebElement option in select.Options)
     {
         if (option.Text == paymentInfo.paymentType)
         {
             option.Click();
             break;
         }
     }
     placeOrderButton.Click();
 }