/// <summary> /// Deposit other amount of money (pays with Neteller) /// </summary> /// <param name="amount"></param> /// <param name="merchant">Merchant to pay</param> /// <param name="ifProcess">Tells if to process the payment of leave it pendant</param> /// <param name="isFailed">To fail payment of not</param> public void DepositOtherAmount(double amount, WayToPay merchant, bool ifProcess = true, bool isFailed = false) { _otherRadioButton.Click(); _amountInput.SendKeys(amount.ToString(System.Globalization.CultureInfo.InvariantCulture)); PayForDeposit(merchant, ifProcess, isFailed); }
private void btnAdd_Click(object sender, EventArgs e) { WayToPay wayToPay = new WayToPay(); if (isEdit == false) { var result = MessageBox.Show("¿Desea registrar forma de pago?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { wayToPay.Description = textDescripcion.Text; WorkWayToPay.addWayToPay(wayToPay); loadWayToPays(); clear(); } } if (isEdit == true) { var result = MessageBox.Show("¿Desea guardar los cambios?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { wayToPay.Id = Convert.ToInt32(idWayToPay); wayToPay.Description = textDescripcion.Text; WorkWayToPay.updateWayToPay(wayToPay); loadWayToPays(); MessageBox.Show("Cambios actualizados correctamente", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); clear(); isEdit = false; } } }
public BuyGroupMultiDrawTicketTests(string device, WayToPay merchant) { _device = device; _merchant = merchant; SetUp(CreateOptions(_device)); _sharedCode = new TestsSharedCode(_driver); try { Buy_Group_Multi_Draw_Ticket(_merchant); } catch (Exception e) { _setUpFailed = true; CleanUp(); if (_merchant == WayToPay.InternalBalance) { _sharedCode.CleanCart(_driverCover.LoginTwo, _driverCover.Password); } else { _sharedCode.CleanCart(_driverCover.Login, _driverCover.Password); } throw new Exception("Exception was thrown while executing: " + e.Message + " "); } CleanUp(); }
public static void addWayToPay(WayToPay wayToPay) { SqlConnection connection = new SqlConnection(ClasesBase.Properties.Settings.Default.conexion); SqlCommand command = new SqlCommand(); command.CommandText = "INSERT INTO FormaPago(fp_descripcion) values(@descripcion)"; command.CommandType = CommandType.Text; command.Connection = connection; command.Parameters.AddWithValue("@descripcion", wayToPay.Description); connection.Open(); command.ExecuteNonQuery(); connection.Close(); }
public static void updateWayToPay(WayToPay wayToPay) { SqlConnection connection = new SqlConnection(ClasesBase.Properties.Settings.Default.conexion); SqlCommand cmd = new SqlCommand(); cmd.Connection = connection; cmd.CommandText = "UPDATE FormaPago SET fp_descripcion=@descripcion WHERE fp_id=@id"; cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@id", wayToPay.Id); cmd.Parameters.AddWithValue("@descripcion", wayToPay.Description); connection.Open(); cmd.ExecuteNonQuery(); connection.Close(); }
public DepositSuccessTests(string device, WayToPay merchant) { _device = device; _merchant = merchant; _depositAmount = 30; SetUp(); try { Deposit_Money(merchant); } catch (Exception e) { _setUpFailed = true; CleanUp(); throw new Exception("Exception was thrown while executing: " + e.Message + " "); } CleanUp(); }
/// <summary> /// Click on a merchant in the left section to display its details /// </summary> /// <param name="merchant"></param> public void ClickOnMerchant(WayToPay merchant) { switch (merchant) { case WayToPay.Offline: { _offlineMerchant.Click(); } break; case WayToPay.Poli: { _poliMerchant.Click(); } break; case WayToPay.Invoice: { _invoiceMerchant.Click(); } break; } }
/// <summary> /// Pays for whatever using selected merchant (also able to fail payment) /// </summary> /// <param name="merchant">How to pay</param> /// <param name="ifProcess">To process payment (if it was offline)</param> /// <param name="isFailed">To fail or not</param> public void Pay(WayToPay merchant, bool ifProcess = true, bool isFailed = false) { if (merchant == WayToPay.Invoice) { PayWithInvoice(); if (ifProcess) { ProcessOrder(isFailed); } } if (merchant == WayToPay.Skrill) { PayWithSkrill(); } if (merchant == WayToPay.TrustPay) { PayWithTrustPay(!isFailed); } if (merchant == WayToPay.Neteller) { PayWithNeteller(); } if (merchant == WayToPay.Offline) { PayWithOfflineCharge(); if (ifProcess) { ProcessOrder(isFailed); } } }
/// <summary> /// Performs once before all other tests. Buys a group multi-draw ticket /// </summary> // [TestFixtureSetUp] public void Buy_Group_Multi_Draw_Ticket(WayToPay merchant) { // Log in if (merchant != WayToPay.InternalBalance) { _commonActions.Log_In_Front_PageOne(_driverCover.Login, _driverCover.Password); } else { //If pay with internal balance we need to log in with different user _commonActions.Log_In_Front_PageOne(_driverCover.LoginTwo, _driverCover.Password); } _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/play/eurojackpot/"); //Pay for tickets GroupGamePageObj groupGame = new GroupGamePageObj(_driver); _totalPrice = groupGame.TotalPrice; _drawsToPlay = groupGame.NumberOfDraws; MerchantsObj merchants = groupGame.ClickBuyTicketsButton(); if (merchant != WayToPay.InternalBalance) { merchants.Pay(merchant); } else { CheckoutObj checkout = new CheckoutObj(_driver); checkout.ClickCompleteYourOrderButton(); } }
/// <summary> /// Performs once before all other tests. Buys a raffle ticket /// </summary> private void Buy_Raffle_Ticket(WayToPay merchant) { // Log in if (merchant != WayToPay.InternalBalance) { _commonActions.Log_In_Front_PageOne(_driverCover.Login, _driverCover.Password); } else { //If pay with internal balance we need to log in with different user _commonActions.Log_In_Front_PageOne(_driverCover.LoginTwo, _driverCover.Password); } _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/raffles/loteria-de-navidad/"); RafflesPageObj rafflePage = new RafflesPageObj(_driver); _totalPrice = rafflePage.TotalPrice; rafflePage.ClickBuyNowButton();// MerchantsObj merchants = new MerchantsObj(_driver); if (merchant != WayToPay.InternalBalance) { merchants.Pay(merchant); } else { CheckoutObj checkout = new CheckoutObj(_driver); checkout.ClickCompleteYourOrderButton(); } }
/// <summary> /// Buys a regular one-draw ticket /// </summary> /// <returns>Total price to pay</returns> public double BuyRegularOneDrawTicket_Front(WayToPay merchant, bool processOrder = true) { _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/play/powerball/"); //Pay for tickets RegularGamePageObj regularGame = new RegularGamePageObj(_driver); //go to single tab regularGame.ClickStandartGameButton(); //Select single draw regularGame.SelectOneTimeEntryGame(); double totalPrice = regularGame.TotalPrice; MerchantsObj merchants = regularGame.ClickBuyTicketsButton(); if (processOrder) { merchants.Pay(merchant); } else { merchants.Pay(merchant, false); } return totalPrice; }
/// <summary> /// Deposits money to the user's balance /// </summary> /// <param name="merchant"></param> private void Deposit_Money(WayToPay merchant) { _email = _commonActions.Log_In_Front_PageOne(_driverCover.LoginTwo, _driverCover.Password); _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/account/deposits/new/"); DepositMobileObj deposit = new DepositMobileObj(_driver); _balanceBeforePayment = deposit.Balance; deposit.DepositOtherAmount(_depositAmount, merchant); }
/// <summary> /// Deposits exact amount of money to the previously signed in user's account on mobile /// </summary> /// <param name="amount"></param> /// <param name="merchant">Merchant to pay</param> /// <param name="ifProcess">Tells if process the payment or leave it pendant</param> /// <param name="isFailed">To fail payment of not</param> public void DepositMoney_Mobile(double amount, WayToPay merchant, bool ifProcess = true, bool isFailed = false) { _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/account/deposits/new/"); DepositMobileObj deposit = new DepositMobileObj(_driver); deposit.DepositOtherAmount(amount, merchant, ifProcess, isFailed); }
/// <summary> /// Pays for tickets in the cart (offline or internal balance). To use this method you must be on the sales panel page /// </summary> /// <param name="merchant"></param> /// <param name="ifProcess"></param> /// <param name="isFailed"></param> public double PayForTicketsInCart_SalesPanel(WayToPay merchant, bool ifProcess = true, bool isFailed = false) { TestFramework.BackEndObj.SalesPanelPages.CartObj cart = new TestFramework.BackEndObj.SalesPanelPages.CartObj(_driver); double totalPrice = cart.TotalPrice; if (merchant == WayToPay.Offline) { AddCCDetails_SalesPanel(); cart.Charge(); if (ifProcess) { _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/charge_panel_manager"); ChargePanelObj chargePanel = new ChargePanelObj(_driver); chargePanel.ChargeTheLastPayment(); ChargeFormObj chargeForm = new ChargeFormObj(_driver); if (!isFailed) { chargeForm.MakeTransactionSucceed(); } else { chargeForm.MakeTransactionFailed(); } chargeForm.UpdateTransaction(); } } if (merchant == WayToPay.InternalBalance) { cart.PayWithInternalBalance(); } return totalPrice; }
/// <summary> /// Deposits standard amount of money (selects among available) /// </summary> /// <param name="amount">How much to deposit</param> /// <param name="merchant">How to pay</param> /// <param name="ifProcess">To process payment or not (for offline payment)</param> /// <param name="isFailed">To faild payment or not</param> public void DepositStandardAmount(double amount, WayToPay merchant, bool ifProcess = true, bool isFailed = false) { SelectStandardAmount(amount); PayForDeposit(merchant, ifProcess, isFailed); }
/// <summary> /// Pays for deposit (standard or other amount) /// </summary> /// <param name="merchant">How to pay</param> /// <param name="ifProcess">To process payment (if it was offline)</param> /// <param name="isFailed">To fail or not</param> private void PayForDeposit(WayToPay merchant, bool ifProcess = true, bool isFailed = false) { MerchantsObj merchantsObj = new MerchantsObj(Driver); merchantsObj.Pay(merchant, ifProcess, isFailed); }
public PromotionTests(string device, WayToPay merchant) { _device = device; _merchant = merchant; }
/// <summary> /// Buys a raffle ticket /// </summary> /// <returns>Total price to pay</returns> public double BuyRaffleTicket_Front(WayToPay merchant) { _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/raffles/loteria-de-navidad/"); RafflesPageObj rafflePage = new RafflesPageObj(_driver); double totalPrice = rafflePage.TotalPrice; rafflePage.ClickBuyNowButton();// MerchantsObj merchants = new MerchantsObj(_driver); merchants.Pay(merchant); return totalPrice; }
/// <summary> /// Cheks the merchant of the last transaction (the first record) on "Back - Transactions" page /// </summary> /// <param name="merchant">Payment method</param> public void CheckTransactionMerchantInTransactions_Back(WayToPay merchant) { _commonActions.SignIn_in_admin_panel(); _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/transactions"); TransactionsObj transaction = new TransactionsObj(_driver); string transactionMerchant = transaction.GetFirstTransactionMerchant(); Assert.AreEqual(merchant.ToString(System.Globalization.CultureInfo.InvariantCulture), transactionMerchant, "Sorry, the merchant in the first record is wrong, check if a record was added, page: " + _driverCover.Driver.Url + " "); }
/// <summary> /// Performs once before all other tests. Buys a group single ticket /// </summary> //[TestFixtureSetUp] public void Buy_Group_One_Draw_Ticket(WayToPay merchant) { // Log in if (merchant != WayToPay.InternalBalance) { _commonActions.Log_In_Front_PageOne(_driverCover.Login, _driverCover.Password); } else { //If pay with internal balance we need to log in with different user _commonActions.Log_In_Front_PageOne(_driverCover.LoginTwo, _driverCover.Password); } _driverCover.NavigateToUrl(_driverCover.BaseUrl + "en/play/el-gordo-de-la-primitiva/"); //Pay for tickets GroupGamePageObj groupGame = new GroupGamePageObj(_driver); //Select single draw groupGame.SelectOneTimeEntryGame(); _totalPrice = groupGame.TotalPrice; MerchantsObj merchants = groupGame.ClickBuyTicketsButton(); if (merchant != WayToPay.InternalBalance) { merchants.Pay(merchant); } else { CheckoutObj checkout = new CheckoutObj(_driver); checkout.ClickCompleteYourOrderButton(); } }