/// <summary> /// Performs once before all other tests. Buys a regular single ticket /// </summary> // [TestFixtureSetUp] public void Buy_Regular_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 RegularGamePageObj regularGame = new RegularGamePageObj(_driver); //go to single tab regularGame.ClickStandartGameButton(); //Select single draw regularGame.SelectOneTimeEntryGame(); _totalPrice = regularGame.TotalPrice; MerchantsObj merchants = regularGame.ClickBuyTicketsButton(); 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; }