public void IssueInvoice06_InternalPayer_CreateInvoice_NoGST_Deal_Surcharge()
        {
            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();
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("madcowtesting10+A");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                String PaymentTerms = "90 days";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.CreateInvoice().Click();
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("Int-Inv@" + randnumber1);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer");
                IssueInvoicePg.LineItemAmount().SendKeys("1089.29");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent to internal payer");
                string subject     = IssueInvoicePg.Subject().GetAttribute("value");
                string TotalGSTMsg = IssueInvoicePg.TotalGSTMsg().Text;
                string TotalValue  = IssueInvoicePg.TotalValue().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(subject.Contains("madcowtesting10+IntPayCreateInvNOGST has sent you an invoice") && TotalGSTMsg.Contains("(excl. GST)") && TotalValue.Contains("$1,089.29"));
                IssueInvoicePg.BillzyDealBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.NewTotal().SendKeys("925.12");
                IssueInvoicePg.Comments().SendKeys("Deal is being offered excluding GST");
                IWebElement bodyTag1 = WebDriver.FindElement(By.TagName("body"));
                bool        disc1    = bodyTag1.Text.Contains("15.07% discount");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(disc1 == true);
                //IssueInvoicePg.NewTotal().Click();
                //SeleniumSetMethods.WaitOnPage(secdelay2);
                //IssueInvoicePg.NewTotal().Clear();
                //SeleniumSetMethods.WaitOnPage(secdelay2);
                //IssueInvoicePg.NewTotal().SendKeys("900");
                //SeleniumSetMethods.WaitOnPage(secdelay2);
                //bool disc2 = bodyTag1.Text.Contains("17.38% discount");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                bool disc3 = bodyTag1.Text.Contains("Due in 90 days");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(disc3 == true);
                DateTime duedate2        = DateTime.Today.AddDays(19);
                string   SentPgDueDate3  = duedate2.ToString("dd MMM yy");
                string   SentPgDueDate33 = duedate2.ToString("dd/MM/yyyy");
                IssueInvoicePg.OfferExpiry().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.OfferExpiry().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.OfferExpiry().SendKeys(SentPgDueDate33);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.NewTotal().Click();
                bool dis4 = bodyTag1.Text.Contains("Due in 19 days");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(dis4 == true);
                IssueInvoicePg.SurchargeCheckbox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);

                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);

                SendPg.SearchInvoiceSent().SendKeys("Int-Inv@" + randnumber1);

                SeleniumSetMethods.WaitOnPage(secdelay2);
                string due11 = SendPg.DueRow01().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(due11.Contains(SentPgDueDate3));
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
            }
            finally
            {
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.SignOutBTN().Click();
            }
        }
예제 #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
            {
            }
        }
        public void IssueInvoice02_InternalPayer_CreateInvoice_2LineItems_GST_Deal_N0Surcharge_WithHTMLTagsValues()
        {
            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();
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("madcowtesting10+A");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                String PaymentTerms = "60 days";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.CreateInvoice().Click();
                string invref = "script > alert(\"Hello\");</ script >";
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys(invref);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer");
                IssueInvoicePg.LineItemAmount().SendKeys("299.10");

                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.Message().SendKeys(invref);
                string subject     = IssueInvoicePg.Subject().GetAttribute("value");
                string TotalGSTMsg = IssueInvoicePg.TotalGSTMsg().Text;
                string TotalValue  = IssueInvoicePg.TotalValue().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(subject.Contains("madcowtesting10+IntPayCreateInv has sent you an invoice") && TotalGSTMsg.Contains("(incl. GST)") && TotalValue.Contains("$329.01"));
                IssueInvoicePg.BillzyDealBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.NewTotal().SendKeys("200");
                IssueInvoicePg.Comments().SendKeys(invref);
                IWebElement bodyTag1 = WebDriver.FindElement(By.TagName("body"));
                bool        disc1    = bodyTag1.Text.Contains("39.21% discount");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(disc1 == true);
                bool disc2 = bodyTag1.Text.Contains("Due in 60 days");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(disc2 == true);
                // IssueInvoicePg.SurchargeCheckbox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                IWebElement bodyTag2 = WebDriver.FindElement(By.TagName("body"));
                bool        err23    = bodyTag2.Text.Contains("Unfortunately there was an internal system error. Please try again in 2 minutes or contact Billzy support.");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(err23 == true);
                IssueInvoicePg.InvoiceReferenceCreate().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.InvoiceReferenceCreate().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("Int-Inv@" + randnumber1);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SearchInvoiceSent().SendKeys("Int-Inv@" + randnumber1);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SIVPG1.ToggleDealHistory().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);

                //string invref1 = "script>alert(\"Hello\")";
                string commvalue = SIVPG1.DiscountHistoryComment01().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(commvalue.Contains(invref));
            }
            finally
            {
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
                HomePg.SignOutBTN().Click();
            }
        }
예제 #4
0
        public void EXPDeal02_PayerBillerView_WithDeal_DealBillerInitiated_ExcludingGST_Surcharge_PayDD()
        {
            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();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                loginPage.LoginButton().Click();
                SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay7);
                IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver);
                SendPage         SendPg         = new SendPage(WebDriver);
                ReceivedPage     Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal  BillzyCashMlPg = new BillzyCashModal(WebDriver);
                PayNowPage       PayNwPg        = new PayNowPage(WebDriver);
                SIVPage          SIVPG1         = new SIVPage(WebDriver);
                IssueInvoicePg.IssueInvoiceButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("payernogst01");
                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 = "90 days";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.DueDate().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IssueInvoicePg.DueDate().Clear();
                IssueInvoicePg.DueDate().SendKeys(dtString3);
                IssueInvoicePg.CreateInvoice().Click();
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("ExpiredDealDD_01" + randnumber2);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to Internal Payer");

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

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

                IssueInvoicePg.OfferExpiry().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.OfferExpiry().SendKeys(dtString4);
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.Comments().SendKeys("Deal is being offered including GST");

                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(("ExpiredDealDD_01" + randnumber2));
                SeleniumSetMethods.WaitOnPage(secdelay4);
                SendPg.BillzyRefResult().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                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);
                HomePg.ReceivedBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                Recpg.SearchInvoiceReceived().SendKeys("ExpiredDealDD_01");
                SeleniumSetMethods.WaitOnPage(secdelay6);

                Recpg.DueColumn().Click();
                SeleniumSetMethods.WaitOnPage(secdelay6);
                string billzyrefnumber = Recpg.BillzyRefResult().Text;

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

                SeleniumSetMethods.WaitOnPage(secdelay1);
                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;

                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(VerifyExist == true && PDFInvoice2 == true && deleteoption1 == 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("RECEIVED") && Discounthistamount.Contains("319.82") && paybutton == true && PayButtonNoDealTxt.Contains("PAY $400.82 (excl. GST)"));
                Assert.IsTrue(Discounthistamount.Contains("319.82") && paybutton == true && PayButtonNoDealTxt.Contains("PAY $400.82 (excl. GST)"));
                SIVPG1.PayButtonNoDeal().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                PayNowPage paypg = new PayNowPage(WebDriver);
                paypg.Row01SelectCard().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                paypg.CardRow02().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                string amount = paypg.Row01AmountPayable().GetAttribute("value");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(amount.Contains("400.82"));
                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(secdelay5);
                string refnum     = Recpg.BillzyInvoiceNumRow01().Text;
                string amountpaid = Recpg.AmountRowProcess1().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(refnum.Contains(billzyrefnumber) && amountpaid.Contains("$400.82"));
                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("PROCESSING"));
                Assert.IsTrue(Paidstatus.Contains("PROCESSING"));
                SIVPG1.ToggleDealHistory().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                String discounthiststatus1 = SendPg.SentDealhistorystatus().Text;
                String Discounthistamount1 = SIVPG1.DiscountHistoryAmount01().Text;
                Assert.IsTrue(discounthiststatus1.Contains("SENT") && Discounthistamount1.Contains("319.82"));
                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();
            }
        }