예제 #1
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 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();
            }
        }
        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 ClientManagement01_TOM()
        {
            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().Clear();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.UserNameTextBox().SendKeys("*****@*****.**");
                loginPage.PasswordTextBox().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                loginPage.PasswordTextBox().SendKeys("Cognito1");
                loginPage.LoginButton().Click();
                SeleniumSetMethods   SetMethods = new SeleniumSetMethods(WebDriver);
                ClientManagementPage clientpg   = new ClientManagementPage(WebDriver);
                SeleniumSetMethods.WaitOnPage(secdelay7);
                CardPage CardPg = new CardPage(WebDriver);

                SendPage        SendPg         = new SendPage(WebDriver);
                ReceivedPage    Recpg          = new ReceivedPage(WebDriver);
                BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver);
                SIVPage         SIVPG1         = new SIVPage(WebDriver);
                HomePg.Profile().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                clientpg.AddCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                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;
                string   SentPgDueDate = duedate1.ToString("yyMMMdd");
                string   today         = duedate1.ToString("dd/MM/yyyy");
                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("1X ");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool data12 = bodyTag.Text.Contains("No similar Billzy businesses found.");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(data12 == true);

                AddCustomerPg.BusinessName().Click();
                AddCustomerPg.BusinessName().Clear();
                AddCustomerPg.BusinessName().SendKeys("1XZ ");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool data13 = bodyTag.Text.Contains("No similar Billzy businesses found.");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(data13 == true);


                AddCustomerPg.BusinessName().SendKeys("CM01-" + randnumber1);
                AddCustomerPg.Abn().SendKeys("10987654321");
                AddCustomerPg.ContactName().SendKeys("Test@" + randnumber1);
                AddCustomerPg.ContactEmail().SendKeys("madcowtesting10 + " + 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(secdelay3);
                AddCustomerPg.SelectCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.EditCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.EditBusinessName().SendKeys("CM01-" + randnumber1 + "edit");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.SaveCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IWebElement bodyTag1 = WebDriver.FindElement(By.TagName("body"));
                bool        edit     = bodyTag1.Text.Contains("CM01-" + randnumber1 + "edit");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(edit == true);
                AddCustomerPg.RemoveCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.ConfirmRemoveCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                clientpg.AddCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay2);
                AddCustomerPg.BusinessName().Click();
                AddCustomerPg.BusinessName().SendKeys("madco");
                SeleniumSetMethods.WaitOnPage(secdelay3);

                IWebElement bodyTag0 = WebDriver.FindElement(By.TagName("body"));
                SeleniumSetMethods.WaitOnPage(secdelay3);
                bool data14 = bodyTag0.Text.Contains("10 similar Billzy businesses found.");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(data14 == true);
                AddCustomerPg.SelectCustomerlist().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.AddBTN().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);

                bool billzylogo = clientpg.BillzyLogoIdentifier().Displayed;
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(billzylogo == true);
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.SelectCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.RemoveCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                AddCustomerPg.ConfirmRemoveCustomer().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                //Show TOM score on member settings page
                TOM tompg = new TOM(WebDriver);
                tompg.TOMicon().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                IWebElement bodyTag2 = WebDriver.FindElement(By.TagName("body"));
                bool        tom1     = bodyTag2.Text.Contains("TOM (Trust Our Member)");
                bool        tom2     = bodyTag2.Text.Contains("Your TOM score is calculated based on a range of weighted factors, which are measured during your membership.");
                bool        tom3     = bodyTag2.Text.Contains("Interactions with other members, utilising cash flow optimising products billzy Cash or Deal and concluding business within the invoice terms will result in a healthy growth of your TOM score.");
                bool        tom4     = bodyTag2.Text.Contains("A lack of interaction with other members, paying invoices late and infrequent use of invoicing will result in a lower TOM score.");
                bool        tom5     = bodyTag2.Text.Contains("Getting a higher TOM score can mean lower rates for Cash and access to other offers from time to time.");
                bool        tom6     = bodyTag2.Text.Contains("TOM Score");
                bool        tom7     = bodyTag2.Text.Contains("Member Since");
                //string tom8 = tompg.Memnbershipdate().Text;
                //string tom9 = tompg.TOMScore().Text;
                SeleniumSetMethods.WaitOnPage(secdelay3);
                Assert.IsTrue(tom1 == true && tom2 == true && tom3 == true && tom4 == true && tom5 == true && tom6 == true && tom7 == true);
                //Action action = new Action(WebDriver);
                //WebDriver.FindElement(TOMinfoIcon())
                tompg.TOMinfoIcon().Click();
                SeleniumSetMethods.WaitOnPage(secdelay3);
                WebDriver.PageSource.Contains("22/10/2019");
                WebDriver.PageSource.Contains("0/100");
                IWebElement bodyTag3 = WebDriver.FindElement(By.TagName("body"));
                WebDriver.PageSource.Contains("A new member typically starts with a score of 24.");
                WebDriver.PageSource.Contains("As your time as a member increases and you interact with others in the community, your score will increase.");
                WebDriver.PageSource.Contains("A higher score makes other members more likely to do business with you");
                WebDriver.PageSource.Contains("A higher score also gives you access to lower rates for Cash and other special benefits from time to time.");
                WebDriver.PageSource.Contains("Raising invoices and paying them on time increases the score.");
                WebDriver.PageSource.Contains("So does using the billzy cashflow management tools such as paying by card, billzy Deal and billzy Cash.");
                WebDriver.PageSource.Contains("Paying late or raising invoices that do not get paid will lower it.");
                SeleniumSetMethods.WaitOnPage(secdelay3);
                WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received");
                SeleniumSetMethods.WaitOnPage(secdelay2);
                HomePg.SignOutBTN().Click();
            }
            finally
            {
            }
        }