public override void StepBody() { System.Threading.Thread.Sleep(1000); AddCustomerPage addCustomer = PageFactory.Init <AddCustomerPage>(); addCustomer.editFirstName.Text = firstName; addCustomer.editLastName.Text = lastName; addCustomer.editPostCode.Text = postCode; addCustomer.buttonSubmit.Click(); addCustomer.Driver.SwitchTo().Alert().Accept(); }
public void TestAddNewCustomer() { bankManagerMenu = home.buttonBankManagerLogin.ClickAndWaitFor <BankManagerCommonPage>(); customers = bankManagerMenu.buttonCustomers.ClickAndWaitFor <CustomersPage>(); Assert.True(customers.tableCustomers.IsNotEmpty()); int rows = customers.tableCustomers.ItemsCount; addCustomer = customers.buttonAddCustomer.ClickAndWaitFor <AddCustomerPage>(); Assert.True(addCustomer.AllElementsExist( new Control[] { addCustomer.editFirstName, addCustomer.editLastName, addCustomer.editPostCode, addCustomer.buttonSubmit }) ); Assert.True(addCustomer.AnyOfElementsExist(new Control[] { addCustomer.editFirstName, addCustomer.editLastName, addCustomer.editPostCode, addCustomer.buttonSubmit })); System.Threading.Thread.Sleep(1000); addCustomer.editFirstName.Text = "Test"; addCustomer.editLastName.Text = "User"; addCustomer.editPostCode.Text = "WWW99"; addCustomer.buttonSubmit.Click(); addCustomer.Driver.SwitchTo().Alert().Accept(); customers = addCustomer.buttonCustomers.ClickAndWaitFor <CustomersPage>(); Assert.AreEqual(rows + 1, customers.tableCustomers.ItemsCount); Assert.AreEqual("Test", customers.tableCustomers["First Name", rows].Text); Assert.AreEqual("User", customers.tableCustomers["Last Name", rows].Text); Assert.AreEqual("WWW99", customers.tableCustomers["Post Code", rows].Text); customers.tableCustomers["Delete Customer", rows].Click(); Assert.True(customers.tableCustomers.IsNotEmpty()); Assert.AreEqual(rows, customers.tableCustomers.ItemsCount); }
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 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(); } }
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 IssueInvoice01_ExternalPayer_UploadInvoice_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); 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(); IssueInvoicePg.IssueInvoiceButton().Click(); SeleniumSetMethods.WaitOnPage(secdelay3); IssueInvoicePg.BusinessName().Click(); SeleniumSetMethods.WaitOnPage(secdelay1); IssueInvoicePg.BusinessName().SendKeys("External1"); SeleniumSetMethods.WaitOnPage(secdelay1); IssueInvoicePg.SelectBusiness().Click(); SeleniumSetMethods.WaitOnPage(secdelay3); String PaymentTerms = "14 days"; IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms); SeleniumSetMethods.WaitOnPage(secdelay3); IssueInvoicePg.PdfUploadFileBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); bool gstmsg = IssueInvoicePg.GstValue().Displayed; SeleniumSetMethods.WaitOnPage(secdelay2); Assert.IsTrue(gstmsg == false); IssueInvoicePg.SendInvoiceBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); IWebElement bodyTag = WebDriver.FindElement(By.TagName("body")); bool err1 = bodyTag.Text.Contains("Please upload a PDF File"); bool err2 = bodyTag.Text.Contains("Invoice total must be greater than zero"); SeleniumSetMethods.WaitOnPage(secdelay2); Assert.IsTrue(err1 == true && err2 == true); IssueInvoicePg.PdfUploadFileBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.uploadPDF().SendKeys(@"C:\Users\Selenium\Desktop\SeleniumRegressionSuite_Bamboo\Invoice.pdf"); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.UploadAmount().SendKeys("123.19"); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms); IssueInvoicePg.UploadInvRef().SendKeys("Ext-Inv@" + randnumber1); IssueInvoicePg.Message().SendKeys("Test invoice has been sent"); string subject = IssueInvoicePg.Subject().GetAttribute("value"); SeleniumSetMethods.WaitOnPage(secdelay2); Assert.IsTrue(subject.Contains("madcowtesting10+aagstbiller has sent you an invoice")); IssueInvoicePg.SendInvoiceBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); SendPg.SearchInvoiceSent().SendKeys("Ext-Inv@" + randnumber1); SeleniumSetMethods.WaitOnPage(secdelay10); IWebElement bodyTag4 = WebDriver.FindElement(By.TagName("body")); SeleniumSetMethods.WaitOnPage(secdelay3); Console.WriteLine(bodyTag4.Text); 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 IssueInvoice09_InternalPayer_UploadInvoice_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.PdfUploadFileBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.uploadPDF().SendKeys(@"C:\Users\Selenium\Desktop\SeleniumRegressionSuite_Bamboo\bin\Debug\netcoreapp3.1\Invoice.pdf"); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.UploadAmount().SendKeys("1212.11"); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms); IssueInvoicePg.UploadInvRef().SendKeys("Int-Inv@" + randnumber1); 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+IntPayUploadInvNoGST has sent you an invoice")); DateTime duedate2 = DateTime.Today.AddDays(30); string SentPgDueDate3 = duedate2.ToString("dd MMM yy"); string SentPgDueDate33 = duedate2.ToString("dd/MM/yyyy"); IssueInvoicePg.Uploadsurcharge().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); SeleniumSetMethods.WaitOnPage(secdelay2); WebDriver.Navigate().GoToUrl("https://demo.billzy.com/received"); SeleniumSetMethods.WaitOnPage(secdelay4); HomePg.SignOutBTN().Click(); } finally { } }
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 Payway01_SettlementReportDisplay() { HomePage HomePg = new HomePage(WebDriver); LoginPage loginPage = new LoginPage(WebDriver); BOBOPage Bobopg = new BOBOPage(WebDriver); try { WebDriver.Manage().Window.Maximize(); WebDriver.Navigate().GoToUrl("https://demo.billzy.com/home"); SendPage SendPg = new SendPage(WebDriver); ReceivedPage Recpg = new ReceivedPage(WebDriver); BillzyCashModal BillzyCashMlPg = new BillzyCashModal(WebDriver); SIVPage SIVPG1 = new SIVPage(WebDriver); loginPage.UserNameTextBox().Click(); loginPage.UserNameTextBox().SendKeys("*****@*****.**"); loginPage.PasswordTextBox().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); loginPage.PasswordTextBox().SendKeys("Cognito1"); SeleniumSetMethods.WaitOnPage(secdelay2); loginPage.LoginButton().Click(); SeleniumSetMethods SetMethods = new SeleniumSetMethods(WebDriver); SeleniumSetMethods.WaitOnPage(secdelay8); IssueInvoicePage IssueInvoicePg = new IssueInvoicePage(WebDriver); IssueInvoicePg.IssueInvoiceButton().Click(); SeleniumSetMethods.WaitOnPage(secdelay3); IWebElement bodyTag = WebDriver.FindElement(By.TagName("body")); AddCustomerPage AddCustomerPg = new AddCustomerPage(WebDriver); Random rand = new Random(); DateTime dt = new DateTime(); string dtString = dt.ToString("MM/dd/yyyy HH:mm:ss"); int randnumber1 = rand.Next(); IssueInvoicePg.BusinessName().Click(); SeleniumSetMethods.WaitOnPage(secdelay1); IssueInvoicePg.BusinessName().SendKeys("madcowpayer+dealppp01"); SeleniumSetMethods.WaitOnPage(secdelay1); IssueInvoicePg.SelectBusiness().Click(); SeleniumSetMethods.WaitOnPage(secdelay3); String PaymentTerms = "30 days"; IssueInvoicePg.PaymentTerms().SendKeys(PaymentTerms); IssueInvoicePg.CreateInvoice().Click(); IssueInvoicePg.InvoiceReferenceCreate().SendKeys("Inv-67.1" + randnumber1); IssueInvoicePg.Description().SendKeys("Test Invoice issued to External Payer"); IssueInvoicePg.LineItemAmount().SendKeys("67.1"); SeleniumSetMethods.WaitOnPage(secdelay2); IssueInvoicePg.Message().SendKeys("Test invoice has been sent"); IssueInvoicePg.SurchargeCheckbox().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); IssueInvoicePg.SendInvoiceBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); SendPg.SearchInvoiceSent().SendKeys("Inv-67.1" + randnumber1); SeleniumSetMethods.WaitOnPage(secdelay2); SendPg.BillzyRefResult().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); string invnumber1 = SIVPG1.InvNumber().Text; string invoicenumber1 = invnumber1.Substring(invnumber1.IndexOf("Invoice ")).Replace("Invoice ", ""); SeleniumSetMethods.WaitOnPage(secdelay3); HomePg.SignOutBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); WebDriver.Manage().Window.Maximize(); WebDriver.Navigate().GoToUrl("https://4impact-billzy-bobo-ui-uat.s3-ap-southeast-2.amazonaws.com/poc.html"); Bobopg.Username().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); Bobopg.Username().SendKeys("*****@*****.**"); Bobopg.Password().Click(); SeleniumSetMethods.WaitOnPage(secdelay2); Bobopg.Password().SendKeys("Cognito1"); SeleniumSetMethods.WaitOnPage(secdelay2); Bobopg.LoginBTN().Click(); SeleniumSetMethods.WaitOnPage(secdelay10); string textcheck = Bobopg.UserWelcomeMessage().Text; SeleniumSetMethods.WaitOnPage(secdelay2); Assert.IsTrue(textcheck.Contains("Welcome, [email protected]")); Bobopg.PaywayTabSelection().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); Bobopg.MatchButton1().Click();; SeleniumSetMethods.WaitOnPage(secdelay5); Bobopg.MatchButtonCancel().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); Bobopg.MatchButton1().Click(); SeleniumSetMethods.WaitOnPage(secdelay5); IWebElement MarkAsPaidInv = WebDriver.FindElement(By.XPath("(//*[@id=\"" + invoicenumber1 + "\"])[1]")); SeleniumSetMethods.WaitOnPage(secdelay3); MarkAsPaidInv.Click(); SeleniumSetMethods.WaitOnPage(secdelay5); IAlert alert1 = WebDriver.SwitchTo().Alert(); alert1.Accept(); SeleniumSetMethods.WaitOnPage(3); Bobopg.MatchButtonOk().Click(); } finally { } }
public void 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(); } }
protected override void ShowAddEntity() { var window = new AddCustomerPage(); window.ShowDialog(); }
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 { } }