public void verifyFieldsInheritedForNewOffice() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); 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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver()); var yopmail_Helper = new YopMailHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_FieldDictionary_FieldsHelper = new Office_FieldDictionary_FieldsHelper(GetWebDriver()); // Variable random String JIRA = ""; String Status = "Pass"; var officename = "Office" + RandomNumber(1, 999999999); var username1 = "user" + RandomNumber(1, 9999); try { executionLog.Log("VerifyFieldsInheritedForNewOffice", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected to Dashboard"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Create Office"); VisitCorp("offices"); Console.WriteLine("Redirected to All Office page"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Create button"); corp_Office_OfficeHelper.ClickElement("Create"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify page title"); VerifyTitle("Create an Office"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Office name"); corp_Office_OfficeHelper.TypeText("Name", officename); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Address Line 1"); corp_Office_OfficeHelper.TypeText("AddressLine1", "Add 1"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Zip Code"); corp_Office_OfficeHelper.TypeText("ZIpCode", "20001"); corp_Office_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Deselect Auto generate password check box"); corp_Office_OfficeHelper.ClickElement("AutoGenPassword"); corp_Office_OfficeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Username"); corp_Office_OfficeHelper.TypeText("PrimaryUserName", username1); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Password"); corp_Office_OfficeHelper.TypeText("PrimaryPassword", "123456"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter First Name"); corp_Office_OfficeHelper.TypeText("FirstName", "Test"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Last Name"); corp_Office_OfficeHelper.TypeText("LastName", "User"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Select eAddress label"); corp_Office_OfficeHelper.Select("EaddressLabel", "Home"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter eAddress"); corp_Office_OfficeHelper.TypeText("eAddress", "*****@*****.**"); Console.WriteLine("Entered eAddress"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Save"); try { corp_Office_OfficeHelper.ClickElement("Save"); } catch (OpenQA.Selenium.WebDriverException) { } Console.WriteLine("Office Created"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Go to yopmail.com"); GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/"); Console.WriteLine("Redirected to yopmail.com"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter eAddress in yopmail"); yopmail_Helper.TypeText("Yopmail", "aslam.pegasus"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Check Inbox"); yopmail_Helper.ClickElement("YopmailClick"); yopmail_Helper.switchFrame("ifmail"); yopmail_Helper.VerifyText("MailSecondPoint", username1); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Office Link"); yopmail_Helper.ClickElement("OfficeLink"); corp_Office_OfficeHelper.SwitchToWindow(); yopmail_Helper.WaitForWorkAround(5000); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Profile Icon"); corp_Office_OfficeHelper.ClickElement("ProfileIcon"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Logout"); corp_Office_OfficeHelper.ClickElement("Logout"); Console.WriteLine("Redirected to Login Screen"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Username"); loginHelper.TypeText("Login/Username", username1); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Last Name"); loginHelper.TypeText("Login/Password", "123456"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Office"); loginHelper.ClickElement("Login/Enter"); Console.WriteLine("Logged into new office"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Redirect at create Leads page"); GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/leads/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Company Name field appearing"); office_LeadsHelper.verifyElementPresent("CompanyName"); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Redirect at Field Properties"); GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/fields"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Select Module"); office_FieldDictionary_FieldsHelper.SelectByText("FSModule", "Clients"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify fields available"); Assert.IsFalse(GetWebDriver().PageSource.Contains("No Fields Available.")); //office_LeadsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyFieldsInheritedForNewOffice"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Fields Inherited For New Office"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Fields Inherited For New Office", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Fields Inherited For New Office"); TakeScreenshot("VerifyFieldsInheritedForNewOffice"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyFieldsInheritedForNewOffice.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyFieldsInheritedForNewOffice"); string id = loginHelper.getIssueID("Verify Fields Inherited For New Office"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyFieldsInheritedForNewOffice.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Fields Inherited For New Office"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Fields Inherited For New Office"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyFieldsInheritedForNewOffice"); executionLog.WriteInExcel("Verify Fields Inherited For New Office", Status, JIRA, "Corp Employees"); } }
public void authenticateWithGoogleCalendar() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); 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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver()); var yopmail_Helper = new YopMailHelper(GetWebDriver()); var gmailHelper = new GmailHelper(GetWebDriver()); var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver()); // Variable random var username1 = "GoogleAuth" + RandomNumber(44, 99999); var name = "Test" + RandomNumber(999, 999999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("AuthenticateWithGoogleCalendar", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("AuthenticateWithGoogleCalendar", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("AuthenticateWithGoogleCalendar", "Visit Corp offices"); VisitCorp("offices"); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on create office button"); corpOffice_OfficeHelper.ClickElement("Create"); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter Name"); corpOffice_OfficeHelper.TypeText("Name", name); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter DBAName"); corpOffice_OfficeHelper.TypeText("DBAName", "TESTDBA"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter Website"); corpOffice_OfficeHelper.TypeText("Website", "TEST.COM"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter OfficeCode"); corpOffice_OfficeHelper.TypeText("OfficeCode", "12345"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("VendorCode", "1234"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName"); corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter TwitterURL"); corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com"); executionLog.Log("AuthenticateWithGoogleCalendar", "Select Address"); corpOffice_OfficeHelper.Select("AddressType", "Office"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter AddressLine1"); corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89"); executionLog.Log("AuthenticateWithGoogleCalendar", "Select Zip Code"); corpOffice_OfficeHelper.TypeText("ZIpCode", "60601"); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter PrimaryUserName"); corpOffice_OfficeHelper.TypeText("PrimaryUserName", username1); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on AutoGenPassword checkbox"); corpOffice_OfficeHelper.ClickElement("AutoGenPassword"); corpOffice_OfficeHelper.WaitForWorkAround(1000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter PrimaryPassword"); corpOffice_OfficeHelper.TypeText("PrimaryPassword", "123456"); executionLog.Log("AuthenticateWithGoogleCalendar", "Select Salutation"); corpOffice_OfficeHelper.Select("Salutation", "Mr"); //corpOffice_OfficeHelper.WaitForWorkAround(2000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter FirstName"); corpOffice_OfficeHelper.TypeText("FirstName", "Test"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter LastName"); corpOffice_OfficeHelper.TypeText("LastName", "Tester"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter eAddress"); corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**"); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on save button."); try { corpOffice_OfficeHelper.ClickElement("Save"); } catch (OpenQA.Selenium.WebDriverException) { } yopmail_Helper.WaitForWorkAround(7000); executionLog.Log("AuthenticateWithGoogleCalendar", "Go to yopmail.com"); GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/"); Console.WriteLine("Redirected to yopmail.com"); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter eAddress in yopmail"); yopmail_Helper.TypeText("Yopmail", "aslam.pegasus"); executionLog.Log("AuthenticateWithGoogleCalendar", "Check Inbox"); yopmail_Helper.ClickElement("YopmailClick"); yopmail_Helper.switchFrame("ifmail"); yopmail_Helper.VerifyText("MailSecondPoint", username1); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Office Link"); yopmail_Helper.ClickElement("OfficeLink"); corpOffice_OfficeHelper.SwitchToWindow(); yopmail_Helper.WaitForWorkAround(5000); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Profile Icon"); VisitCorp("logout"); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("AuthenticateWithGoogleCalendar", "Login to office"); Login(username1, "123456"); executionLog.Log("AuthenticateWithGoogleCalendar", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("AuthenticateWithGoogleCalendar", "Redirect at My Calendar page"); GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/meetings/calendar/my"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Authenticate with Google button"); officeActivities_MeetingHelper.ClickElement("GoogleAuth"); officeActivities_MeetingHelper.WaitForWorkAround(3000); if (gmailHelper.IsElementPresent("//div[@id='identifierLink']/div[2]/p")) { executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Use Another Account"); gmailHelper.ClickElement("UseAnotherAccBtn"); gmailHelper.WaitForWorkAround(1000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter email address"); gmailHelper.TypeText("EnterEmail", "*****@*****.**"); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button"); gmailHelper.ClickElement("NextBtn"); gmailHelper.WaitForWorkAround(1000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter password address"); gmailHelper.TypeText("EnterPswrd", "selenium123456"); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button"); gmailHelper.ClickElement("NextBtn"); gmailHelper.WaitForWorkAround(1000); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Allow button"); gmailHelper.ClickElement("AllowBtn"); gmailHelper.WaitForWorkAround(4000); } else { executionLog.Log("AuthenticateWithGoogleCalendar", "Enter email address"); gmailHelper.TypeText("EnterEmail", "*****@*****.**"); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button"); gmailHelper.ClickElement("NextBtn"); gmailHelper.WaitForWorkAround(1000); executionLog.Log("AuthenticateWithGoogleCalendar", "Enter password address"); gmailHelper.TypeText("EnterPswrd", "selenium123456"); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button"); gmailHelper.ClickElement("NextBtn"); gmailHelper.WaitForWorkAround(1000); executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Allow button"); gmailHelper.ClickElement("AllowBtn"); gmailHelper.WaitForWorkAround(4000); } executionLog.Log("AuthenticateWithGoogleCalendar", "Verify successfully Google Calendar Synced"); officeActivities_MeetingHelper.VerifyPageText("Last Sync Time"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AuthenticateWithGoogleCalendar"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Authenticate With Google Calendar"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Authenticate With Google Calendar", "Bug", "Medium", "Create Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Authenticate With Google Calendar"); TakeScreenshot("AuthenticateWithGoogleCalendar"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AuthenticateWithGoogleCalendar.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AuthenticateWithGoogleCalendar"); string id = loginHelper.getIssueID("Authenticate With Google Calendar"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AuthenticateWithGoogleCalendar.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Authenticate With Google Calendar"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Authenticate With Google Calendar"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AuthenticateWithGoogleCalendar"); executionLog.WriteInExcel("Authenticate With Google Calendar", Status, JIRA, "Corp Office"); } }
public void verifyDocumentShareDBAPopulate() { 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 yopmail_Helper = new YopMailHelper(GetWebDriver()); var DBA = "ClientDBA" + RandomNumber(1, 9999); var OwnerFirst = "Owner" + RandomNumber(1, 9999); var OwnerLast = "Test" + RandomNumber(1, 9999); var DBAVerify = "Merchant Portal - " + DBA + " You have documents waiting for review"; // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyDocumentShareDBAPopulate", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyDocumentShareDBAPopulate", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected to Dashboard"); VisitOffice("clients/create"); office_clientsHelper.WaitForWorkAround(2000); Console.WriteLine("Redirected to Create Merchant page"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter Bussiness DBA name"); office_clientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter First Name"); office_clientsHelper.TypeText("FirstName", "Test"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter Last Name"); office_clientsHelper.TypeText("LastName", "Client"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Select Status"); office_clientsHelper.SelectByText("Status", "New"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Select Responsibility"); office_clientsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Save button"); office_clientsHelper.ClickElement("Save"); office_clientsHelper.WaitForWorkAround(4000); Console.WriteLine("Merchant Created"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Go to Owners tab"); office_clientsHelper.ClickElement("OwnerTab"); office_clientsHelper.WaitForWorkAround(3000); Console.WriteLine("Redirected to Owners tab"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter Owner First Name"); office_clientsHelper.TypeText("OwnerFirstName", OwnerFirst); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter Owner Last Name"); office_clientsHelper.TypeText("OwnerLastName", OwnerLast); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter Owner Title"); office_clientsHelper.TypeText("TitleOwner", "NewTitle"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Select eAddress Type"); office_clientsHelper.SelectByText("OwnereAddressType", "E-Mail"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter eAddress"); office_clientsHelper.TypeText("OwnereAddressEnter", "*****@*****.**"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Save button"); office_clientsHelper.ClickElement("OwnerSave"); Console.WriteLine("Owner Information saved"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Go to PDFs tab"); office_clientsHelper.ClickElement("PDFtab"); office_clientsHelper.WaitForWorkAround(3000); Console.WriteLine("Redirected to PDFs tab"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on [Share] link"); office_clientsHelper.ClickElement("ShareLink"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Default Password radio button"); office_clientsHelper.ClickElement("DefaultPwdRadioBtn"); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Create button"); office_clientsHelper.ClickElement("CreateBtn"); office_clientsHelper.WaitForWorkAround(3000); GetWebDriver().SwitchTo().Alert().Accept(); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Close Create User Popup"); office_clientsHelper.ClickElement("CrossIcon"); Console.WriteLine("Client User Created"); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Go to Info tab"); office_clientsHelper.ClickElement("InfoTab"); office_clientsHelper.WaitForWorkAround(3000); Console.WriteLine("Redirected to Info tab"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Create/Manage button"); office_clientsHelper.ClickForce("ManageClientUser"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Manage option"); office_clientsHelper.ClickElement("ManageOption"); office_clientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Select User"); office_clientsHelper.ClickElement("ClientChkBox"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Activate Selected User button"); office_clientsHelper.ClickElement("ActivateBtn"); office_clientsHelper.WaitForWorkAround(4000); GetWebDriver().SwitchTo().Alert().Accept(); office_clientsHelper.WaitForWorkAround(4000); Console.WriteLine("Client User Activated"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Go to PDFs tab"); office_clientsHelper.ClickElement("PDFtab"); office_clientsHelper.WaitForWorkAround(3000); Console.WriteLine("Redirected to PDFs tab"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on [Share] link"); office_clientsHelper.ClickElement("ShareLink"); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Select Owners Signature Required check box"); office_clientsHelper.ClickElement("OwnerSignReq"); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Select Documents Required check box"); office_clientsHelper.ClickElement("DocReq"); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Share button"); office_clientsHelper.ClickElement("ShareBtn"); office_clientsHelper.WaitForWorkAround(3000); GetWebDriver().SwitchTo().Alert().Accept(); Console.WriteLine("File Shared successfully"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Go to yopmail.com"); GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/"); yopmail_Helper.WaitForWorkAround(3000); Console.WriteLine("Redirected to yopmail.com"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Enter Email"); yopmail_Helper.TypeText("Yopmail", "owner.pegasus"); yopmail_Helper.WaitForWorkAround(1000); executionLog.Log("VerifyDocumentShareDBAPopulate", "Click on Check Inbox button"); yopmail_Helper.ClickElement("YopmailClick"); Console.WriteLine("Entered into inbox"); executionLog.Log("VerifyDocumentShareDBAPopulate", "Verify DBA Name present in Subject of email"); yopmail_Helper.switchFrame("ifmail"); yopmail_Helper.VerifyText("SubjectFirstMail", DBA); Console.WriteLine("DBA Name is populated in Subject if email"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyDocumentShareDBAPopulate"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Document Share DBA Populate"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Document Share DBA Populate", "Bug", "Medium", "Office Merchant", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Admin Ticket Master Delete Confirmation"); TakeScreenshot("VerifyDocumentShareDBAPopulate"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentShareDBAPopulate.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyDocumentShareDBAPopulate"); string id = loginHelper.getIssueID("Verify Document Share DBA Populate"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentShareDBAPopulate.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Document Share DBA Populate"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Document Share DBA Populate"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyDocumentShareDBAPopulate"); executionLog.WriteInExcel("Verify Document Share DBA Populate", Status, JIRA, "Office Merchant"); } }
public void verifyOfficeWithAllModules() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); 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_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver()); var yopmail_Helper = new YopMailHelper(GetWebDriver()); var office_Common_Layout = new OfficeCommonLayoutHelper(GetWebDriver()); var office_Admin_Layout = new OfficeAdminCommonLayoutHelper(GetWebDriver()); // Variable random String JIRA = ""; String Status = "Pass"; var officename = "Office" + RandomNumber(1, 999999999); var username1 = "user" + RandomNumber(1, 9999); //try //{ executionLog.Log("VerifyOfficeWithAllModules", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyOfficeWithAllModules", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected to Dashboard"); executionLog.Log("VerifyOfficeWithAllModules", "Create Office"); VisitCorp("offices"); Console.WriteLine("Redirected to All Office page"); executionLog.Log("VerifyOfficeWithAllModules", "Click on Create button"); corp_Office_OfficeHelper.ClickElement("Create"); executionLog.Log("VerifyOfficeWithAllModules", "Verify page title"); VerifyTitle("Create an Office"); executionLog.Log("VerifyOfficeWithAllModules", "Enter Office name"); corp_Office_OfficeHelper.TypeText("Name", officename); executionLog.Log("VerifyOfficeWithAllModules", "Enter Address Line 1"); corp_Office_OfficeHelper.TypeText("AddressLine1", "Add 1"); executionLog.Log("VerifyOfficeWithAllModules", "Enter Zip Code"); corp_Office_OfficeHelper.TypeText("ZIpCode", "20001"); corp_Office_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOfficeWithAllModules", "Deselect Auto generate password check box"); corp_Office_OfficeHelper.ClickElement("AutoGenPassword"); corp_Office_OfficeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyOfficeWithAllModules", "Enter Username"); corp_Office_OfficeHelper.TypeText("PrimaryUserName", username1); executionLog.Log("VerifyOfficeWithAllModules", "Enter Password"); corp_Office_OfficeHelper.TypeText("PrimaryPassword", "123456"); executionLog.Log("VerifyOfficeWithAllModules", "Enter First Name"); corp_Office_OfficeHelper.TypeText("FirstName", "Test"); executionLog.Log("VerifyOfficeWithAllModules", "Enter Last Name"); corp_Office_OfficeHelper.TypeText("LastName", "User"); executionLog.Log("VerifyOfficeWithAllModules", "Select eAddress label"); corp_Office_OfficeHelper.Select("EaddressLabel", "Home"); executionLog.Log("VerifyOfficeWithAllModules", "Enter eAddress"); corp_Office_OfficeHelper.TypeText("eAddress", "*****@*****.**"); Console.WriteLine("Entered eAddress"); executionLog.Log("VerifyOfficeWithAllModules", "Click on Save"); try { corp_Office_OfficeHelper.ClickElement("Save"); } catch (OpenQA.Selenium.WebDriverException) { } Console.WriteLine("Office Created"); executionLog.Log("VerifyOfficeWithAllModules", "Go to yopmail.com"); GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/"); Console.WriteLine("Redirected to yopmail.com"); executionLog.Log("VerifyOfficeWithAllModules", "Enter eAddress in yopmail"); yopmail_Helper.TypeText("Yopmail", "aslam.pegasus"); executionLog.Log("VerifyOfficeWithAllModules", "Check Inbox"); yopmail_Helper.ClickElement("YopmailClick"); yopmail_Helper.switchFrame("ifmail"); yopmail_Helper.VerifyText("MailSecondPoint", username1); executionLog.Log("VerifyOfficeWithAllModules", "Click on Office Link"); yopmail_Helper.ClickElement("OfficeLink"); corp_Office_OfficeHelper.SwitchToWindow(); yopmail_Helper.WaitForWorkAround(5000); executionLog.Log("VerifyOfficeWithAllModules", "Click on Profile Icon"); corp_Office_OfficeHelper.ClickElement("ProfileIcon"); executionLog.Log("VerifyOfficeWithAllModules", "Click on Logout"); corp_Office_OfficeHelper.ClickElement("Logout"); Console.WriteLine("Redirected to Login Screen"); executionLog.Log("VerifyOfficeWithAllModules", "Enter Username"); loginHelper.TypeText("Login/Username", username1); executionLog.Log("VerifyOfficeWithAllModules", "Enter Last Name"); loginHelper.TypeText("Login/Password", "123456"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Office"); loginHelper.ClickElement("Login/Enter"); Console.WriteLine("Logged into new office"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyOfficeWithAllModules", "Click on Hamburger Icon"); office_Common_Layout.ClickElement("HamburgerIcon"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Home Module"); office_Common_Layout.ElementVisible("HomeTab"); Console.WriteLine("Home Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Opportunities Module"); office_Common_Layout.ElementVisible("OpportunitiesTab"); Console.WriteLine("Opportunity Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Leads Module"); office_Common_Layout.ElementVisible("LeadsTab"); Console.WriteLine("Leads Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Merchants Module"); office_Common_Layout.ElementVisible("ClientsTab"); Console.WriteLine("Merchants Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Contacts Module"); office_Common_Layout.ElementVisible("ContactsTab"); Console.WriteLine("Contacts Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Activities Module"); office_Common_Layout.ElementVisible("ActivitiesTab"); Console.WriteLine("Activities Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Tickets Module"); office_Common_Layout.ElementVisible("TicketsTab"); Console.WriteLine("Tickets Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Agents Module"); office_Common_Layout.ElementVisible("AgentsTab"); Console.WriteLine("Agents Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Residual Income Module"); office_Common_Layout.ElementVisible("ResidualIncomeTab"); Console.WriteLine("Residual Income Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Reports Module"); office_Common_Layout.ElementVisible("ReportsTab"); Console.WriteLine("Reports Module is present"); office_Common_Layout.ScrollDown("//ul[@id='menu']/li[13]"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Dashboards Module"); office_Common_Layout.ElementVisible("Dashboards"); Console.WriteLine("Dashboards Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Redirect To Admin"); VisitOffice("admin"); office_Common_Layout.WaitForWorkAround(4000); Console.WriteLine("Redirected to Admin Site"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Office Module"); office_Admin_Layout.ElementVisible("Office"); Console.WriteLine("Office Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Corporate Module"); office_Admin_Layout.ElementVisible("Corporate"); Console.WriteLine("Corporate Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Master Data Module"); office_Admin_Layout.ElementVisible("MasterDataTab"); Console.WriteLine("Master Data Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Statistics Module"); office_Admin_Layout.ElementVisible("StatisticsTab"); Console.WriteLine("Statistics Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Tickets Module"); office_Admin_Layout.ElementVisible("TicketsTab"); Console.WriteLine("Tickets Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify System Module"); office_Admin_Layout.ElementVisible("System"); Console.WriteLine("System Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Integrations Module"); office_Admin_Layout.ElementVisible("IntegrationsTab"); Console.WriteLine("Integrations Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Products Module"); office_Admin_Layout.ElementVisible("ProductsTab"); Console.WriteLine("Products Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify PDF Templates Module"); office_Admin_Layout.ElementVisible("PDFTemplatesTab"); Console.WriteLine("PDF Templates Module is present"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Equipment Module"); office_Admin_Layout.ElementVisible("EquipmentTab"); Console.WriteLine("Equipment Module is present"); office_Admin_Layout.ScrollDown("//ul[@id='menu']/li[13]"); executionLog.Log("VerifyOfficeWithAllModules", "Verify Field Dictionary Module"); office_Admin_Layout.ElementVisible("FieldDicTab"); Console.WriteLine("Field Dictionary Module is present"); //} //catch (Exception e) //{ //} }