예제 #1
0
        /// <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();
            }
        }
예제 #2
0
 /// <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);
 }
예제 #3
0
        public void One_Plus_One_For_Second_Order_When_First_Pending()
        {
            //Sign up
            _commonActions.Sign_Up_Mobile();
            _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(WayToPay.Offline, false); //will be pending order

            _commonActions.BuyRegularOneDrawTicket_Front(_merchant); //will be successful order

            _verifications.CheckBalanceOnDepositPage_Web(0); //Check if there is no 1+1 promotion for the second payment if the first one is pending
        }
예제 #4
0
        public void One_Plus_One_For_Second_Order_When_First_Failed()
        {
            //Sign up
            _commonActions.Sign_Up_Mobile();
            _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(WayToPay.Offline, false); //will be pending order

            double price = _commonActions.BuyRegularOneDrawTicket_Front(_merchant); //will be successful order

            _commonActions.SignIn_in_admin_panel();
            _commonActions.Authorize_the_first_payment();
            _commonActions.Fail_offline_payment(); //fail the first payment

            if (price >= 30)
            {
                _verifications.CheckBalanceOnDepositPage_Web(30);  //Check if for the second payment a user got 1+1
            }
            else
            {
                _verifications.CheckBalanceOnDepositPage_Web(price);  //Check if for the second payment a user got 1+1
            }
        }
예제 #5
0
        public void One_Plus_One_After_Failed_Order()
        {
            //Sign up
            _commonActions.Sign_Up_Mobile();
            _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(WayToPay.Offline, true, true);

            double price = _commonActions.BuyRegularOneDrawTicket_Front(_merchant);

            if (price + totalPrice >= 30)
            {
                _verifications.CheckBalanceOnDepositPage_Web(30);
            }
            else
            {
                _verifications.CheckBalanceOnDepositPage_Web(price + totalPrice);
            }
        }
예제 #6
0
        /// <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;
        }