Esempio n. 1
0
        static void Main(string[] args)
        {


            IWebDriver _driver = new ChromeDriver();
            DriverCover _driverCover = new DriverCover(_driver);
            TestFramework.CommonActions common = new TestFramework.CommonActions(_driver);
            common.SignIn_in_admin_panel();


            _driverCover.NavigateToUrl("http://stgadmin.lottobaba.com/admin/packages");
            PackagesPageObj package = new PackagesPageObj(_driver);
            package.EditPackage("SuperEnalotto (1-90)", 8);

            for (int i = 0; i < 71; ++i)
            {
                ChargePanelObj panel = new ChargePanelObj(_driver);
                ChargeFormObj form = panel.ChargeTheLastPayment();

                form.MakeTransactionFailed();
                form.UpdateTransaction();

            }
        }
Esempio n. 2
0
        /// <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;
        }
Esempio n. 3
0
        /// <summary>
        /// Goes to charge panel and fails the last payment. Doesn't perform authorization in admin panel
        /// </summary>
        public void Fail_offline_payment()
        {
            _driverCover.NavigateToUrl(_driverCover.BaseAdminUrl + "admin/charge_panel_manager");

            ChargePanelObj panel = new ChargePanelObj(_driver);
            ChargeFormObj form = panel.ChargeTheLastPayment();

            form.MakeTransactionFailed();
            form.UpdateTransaction();
        }