public void IssueInvoice09_InternalPayer_CreateInvoice_NoGST_NoDeal_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();
                IssueInvoicePg.BusinessName().Click();
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.BusinessName().SendKeys("madcowtesting10+A");
                SeleniumSetMethods.WaitOnPage(secdelay1);
                IssueInvoicePg.SelectBusiness().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                String PaymentTerms = "End of next month";
                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("185.25");
                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("$185.25"));
                IssueInvoicePg.SurchargeCheckbox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay5);
                SendPg.SearchInvoiceSent().SendKeys("Int-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();
            }
        }
        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();
            }
        }
        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();
            }
        }
Exemplo n.º 4
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
            {
            }
        }
Exemplo n.º 5
0
        public void Postman02_BillzyUserCreation_IssueInvoice()
        {
            //New user creation
            HomePage HomePg = new HomePage(WebDriver);

            try
            {
                Random   rand        = new Random();
                DateTime dt          = new DateTime();
                string   dtString    = dt.ToString("MM/dd/yyyy HH:mm:ss");
                int      randnumber1 = rand.Next();


                string xmlMessage  = @"<BillzyBusiness>
            <businessName>madcowtesting10+anogstbiller02</businessName>
            <qvalentSubMerchantName>madcowtesting10+anogstbiller02</qvalentSubMerchantName>
            <businessPhone>12345678</businessPhone>
            <businessAddressStreet>370 Queen St</businessAddressStreet>
            <businessAddressSuburb>Brisbane</businessAddressSuburb>
            <businessAddressState>QLD</businessAddressState>
            <businessAddressPostcode>4000</businessAddressPostcode>
            <businessEmail>[email protected]</businessEmail>
            <abn>10987654321</abn>
            <showDebitAccounts>true</showDebitAccounts>
            <gstRegistered>false</gstRegistered>
            <contact>
                <name>madcowtesting10+anogstbiller02</name>
                <email>[email protected]</email>
                <phone>0405028000</phone>
                <loginName>[email protected]</loginName>
            </contact>
            <bankAccount>
                <name>receiveAccount</name>
                <bsb>484799</bsb>
                <accountNumber>65432111</accountNumber>
            </bankAccount>
            <createdByUser>
                <username>[email protected]</username>
                <password>Cognito1</password>
            </createdByUser>
            <referrer>
                <referrerId>1</referrerId>
                <name>[email protected]</name>
            </referrer>
        </BillzyBusiness>";
                string numb        = randnumber1.ToString();
                var    replacement = xmlMessage.Replace("anogstbiller02", numb);
                Console.WriteLine($"The source string is <{xmlMessage}>");
                Console.WriteLine($"The updated string is <{replacement}>");

                string         url     = "https://api.demo.billzy.com/accounts/v1";
                byte[]         bytes   = Encoding.UTF8.GetBytes(replacement);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Method        = "POST";
                request.ContentLength = bytes.Length;
                request.ContentType   = "text/xml";
                using (Stream requestStream = request.GetRequestStream())
                {
                    requestStream.Write(bytes, 0, bytes.Length);
                }
                using (HttpWebResponse response = (HttpWebResponse)
                                                  request.GetResponse())
                {
                    //###Login to biller account
                    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);
                    loginPage.UserNameTextBox().Click();
                    loginPage.UserNameTextBox().SendKeys("madcowtesting10+" + randnumber1 + "@gmail.com");
                    loginPage.PasswordTextBox().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay2);
                    loginPage.PasswordTextBox().SendKeys("Password1");
                    loginPage.LoginButton().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay5);
                    SetPasswordPage setpwdpg = new SetPasswordPage(WebDriver);
                    //initial password setup
                    setpwdpg.Email().SendKeys("madcowtesting10+" + randnumber1 + "@gmail.com");
                    SeleniumSetMethods.WaitOnPage(secdelay3);
                    setpwdpg.TemporaryPassword().SendKeys("Password1");
                    SeleniumSetMethods.WaitOnPage(secdelay2);
                    setpwdpg.NewPassword().SendKeys("Cognito1");
                    SeleniumSetMethods.WaitOnPage(secdelay2);
                    setpwdpg.ConfirmPassword().SendKeys("Cognito1");
                    SeleniumSetMethods.WaitOnPage(secdelay2);
                    setpwdpg.SetYourPasswordBTN().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay5);
                    loginPage.PasswordTextBox().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay2);
                    loginPage.PasswordTextBox().Clear();
                    SeleniumSetMethods.WaitOnPage(secdelay2);
                    loginPage.PasswordTextBox().SendKeys("Cognito1");
                    loginPage.LoginButton().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay5);
                    HomePage hmpg = new HomePage(WebDriver);
                    hmpg.SentBTN().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay5);
                    string noinctxt = SendPg.Noinvoiceavailablemsg().Text;
                    SeleniumSetMethods.WaitOnPage(secdelay5);
                    Assert.IsTrue(noinctxt.Contains("No Invoices Available"));
                    SeleniumSetMethods.WaitOnPage(secdelay4);
                    IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver);
                    IssueInvoicePg.IssueInvoiceButton().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay4);
                    // Issue Invoice

                    AddCustomerPage AddCustomerPg = new AddCustomerPage(WebDriver);
                    AddCustomerPg.AddCustomerButton().Click();
                    AddCustomerPg.BusinessName().Click();
                    AddCustomerPg.BusinessName().SendKeys("ExternalNoGST@" + randnumber1);
                    AddCustomerPg.Abn().SendKeys("12345678910");
                    AddCustomerPg.ContactName().SendKeys("Test@" + randnumber1);
                    AddCustomerPg.ContactEmail().SendKeys("manualtestdemob+" + randnumber1 + "@gmail.com");
                    AddCustomerPg.ContactPhoneNumber().SendKeys("12345671447");
                    AddCustomerPg.Street().SendKeys("10 Miller Street");
                    AddCustomerPg.Suburb().SendKeys("Murarrie");
                    AddCustomerPg.Postcode().SendKeys("4172");
                    AddCustomerPg.AddBTN().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay5);

                    // Invoice Creation @amountGst.default          = $1,000.00
                    IssueInvoicePg.CreateInvoice().Click();
                    IssueInvoicePg.InvoiceReferenceCreate().SendKeys("INVNEW@" + randnumber1);
                    IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer");
                    IssueInvoicePg.LineItemAmount().SendKeys("1010");
                    IssueInvoicePg.Message().SendKeys("Test invoice has been sent");
                    IssueInvoicePg.SendInvoiceBTN().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay7);
                    Console.WriteLine("InvoiceCreated");
                    HomePg.SentBTN().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay7);

                    SendPg.SentOutstandingBTN().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay7);
                    SendPg.SearchInvoiceSent().SendKeys("INVNEW@" + randnumber1);
                    SeleniumSetMethods.WaitOnPage(secdelay10);
                    SendPg.BillzyRefResult().Click();
                    SeleniumSetMethods.WaitOnPage(secdelay4);
                }
            }
            finally
            {
                SeleniumSetMethods.WaitOnPage(secdelay2);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay4);
            }
        }
        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
            {
            }
        }
Exemplo n.º 7
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
            {
            }
        }
Exemplo n.º 8
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();
            }
        }
        public void IssueInvoice07_ExternalPayer_CreateInvoice_NoGST_NoSurcharge_NoAddress()
        {
            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.AddCustomerButton().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.BusinessName().Click();
                AddCustomerPg.BusinessName().SendKeys("ExternalNoAddress@" + randnumber1);
                AddCustomerPg.Abn().SendKeys("12345678910");
                AddCustomerPg.ContactName().SendKeys("Test@" + randnumber1);
                AddCustomerPg.ContactEmail().SendKeys("madcowtesting10+" + randnumber1 + "@gmail.com");
                AddCustomerPg.ContactPhoneNumber().SendKeys("12345671447");

                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);

                SeleniumSetMethods.WaitOnPage(secdelay3);
                String PaymentTerms = "30 days";
                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("185.25");
                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("$185.25"));
                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();
            }
        }
        public void IssueInvoice01_ExternalPayer_CreateInvoice_GST_NoSurcharge()
        {
            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);
                IssueInvoicePg.SendInvoiceBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IWebElement bodyTag = WebDriver.FindElement(By.TagName("body"));
                bool        errmsg1 = bodyTag.Text.Contains("For security reasons you must enter either a street address or ABN.");
                bool        errmsg2 = bodyTag.Text.Contains("You must choose a valid business.");
                bool        data1   = bodyTag.Text.Contains("Business Name");
                bool        data2   = bodyTag.Text.Contains("ABN");
                bool        data3   = bodyTag.Text.Contains("Email");
                bool        data4   = bodyTag.Text.Contains("Street");
                bool        data5   = bodyTag.Text.Contains("Suburb");
                bool        data6   = bodyTag.Text.Contains("Postcode");

                bool data8  = bodyTag.Text.Contains("State");
                bool data9  = bodyTag.Text.Contains("Payment Terms");
                bool data10 = bodyTag.Text.Contains("Due Date");
                bool data11 = bodyTag.Text.Contains("PDF Invoice");
                bool data12 = bodyTag.Text.Contains("Subject");
                bool data13 = bodyTag.Text.Contains("Message");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(errmsg1 == true && errmsg2 == true && data1 == true && data2 == true && data3 == true && data4 == true && data5 == true && data6 == true && data8 == true && data9 == true && data10 == true && data11 == true && data12 == true && data13 == true);
                IssueInvoicePg.AddCustomerButton().Click();
                AddCustomerPage AddCustomerPg = new AddCustomerPage(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Random   rand        = new Random();
                DateTime dt          = new DateTime();
                string   dtString    = dt.ToString("MM/dd/yyyy HH:mm:ss");
                int      randnumber1 = rand.Next();
                bool     data111     = bodyTag.Text.Contains("Business Name");
                bool     data22      = bodyTag.Text.Contains("ABN");
                bool     data33      = bodyTag.Text.Contains("Contact Email");
                bool     data44      = bodyTag.Text.Contains("Street");
                bool     data55      = bodyTag.Text.Contains("Suburb");
                bool     data66      = bodyTag.Text.Contains("Postcode");
                bool     data77      = bodyTag.Text.Contains("Country");
                bool     data88      = bodyTag.Text.Contains("State");
                bool     data99      = bodyTag.Text.Contains("Contact Name");
                bool     data1010    = bodyTag.Text.Contains("Contact Phone Number");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(data111 == true && data22 == true && data33 == true && data44 == true && data55 == true && data66 == true && data77 == true && data88 == true && data99 == true && data1010 == true);
                AddCustomerPg.BusinessName().Click();
                AddCustomerPg.BusinessName().SendKeys("ExternalGST@" + randnumber1);
                AddCustomerPg.Abn().SendKeys("abhushuhuhq");
                AddCustomerPg.ContactName().SendKeys("Test@" + randnumber1);
                AddCustomerPg.ContactEmail().SendKeys("test.com");
                AddCustomerPg.ContactPhoneNumber().SendKeys("12345671447");
                AddCustomerPg.Street().SendKeys("10 Miller Street");
                AddCustomerPg.Suburb().SendKeys("Murarrie");
                AddCustomerPg.Postcode().SendKeys("4172");
                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool errmsg11 = bodyTag.Text.Contains("The value entered was not a valid 11 digit ABN (numbers and spaces only).");
                bool errmsg22 = bodyTag.Text.Contains("The value needs to be a valid email address, e.g. [email protected]");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(errmsg11 == true && errmsg22 == true);
                AddCustomerPg.Abn().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().SendKeys("1111111111");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.ContactEmail().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.ContactEmail().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);

                AddCustomerPg.ContactEmail().SendKeys("madcowtesting10+" + randnumber1 + "@gmail.com");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool errmsg33 = bodyTag.Text.Contains("Invalid ABN length");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(errmsg33 == true);

                AddCustomerPg.Abn().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().SendKeys("111111111111");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool errmsg44 = bodyTag.Text.Contains("Invalid ABN length");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(errmsg44 == true);

                AddCustomerPg.Abn().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().SendKeys("11111111111*");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool errmsg55 = bodyTag.Text.Contains("The value entered was not a valid 11 digit ABN (numbers and spaces only).");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(errmsg44 == true);

                AddCustomerPg.Abn().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.Abn().SendKeys("11 111 111 111");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);



                String PaymentTerms = "14 days";
                IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms);
                IssueInvoicePg.CreateInvoice().Click();
                IssueInvoicePg.InvoiceReferenceCreate().SendKeys("Ext-Inv@" + randnumber1);
                IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer");
                IssueInvoicePg.LineItemAmount().SendKeys("185.12");
                IssueInvoicePg.PreviewInvoice().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                var tabs = WebDriver.WindowHandles;
                if (tabs.Count > 1)
                {
                    WebDriver.SwitchTo().Window(tabs[1]);
                    WebDriver.Close();
                    WebDriver.SwitchTo().Window(tabs[0]);
                }
                SeleniumSetMethods.WaitOnPage(secdelay2);
                IssueInvoicePg.Outside().Click();
                IssueInvoicePg.Message().SendKeys("Test invoice has been sent");
                string subject     = IssueInvoicePg.Subject().GetAttribute("value");
                string TotalGSTMsg = IssueInvoicePg.TotalGSTMsg().Text;
                string TotalValue  = IssueInvoicePg.TotalValue().Text;
                SeleniumSetMethods.WaitOnPage(secdelay2);
                Assert.IsTrue(subject.Contains("madcowtesting10+agstbiller has sent you an invoice") && TotalGSTMsg.Contains("(incl. GST)") && TotalValue.Contains("$203.63"));
                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();
            }
        }