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
            {
            }
        }
示例#2
0
        public void InvoiceWithDeal02_NoGST_Overdue_Processing_DD()
        {
            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();
                IssueInvoicePg.BusinessName().SendKeys("PayNoGST");
                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();

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


                IssueInvoicePg.LineItemAmount().SendKeys("400.82");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent to internal payer excluding GST");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BillzyDealBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.NewTotal().SendKeys("319.82");
                SeleniumSetMethods.WaitOnPage(secdelay1);

                IssueInvoicePg.OfferExpiry().Clear();
                IssueInvoicePg.OfferExpiry().SendKeys(dtString3);
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.Comments().SendKeys("Biller created deal");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SurchargeCheckbox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                Console.WriteLine("InvoiceCreated");
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SendPg.SearchInvoiceSent().SendKeys("OverDueInvoice2_@" + randnumber2);
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SendPg.ActionsMenu().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(secdelay7);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("OverDueInvoice2");
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchedFirstRowDetailsLink().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                string invnumber     = SIVPG1.InvNumber().Text;
                string invoicenumber = invnumber.Substring(invnumber.IndexOf("Invoice ")).Replace("Invoice ", "");
                SIVPG1.ToggleDealHistory().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                string dealsts = SIVPG1.DiscountHistoryStatus01().Text;
                string amount  = SIVPG1.PayButtonNoDeal().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(dealsts.Contains("RECEIVED") && amount.Contains("PAY $400.82 (excl. GST)"));

                SIVPG1.PayerVerifyBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                SIVPG1.ReturnBTN().Click();
                Recpg.SearchInvoiceReceived().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Recpg.SearchInvoiceReceived().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Recpg.SearchInvoiceReceived().SendKeys(invoicenumber);
                SeleniumSetMethods.WaitOnPage(secdelay4);
                Recpg.ActionsMenu().Click();
                Recpg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);

                SIVPG1.PayBTNNoDeal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                PayNowPage Paynwpg = new PayNowPage(WebDriver);
                Paynwpg.Row01SelectCard().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Paynwpg.CardRow02().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                IWebElement bodyTag = WebDriver.FindElement(By.TagName("body"));


                string amount1 = Paynwpg.Row01AmountPayable().GetAttribute("value");
                bool   siv2    = bodyTag.Text.Contains("Includes 1.67% surcharge");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(amount1.Contains("400.82") && siv2 == false);
                Paynwpg.ConfirmPaymentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Paynwpg.DoneBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Recpg.ReceivedHistoryBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys(invoicenumber);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                string paidstatushover = Recpg.HistoryProcessingStatus().GetAttribute("data-title");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(paidstatushover.Contains("processing"));
                Recpg.SearchedFirstRowDetailsLink().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                String status2 = SIVPG1.InvoiceStatus().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(status2.Contains("PROCESSING"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.SignOutBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                loginPage.UserNameTextBox().Click();
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                loginPage.LoginButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                SendPg.SentBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                SendPg.SentHistoryBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SendPg.SearchInvoiceSent().SendKeys(invoicenumber);
                SeleniumSetMethods.WaitOnPage(secdelay7);
                string paidstatushover1 = SendPg.HistoryProcessingStatus().GetAttribute("data-title");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(paidstatushover1.Contains("processing"));
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                string dealmsg    = SendPg.SIVProcessingStatus().Text;
                string invref     = SIVPG1.InvoiceDetailsInvoiceRef().Text;
                string paidamount = SIVPG1.InvoiceDetailsInvoiceAmount().Text;

                Assert.IsTrue(dealmsg.Contains("PROCESSING") && invref.Contains("OverDue") && paidamount.Contains("$400.82"));
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.SignOutBTN().Click();
            }
            finally
            {
            }
        }
示例#3
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();
            }
        }