public void verifyAddBtnOfCustomFieldOnMerchantsTeminalTab() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Redirect at merchants page."); VisitOffice("clients"); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on any Merchant"); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Go to Terminals and Equipment tab"); office_ClientsHelper.ClickElement("TerminalsandEquipments"); office_ClientsHelper.WaitForWorkAround(2000); if (office_ClientsHelper.IsElementPresent("//div[@id='Equipment Details1infodiv']/div[1]/a/i") == true) { executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on pencil icon"); office_ClientsHelper.Click("//div[@id='Equipment Details1infodiv']/div[1]/a/i"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on Add button"); office_ClientsHelper.ClickElement("AddCustomBtn"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Verify Create Custom field appeared"); office_ClientsHelper.IsElementPresent("//h3[text()='Create New Custom Field']"); } else { executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on Add Equipment button"); office_ClientsHelper.ClickElement("AddEquipment"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on any Equipment"); office_ClientsHelper.ClickJS("Equipment1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on pencil icon"); office_ClientsHelper.Click("//div[@id='Equipment Details1infodiv']/div[1]/a/i"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Click on Add button"); office_ClientsHelper.ClickJS("AddCustomBtn"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab", "Verify Create Custom field appeared"); office_ClientsHelper.IsElementPresent("//h3[text()='Create New Custom Field']"); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Add Btn Of Custom Field On Merchants Teminal Tab"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Add Btn Of Custom Field On Merchants Teminal Tab", "Bug", "Medium", "Terminals and Equipment tab", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Add Btn Of Custom Field On Merchants Teminal Tab"); TakeScreenshot("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab"); string id = loginHelper.getIssueID("Verify Add Btn Of Custom Field On Merchants Teminal Tab"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Add Btn Of Custom Field On Merchants Teminal Tab"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Add Btn Of Custom Field On Merchants Teminal Tab"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyAddBtnOfCustomFieldOnMerchantsTeminalTab"); executionLog.WriteInExcel("Verify Add Btn Of Custom Field On Merchants Teminal Tab", Status, JIRA, "Office Merchant"); } }
public void verifyCompanyNameOfMerchantOwnerContact() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver()); var DBA = "ClientDBA" + RandomNumber(111, 999999); var ownername = "Owner" + DBA; // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at Create merchant page"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter DBA name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Select the client status"); office_ClientsHelper.SelectByText("Status", "New"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "select the responsibity"); office_ClientsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on save btn"); office_ClientsHelper.ClickElement("Save"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Go to Owners tab"); office_ClientsHelper.ClickElement("OwnerTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Title"); office_ClientsHelper.TypeText("TitleOwner", "Title"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner First Name"); office_ClientsHelper.TypeText("OwnerFirstName", ownername); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner Last Name"); office_ClientsHelper.TypeText("OwnerLastName", "Owner"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on Save button"); office_ClientsHelper.ClickElement("OwnerSave"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at All Contacts page"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search Contact Name"); office_ContactsHelper.TypeText("SearchName", ownername); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Verify Company name"); office_ContactsHelper.VerifyText("FirstCompName", DBA); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at All merchants page"); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search the company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on check box"); office_ClientsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Delete the client"); office_ClientsHelper.ClickJS("DeleteClient"); office_ClientsHelper.AcceptAlert(); office_ClientsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyCompanyNameOfMerchantOwnerContact"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Company Name Of Merchant Owner Contact"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Company Name Of Merchant Owner Contact", "Bug", "Medium", "Office Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"); TakeScreenshot("VerifyCompanyNameOfMerchantOwnerContact"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCompanyNameOfMerchantOwnerContact.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyCompanyNameOfMerchantOwnerContact"); string id = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCompanyNameOfMerchantOwnerContact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyCompanyNameOfMerchantOwnerContact"); executionLog.WriteInExcel("Verify Company Name Of Merchant Owner Contact", Status, JIRA, "Office Merchants"); } }
public void verifyLegalNameOnEmailOnCorpMerchant() { string[] username = null; string[] password = null; string[] username1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username1 = oXMLData.getData("settings/Credentials", "username_office"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_MerchantHelper = new Corp_MerchantHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var officeActivities_EmailsHelper = new OfficeActivities_EmailsHelper(GetWebDriver()); var DBA = "ClientDBA" + RandomNumber(111, 999999); var email = DBA + "@yopmail.com"; // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login to office portal with valid username and password"); Login(username1[0], password[0]); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to Create Merchant page"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter DBA name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Select the client status"); office_ClientsHelper.SelectByText("Status", "New"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "select the responsibility"); office_ClientsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on save btn"); office_ClientsHelper.ClickElement("Save"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Go to Company Details tab"); office_ClientsHelper.ClickElement("CompanyDetailsTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter Legal Name"); office_ClientsHelper.TypeText("ClientLegalName", DBA); //office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Save button"); office_ClientsHelper.ClickElement("CDSave"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Send Email button"); office_ClientsHelper.ClickElement("CDSendEmailBtn"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter email in To"); officeActivities_EmailsHelper.TypeText("To", email); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Send button"); officeActivities_EmailsHelper.ClickElement("Send"); officeActivities_EmailsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Logout from office portal"); VisitOffice("logout"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login to corp portal with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to All Merchant page"); VisitCorp("merchants"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to Create Merchant page"); corp_MerchantHelper.TypeText("EnterClinentToSearch", DBA); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Open created merchant"); corp_MerchantHelper.ClickElement("OpenMerchant"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Open sent email"); corp_MerchantHelper.ClickElement("ClickOnActivityAny"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Legal Name"); corp_MerchantHelper.VerifyText("LegalName", DBA); Console.WriteLine("Legal Name is appearing on View Email page"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Logout from the corp portal"); VisitCorp("logout"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login with valid username and password"); Login(username1[0], password[0]); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Search the company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on check box"); office_ClientsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Delete the client"); office_ClientsHelper.ClickJS("DeleteClient"); office_ClientsHelper.AcceptAlert(); office_ClientsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyLegalNameOnEmailOnCorpMerchant"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Legal Name On Email On Corp Merchant"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Legal Name On Email On Corp Merchant", "Bug", "Medium", "Corp Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"); TakeScreenshot("VerifyLegalNameOnEmailOnCorpMerchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLegalNameOnEmailOnCorpMerchant.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLegalNameOnEmailOnCorpMerchant"); string id = loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLegalNameOnEmailOnCorpMerchant.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyLegalNameOnEmailOnCorpMerchant"); executionLog.WriteInExcel("Verify Legal Name On Email On Corp Merchant", Status, JIRA, "Corp Merchant"); } }