public void DealFee03_BillerCounterPayerCounterDeal()
        {
            HomePage HomePg = new HomePage(WebDriver);

            try
            {
                WebDriver.Manage().Window.Maximize();
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home");
                LoginPage       loginPage      = new LoginPage(WebDriver);
                SendPage        SendPg         = new SendPage(WebDriver);
                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                loginPage.UserNameTextBox().Click();
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay8);
                IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver);
                IssueInvoicePg.IssueInvoiceButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("madcowtesting10+872815244");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();

                //Generate two random numbers for unique customer details and invoice
                Random   rand        = new Random();
                DateTime dt          = new DateTime();
                string   dtString    = dt.ToString("MM/dd/yyyy HH:mm:ss");
                int      randnumber1 = rand.Next();
                Random   rand2       = new Random();
                DateTime dt2         = new DateTime();
                string   dtString2   = dt2.ToString("MM/dd/yyyy HH:mm:ss");
                int      randnumber2 = rand.Next();

                SeleniumSetMethods.WaitOnPage(secdelay3);

                String PaymentTerms = "60 days";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.CreateInvoice().Click();
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("INVDealFees@" + randnumber2);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to Internal Payer");
                IssueInvoicePg.LineItemAmount().SendKeys("1875.12");
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent to internal payer");
                IssueInvoicePg.SurchargeCheckbox().Click();

                //issueInvoice_issueInvoicePage_totalValue.checkValueContains = @amountGst
                IssueInvoicePg.SendInvoiceBTN().Click();
                Console.WriteLine("InvoiceCreated");
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SendPg.SearchInvoiceSent().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                bool reqcash = SIVPG1.RequestBillzyCashBTN().Displayed;
                bool reqdeal = SIVPG1.RequestBillzyDealBTN().Displayed;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(reqcash == true && reqdeal == true);
                DateTime duedate1       = DateTime.Today.AddDays(30);
                string   SentPgDueDate  = duedate1.ToString("dd/MM/yyyy");
                string   SentPgDueDate2 = duedate1.ToString("dd MMM yy");
                SIVPG1.BillerOfferADiscountBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SIVPG1.NewTotal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.NewTotal().SendKeys("1800.55");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.OfferExpiry().Click();
                string percentage = SIVPG1.SIVOfferDiscountpercentage().Text;
                Assert.IsTrue(percentage.Contains("12.71%"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.OfferExpiry().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.OfferExpiry().SendKeys(SentPgDueDate);
                SeleniumSetMethods.WaitOnPage(secdelay1);
                SIVPG1.Comments().SendKeys("Biller offered a Deal");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                SIVPG1.OfferDiscountModalBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay8);
                SIVPG1.ReturnBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                loginPage.UserNameTextBox().Click();

                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Recpg.SearchedFirstRowDetailsLink().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                SIVPG1.PayerMakeACounterOfferBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);

                SIVPG1.NewTotal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.NewTotal().SendKeys("1700");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                //verify discount %


                string percentage2 = SIVPG1.SIVOfferDiscountpercentage().Text;
                Assert.IsTrue(percentage2.Contains("17.58%"));
                SeleniumSetMethods.WaitOnPage(secdelay2);

                SIVPG1.Comments().SendKeys("Payer made a counter offer");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                SIVPG1.makeCounterOfferModalBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                bool withdraw = SIVPG1.WithdrawOfferPayerBTN().Displayed;
                Assert.IsTrue(withdraw == true);
                SIVPG1.ReturnBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Recpg.ActionsMenu().Click();
                HomePg.SignOutBTN().Click();

                SeleniumSetMethods.WaitOnPage(secdelay4);
                loginPage.UserNameTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");

                loginPage.LoginButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SendPg.SentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SendPg.SearchInvoiceSent().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay7);
                string status = SendPg.BillzyRow1().Text;
                bool   icon   = SendPg.OfferRecievedIcon().Displayed;

                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(status.Contains("Offer received") && icon == true);
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay7);
                SIVPG1.BillerMakeACounterOfferBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                DateTime duedate3       = DateTime.Today.AddDays(15);
                string   SentPgDueDate3 = duedate3.ToString("dd/MM/yyyy");
                string   SentPgDueDate4 = duedate3.ToString("dd MMM yy");
                SIVPG1.NewTotal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.NewTotal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.NewTotal().SendKeys("1800");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                //verify discount %
                string percentage1 = SIVPG1.SIVOfferDiscountpercentage().Text;
                Assert.IsTrue(percentage1.Contains("12.73%"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.OfferExpiry().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.OfferExpiry().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.OfferExpiry().SendKeys(SentPgDueDate3);
                SeleniumSetMethods.WaitOnPage(secdelay1);
                SIVPG1.Comments().SendKeys("Biller made a counter offer");
                SeleniumSetMethods.WaitOnPage(secdelay3);

                SIVPG1.makeCounterOfferModalBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SIVPG1.ReturnBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);

                SendPg.SearchInvoiceSent().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay7);

                String OfferStatus2 = SendPg.OfferStatussendpage().Text;

                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(OfferStatus2.Contains("Offer sent"));
                SeleniumSetMethods.WaitOnPage(secdelay3);
                HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                loginPage.UserNameTextBox().Click();

                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay3);

                String OfferStatus3 = Recpg.OfferacceptedStatus().Text;
                SeleniumSetMethods.WaitOnPage(secdelay1);

                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(OfferStatus3.Contains("Offer received"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Recpg.SearchedFirstRowDetailsLink().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);

                SIVPG1.PayerVerifyBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SIVPG1.ReturnBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);


                Recpg.ActionsMenu().Click();
                Recpg.PAY().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                PayNowPage Paynwpg = new PayNowPage(WebDriver);
                Paynwpg.Row01SelectCard().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Paynwpg.CardRow01().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);

                Paynwpg.ConfirmPaymentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Paynwpg.DoneBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Recpg.ReceivedHistoryBTN().Click();

                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("INVDealFees@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                string paidstatushover = Recpg.HistoryPaidStatus().GetAttribute("data-title");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(paidstatushover.Contains("paid"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.SignOutBTN().Click();
            }
            finally
            {
            }
        }
Esempio n. 2
0
        public void EXPDeal03_SIV_PayerBillerView_WithDeal_DealPayerInitiated_IncludingGST_NoSurcharge_PayCC()
        {
            HomePage HomePg = new HomePage(WebDriver);

            try
            {
                WebDriver.Manage().Window.Maximize();
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home");
                LoginPage loginPage = new LoginPage(WebDriver);


                loginPage.UserNameTextBox().Click();
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay8);
                IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver);

                SendPage SendPg = new SendPage(WebDriver);
                IssueInvoicePg.IssueInvoiceButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("payergst01");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();

                //Generate two random numbers for unique customer details and invoice
                Random   rand        = new Random();
                DateTime dt          = new DateTime();
                string   dtString    = dt.ToString("MM/dd/yyyy HH:mm:ss");
                int      randnumber1 = rand.Next();
                Random   rand2       = new Random();
                DateTime dt2         = new DateTime();
                string   dtString2   = dt2.ToString("MM/dd/yyyy HH:mm:ss");
                int      randnumber2 = rand.Next();

                SeleniumSetMethods.WaitOnPage(secdelay3);
                DateTime newDate      = DateTime.Now.AddDays(900);
                string   dtString3    = newDate.ToString("dd/MM/yyyy");
                String   PaymentTerms = "By Due Date";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IssueInvoicePg.DueDate().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IssueInvoicePg.DueDate().Clear();
                IssueInvoicePg.DueDate().SendKeys(dtString3);
                IssueInvoicePg.CreateInvoice().Click();
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("PEDCC@" + randnumber2);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to Internal Payer");

                IssueInvoicePg.LineItemAmount().SendKeys("319.82");
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent to internal payer");


                //IssueInvoicePg.SurchargeCheckbox().Click();

                //issueInvoice_issueInvoicePage_totalValue.checkValueContains = @amountGst
                IssueInvoicePg.SendInvoiceBTN().Click();
                Console.WriteLine("InvoiceCreated");
                SeleniumSetMethods.WaitOnPage(secdelay7);
                HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);



                loginPage.UserNameTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                loginPage.LoginButton().Click();

                SeleniumSetMethods.WaitOnPage(secdelay7);

                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                PayNowPage      PayNwPg        = new PayNowPage(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("PEDCC@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay6);
                Recpg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SIVPG1.PayerOfferEarlyPaymentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IssueInvoicePg.NewTotal().SendKeys("319.82");

                DateTime newDate1  = DateTime.Now;
                string   dtString4 = newDate1.ToString("dd/MM/yyyy");

                SIVPG1.OfferExpiry().Clear();
                SIVPG1.OfferExpiry().SendKeys(dtString4);
                SIVPG1.Comments().SendKeys("Payer request to Offer Early Payment");
                SIVPG1.offerEarlyPaymentModalBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay6);


                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("PEDCC");
                SeleniumSetMethods.WaitOnPage(secdelay10);
                Recpg.InvoiceNumclick().Click();
                SeleniumSetMethods.WaitOnPage(secdelay10);

                string billzyrefnumber = Recpg.BillzyRefResult().Text;

                bool   OfferExpiredIcon = Recpg.OfferExpiredIcon().Displayed;
                String OfferStatus      = Recpg.OfferStatus().Text;

                SeleniumSetMethods.WaitOnPage(secdelay3);
                string OfferExpiredhover = Recpg.Expiredhovertxt().GetAttribute("data-content");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                //Console.WriteLine("OfferExpiredhover" + OfferExpiredhover);
                Assert.IsTrue((OfferExpiredIcon == true) && OfferStatus.Contains("Offer expired") && OfferExpiredhover.Contains("Deal expired on:"));
                Recpg.ActionsMenu().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                bool PAY           = Recpg.PAY().Displayed;
                bool PostInvoice   = Recpg.PostInvoice().Displayed;
                bool VerifyExist   = Recpg.VerifyInvoice().Displayed;
                bool PDFInvoice2   = Recpg.PDFInvoice().Displayed;
                bool deleteoption1 = Recpg.DeleteOption().Displayed;
                bool dealoption    = Recpg.BillzyDealOption().Displayed;
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(VerifyExist == true && PDFInvoice2 == true && deleteoption1 == true && dealoption == true && PostInvoice == true && PAY == true);
                Recpg.SearchedFirstRowDetailsLink().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                string invnumber     = SIVPG1.InvNumber().Text;
                string invoicenumber = invnumber.Substring(invnumber.IndexOf("Invoice ")).Replace("Invoice ", "");
                SIVPG1.PayerVerifyBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                String Verifiedmsg = SIVPG1.VerifiedTextMsg().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(Verifiedmsg.Contains("You verified this invoice on"));
                SIVPG1.ToggleDealHistory().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                String discounthiststatus = SIVPG1.DiscountHistoryStatus01().Text;
                String Discounthistamount = SIVPG1.DiscountHistoryAmount01().Text;
                bool   paybutton          = SIVPG1.PayButtonNoDeal().Displayed;
                String PayButtonNoDealTxt = SIVPG1.PayButtonNoDeal().Text;
                // bool Paybuttondealhist = SIVPG1.PayButton().Isd;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(discounthiststatus.Contains("SENT") && paybutton == true && PayButtonNoDealTxt.Contains("PAY $351.80 (incl. GST)"));
                SIVPG1.PayButtonNoDeal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                PayNowPage paypg = new PayNowPage(WebDriver);
                paypg.Row01SelectCard().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                paypg.CardRow03().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);

                paypg.ConfirmPaymentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                paypg.DoneBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Recpg.ReceivedHistoryBTN().Click();

                Recpg.SearchInvoiceReceived().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Recpg.SearchInvoiceReceived().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Recpg.SearchInvoiceReceived().SendKeys(invoicenumber);
                SeleniumSetMethods.WaitOnPage(secdelay6);
                string refnum = Recpg.BillzyInvoiceNumRow01().Text;

                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(refnum.Contains(billzyrefnumber));
                bool   OfferExpiredIcon1 = Recpg.HistOfferIcon().Displayed;
                String OfferStatus1      = Recpg.HistOfferstatus().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(OfferExpiredIcon1 == true && OfferStatus1.Contains("Offer expired"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                loginPage.UserNameTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                loginPage.LoginButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                HomePg.SentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SentHistoryBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SearchInvoiceSent().SendKeys(invoicenumber);
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SendPg.SearchedFirstRowDetailsLink().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                String INVstatus  = SIVPG1.VerifiedMsgstatus().Text;
                String Paidstatus = SIVPG1.PaidStatus().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Console.WriteLine("INVstatus:" + INVstatus + "Paidstatus:" + Paidstatus);
                Assert.IsTrue(INVstatus.Contains("VERIFIED") && Paidstatus.Contains("PAID"));
                SIVPG1.ToggleDealHistory().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);

                SIVPG1.ReturnBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                bool   OfferExpiredIcon2 = Recpg.HistOfferIcon().Displayed;
                String OfferStatus2      = Recpg.HistOfferstatus().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(OfferExpiredIcon2 == true && OfferStatus2.Contains("Offer expired"));
                //HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay7);
            }
            finally
            {
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.SignOutBTN().Click();
            }
        }
Esempio n. 3
0
        public void Payway01_SettlementReportDisplay()
        {
            HomePage  HomePg    = new HomePage(WebDriver);
            LoginPage loginPage = new LoginPage(WebDriver);
            BOBOPage  Bobopg    = new BOBOPage(WebDriver);

            try
            {
                WebDriver.Manage().Window.Maximize();
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home");

                SendPage        SendPg         = new SendPage(WebDriver);
                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                loginPage.UserNameTextBox().Click();
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay8);
                IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver);
                IssueInvoicePg.IssueInvoiceButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);

                IWebElement     bodyTag       = WebDriver.FindElement(By.TagName("body"));
                AddCustomerPage AddCustomerPg = new AddCustomerPage(WebDriver);
                Random          rand          = new Random();
                DateTime        dt            = new DateTime();
                string          dtString      = dt.ToString("MM/dd/yyyy HH:mm:ss");
                int             randnumber1   = rand.Next();
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("madcowpayer+dealppp01");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                String PaymentTerms = "30 days";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.CreateInvoice().Click();
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("Inv-67.1" + randnumber1);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer");
                IssueInvoicePg.LineItemAmount().SendKeys("67.1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent");
                IssueInvoicePg.SurchargeCheckbox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SearchInvoiceSent().SendKeys("Inv-67.1" + randnumber1);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                string invnumber1     = SIVPG1.InvNumber().Text;
                string invoicenumber1 = invnumber1.Substring(invnumber1.IndexOf("Invoice ")).Replace("Invoice ", "");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                WebDriver.Manage().Window.Maximize();
                WebDriver.Navigate().GoToUrl("https://4impact-billzy-bobo-ui-uat.s3-ap-southeast-2.amazonaws.com/poc.html");

                Bobopg.Username().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Bobopg.Username().SendKeys("*****@*****.**");
                Bobopg.Password().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Bobopg.Password().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Bobopg.LoginBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay10);
                string textcheck = Bobopg.UserWelcomeMessage().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(textcheck.Contains("Welcome, [email protected]"));
                Bobopg.PaywayTabSelection().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Bobopg.MatchButton1().Click();;
                SeleniumSetMethods.WaitOnPage(secdelay5);

                Bobopg.MatchButtonCancel().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Bobopg.MatchButton1().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                IWebElement MarkAsPaidInv = WebDriver.FindElement(By.XPath("(//*[@id=\"" + invoicenumber1 + "\"])[1]"));
                SeleniumSetMethods.WaitOnPage(secdelay3);
                MarkAsPaidInv.Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                IAlert alert1 = WebDriver.SwitchTo().Alert();
                alert1.Accept();
                SeleniumSetMethods.WaitOnPage(3);

                Bobopg.MatchButtonOk().Click();
            }
            finally
            {
            }
        }
        public void IssueInvoice05_ExternalPayer_CreateInvoice_NoGST_Surcharge_EndOfNextMonth()
        {
            HomePage HomePg = new HomePage(WebDriver);

            try
            {
                WebDriver.Manage().Window.Maximize();
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home");
                LoginPage       loginPage      = new LoginPage(WebDriver);
                SendPage        SendPg         = new SendPage(WebDriver);
                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                loginPage.UserNameTextBox().Click();
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay8);
                IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver);
                IssueInvoicePg.IssueInvoiceButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);

                IWebElement     bodyTag       = WebDriver.FindElement(By.TagName("body"));
                AddCustomerPage AddCustomerPg = new AddCustomerPage(WebDriver);
                Random          rand          = new Random();
                DateTime        dt            = new DateTime();
                string          dtString      = dt.ToString("MM/dd/yyyy HH:mm:ss");
                int             randnumber1   = rand.Next();

                DateTime duedate1       = DateTime.Today.AddDays(30);
                string   SentPgDueDate  = duedate1.ToString("dd MMM yy");
                string   SentPgDueDate1 = duedate1.ToString("dd/MM/yyyy");
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("External1");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                String PaymentTerms = "End of next month";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.CreateInvoice().Click();
                bool due = bodyTag.Text.Contains(SentPgDueDate1);

                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("Ext-Inv@" + randnumber1);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer");
                IssueInvoicePg.LineItemAmount().SendKeys("1000");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent");

                SeleniumSetMethods.WaitOnPage(secdelay2);
                string subject     = IssueInvoicePg.Subject().GetAttribute("value");
                string TotalGSTMsg = IssueInvoicePg.TotalGSTMsg().Text;
                string TotalValue  = IssueInvoicePg.TotalValue().Text;


                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(subject.Contains("madcowtesting10+anogstbiller has sent you an invoice") && TotalGSTMsg.Contains("(excl. GST)") && TotalValue.Contains("$1,000.00"));
                IssueInvoicePg.SurchargeCheckbox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SearchInvoiceSent().SendKeys("Ext-Inv@" + randnumber1);
                SeleniumSetMethods.WaitOnPage(secdelay2);

                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
            }
            finally
            {
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.SignOutBTN().Click();
            }
        }