public static void DBClose(this SqlConnection sqlConnection) { try { sqlConnection.Close(); } catch (Exception e) { LogClass.AppendLogs(e); } }
public string CreateDl(TestContext testContext) { try { string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); bool isSubOU = Convert.ToBoolean(testContext.DataRow["IsSubOU"]); string email = Convert.ToString(testContext.DataRow["Email"]); string groupType = Convert.ToString(testContext.DataRow["GroupType"]); bool isNewGroup = Convert.ToBoolean(testContext.DataRow["IsNewGroup"]); string adGroupName = Convert.ToString(testContext.DataRow["ADGroupName"]); string IncomingMessageSize = Convert.ToString(testContext.DataRow["IncomingMessageSize"]); bool isCR = Convert.ToBoolean(testContext.DataRow["IsCR"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); string adminUsers = Convert.ToString(testContext.DataRow["AdminUsers"]); string memberUsers = Convert.ToString(testContext.DataRow["MemberUsers"]); bool allSendersAuth = Convert.ToBoolean(testContext.DataRow["AllSendersAuth"]); //Act ExgOrgDL pageOrgDL = new ExgOrgDL(); ExgCreateDistributionList pageCreateDL = pageOrgDL.OpenCreateDLPage(); string standing = pageCreateDL.CreateDl(groupType, isSubOU, isNewGroup, adGroupName, email, IncomingMessageSize, isCR, displayName, adminUsers, memberUsers, allSendersAuth); //Verify var status = VerifyResult(ExchangeMessages.CreateDL, standing); if (status == TestStatus.Failed) { pageOrgDL.CloseDialogueBox(); } else { Thread.Sleep(5000); } ReporterClass.Reporter("Exchange", Settings.UserLevel, "Create Exchange Group", "Exchange Group Creation Test", organizationName, groupType, email, "SubOU: " + isSubOU + "; IsNewGroup: " + isNewGroup + "; IsCr: " + isCR + "; Incoming Message Size/CR Size :" + IncomingMessageSize, status, standing); TestTracker.distributionListStatus.Add(email, status); return(status); } catch (Exception e) { LogClass.AppendLogs(e.Message); return(TestStatus.Failed); } }
public static void Reporter(string module, string userRole, string testName, string testDesc, string ou, string exchangeObject, string email, string testParam, string testStatus, string errorDetails) { try { using (StreamWriter w = File.AppendText(file)) { w.WriteLine(module + "," + userRole + "," + testName + "," + testDesc + "," + ou + "," + exchangeObject + "," + email + "," + testParam + "," + testStatus + "," + errorDetails); } } catch (Exception e) { LogClass.AppendLogs(e); } }
public string VerifyFullAccessPermissions(string userList) { try { btnTabRefreshButtonElem.ClickWithWait("spinner"); //WaitforSpinnerbgCondition return(VerifyUsersInPermissions(DriverContext.Driver, userList, DivContainer.FullAccessPermissions)); } catch (Exception ex) { LogClass.AppendLogs(ex); return(ex.Message); } }
public static bool SelectDropDownValue(IWebElement dropDownElement, string value) { try { var selectElement = new SelectElement(dropDownElement); selectElement.SelectByText(value); return(true); } catch (Exception e) { return(false); LogClass.AppendLogs(e); } }
public static SqlConnection DBConnect(this SqlConnection sqlConnection, string connectionString) { try { sqlConnection = new SqlConnection(connectionString); sqlConnection.Open(); return(sqlConnection); } catch (Exception e) { LogClass.AppendLogs(e); } return(null); }
public string CreatePublicFolder(TestContext testContext) { try { //revisit - VerifyOUMethod //Stage string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); string publicFolderType = Convert.ToString(testContext.DataRow["PublicFolderType"]); string email = Convert.ToString(testContext.DataRow["Email"]); bool isMailEnable = Convert.ToBoolean(testContext.DataRow["IsMailEnabled"]); string publicFolderName = Convert.ToString(testContext.DataRow["PublicFolderName"]); string publicFolderMailbox = Convert.ToString(testContext.DataRow["PublicFolderMailbox"]); string publicFolderSize = Convert.ToString(testContext.DataRow["PublicFolderSize"]); bool isCr = Convert.ToBoolean(testContext.DataRow["IsCR"]); //Act ExgOrgPublicFolders pageOrgPublicFolders = new ExgOrgPublicFolders(); ExgCreatePublicFolder pageCreatePublicFolder = pageOrgPublicFolders.OpenCreatePublicFolderPage(); string standing = pageCreatePublicFolder.CreatePublicFolder(publicFolderName, publicFolderType, isMailEnable, email, publicFolderMailbox, publicFolderSize, isCr); //Verify var status = VerifyResult(ExchangeMessages.CreatePublicFolder, standing); if (status == TestStatus.Failed) { CloseDialogueBox(); } else { Thread.Sleep(5000); } ReporterClass.Reporter("Exchange", Settings.UserLevel, "Create Public Folder", "Mailbox Creation Test", organizationName, "Public Folder", email, "Public Folder Type: " + publicFolderType + "; IsCr: " + isCr + "; Mailbox/CR Size :" + publicFolderSize + " IsMailEnabled: " + isMailEnable, status, standing); TestTracker.publicFolderStatus.Add(email, status); return(status); } catch (Exception e) { LogClass.AppendLogs(e.Message); return(e.Message); } }
public string EnableMailbox() { string status; try { btnmailboxDisableElem.Click(); //revisit status = GetPrompt(headerProgressElem, headerProgressElemBy, MessageContainer.ToastContainer); PageRefresh(DriverContext.Driver); } catch (Exception ex) { LogClass.AppendLogs(ex); status = TestStatus.Failed; } return(status); }
public static void NavigateToPublicFolderDashboard(TestContext testContext) { try { //Arrange string email = Convert.ToString(testContext.DataRow["email"]); string contactName = Convert.ToString(testContext.DataRow["DisplayName"]); ExgOrgPublicFolders orgPubclicFolder = new ExgOrgPublicFolders(); orgPubclicFolder.SearchPublicFolder(email, contactName); orgPubclicFolder.OpenPublicFolderDashboard(); //Act } catch (Exception ex) { LogClass.AppendLogs(ex); } }
public static void NavigateToMailboxDashboard(TestContext testContext) { try { //Arrange string email = Convert.ToString(testContext.DataRow["Email"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); ExgOrgMailboxes orgMailboxes = new ExgOrgMailboxes(); orgMailboxes.SearchMailboxUsingEmail(email); ExgMailboxDashboard mailboxDashboard = orgMailboxes.OpenMailboxDashboard(); //Act } catch (Exception ex) { LogClass.AppendLogs(ex); } }
public static void NavigateToDLDashboard(TestContext testContext) { try { //Arrange string email = Convert.ToString(testContext.DataRow["Email"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); ExgOrgDL orgDL = new ExgOrgDL(); orgDL.SearchDL(email, displayName); ExgDLDashboard mailboxDashboard = orgDL.OpenDLDashboard(); //Act } catch (Exception ex) { LogClass.AppendLogs(ex); } }
public void MailContactUpdateDashboard() { try { if (Convert.ToString(TestContext.DataRow["Userlevel"]).ToLower() != Settings.UserLevel.ToLower()) { Assert.Inconclusive(); } if (TestTracker.mailContactStatus[Convert.ToString(TestContext.DataRow["ExternalEmailAddress"])] == TestStatus.Success) { NavigateToMailContact(TestContext); NavigateToMailContactDashboard(TestContext); _softAssertions.Add("Test Add General Properties", TestStatus.Success, UpdateMailContactGeneralProperties(TestContext)); _softAssertions.Add("Test Verify Add General Properties", TestStatus.Success, VerifyMailContactGeneralProfile(TestContext, false)); _softAssertions.Add("Test Add Advance Properties", TestStatus.Success, AddAdvanceProperties(TestContext)); _softAssertions.Add("Test Add Email Address", TestStatus.Success, AddAdditionalEmailAddress(TestContext)); _softAssertions.Add("Test Verify Email Address", TestStatus.Success, VerifyAdditionalEmailAddress(TestContext)); _softAssertions.Add("Test Add AcceptedSenders Users", TestStatus.Success, AddAcceptedSenders(TestContext)); _softAssertions.Add("Test Verify Add AcceptedSenders Users", TestStatus.Success, VerifyAcceptedSenders(TestContext)); _softAssertions.Add("Test Add Rejected Users", TestStatus.Success, AddRejectedSenders(TestContext)); _softAssertions.Add("Test Verify Add Rejected Users", TestStatus.Success, VerifyRejectedSenders(TestContext)); ClickMailContactrumb(); } } catch (Exception e) { LogClass.AppendLogs(e.Message); throw; } }
public static void NavigateToMailContactDashboard(TestContext testContext) { try { //Arrange string internalEmail = Convert.ToString(testContext.DataRow["InternalEmailAddress"]); string contactName = Convert.ToString(testContext.DataRow["DisplayName"]); ExgOrgMailContacts orgMailContacts = new ExgOrgMailContacts(); orgMailContacts.SearchMailContact(internalEmail, contactName); ExgMailContactDashboard mailContactDashboard = orgMailContacts.OpenMailContactDashboard(); //Act } catch (Exception ex) { LogClass.AppendLogs(ex); } }
public string EnableMailbox(TestContext testContext) { try { //Arrange string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); string email = Convert.ToString(testContext.DataRow["Email"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); //Act HomePage home = new HomePage(); home.ClickProvisioning(); ExchangeHome exgHome = home.ClickExchangeHome(); exgHome.SearchOrganizationName(organizationName); ExgOrgMailboxes orgMailboxes = exgHome.MailboxesHome(); orgMailboxes.SearchMailboxName(email, displayName); return(orgMailboxes.DisableMailbox()); } catch (Exception ex) { LogClass.AppendLogs(ex); return(null); } }
public static void NavigateToMailboxPage(TestContext testContext) { string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); try { SetDriverTime(2); if (DriverContext.Driver.FindElements(By.XPath("//h2")).Count == 0) { SetDriverTime(30); HomePage home = new HomePage(); home.ClickProvisioning(); ExchangeHome exgHome = home.ClickExchangeHome(); exgHome.SearchOrganizationName(organizationName); ExgOrgMailboxes orgMailboxes = exgHome.MailboxesHome(); } else if (DriverContext.Driver.FindElement(By.XPath("//h2")).Text != "Manage Mailboxes" && !DriverContext.Driver.FindElement(By.XPath("//p")).Text.Contains(organizationName)) { SetDriverTime(30); PageRefresh(DriverContext.Driver); //Act HomePage home = new HomePage(); home.ClickProvisioning(); ExchangeHome exgHome = home.ClickExchangeHome(); exgHome.SearchOrganizationName(organizationName); ExgOrgMailboxes orgMailboxes = exgHome.MailboxesHome(); } } catch (Exception e) { LogClass.AppendLogs(e); } }
public string CreateMailContact(TestContext testContext) { try { //revisit - VerifyOUMethod //Stage string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); bool isSubOU = Convert.ToBoolean(testContext.DataRow["IsSubOU"]); string internalEmail = Convert.ToString(testContext.DataRow["InternalEmailAddress"]); string externalEmail = Convert.ToString(testContext.DataRow["ExternalEmailAddress"]); string contactName = Convert.ToString(testContext.DataRow["ContactName"]); bool isHiddenFromAddressList = Convert.ToBoolean(testContext.DataRow["IsHiddenFromAddressList"]); string maximumRecipients = Convert.ToString(testContext.DataRow["MaximumRecipients"]); string maximumReceiveSize = Convert.ToString(testContext.DataRow["MaximumReceiveSize"]); string firstName = Convert.ToString(testContext.DataRow["FirstName"]); string lastName = Convert.ToString(testContext.DataRow["LastName"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); string country = Convert.ToString(testContext.DataRow["Country"]); string state = Convert.ToString(testContext.DataRow["State"]); string officeLocation = Convert.ToString(testContext.DataRow["OfficeLocation"]); string address = Convert.ToString(testContext.DataRow["Address"]); string city = Convert.ToString(testContext.DataRow["City"]); string zipCode = Convert.ToString(testContext.DataRow["ZipCode"]); string jobTitle = Convert.ToString(testContext.DataRow["JobTitle"]); string company = Convert.ToString(testContext.DataRow["Company"]); string department = Convert.ToString(testContext.DataRow["Department"]); string managedBy = Convert.ToString(testContext.DataRow["ManagedBy"]); string businessPhone = Convert.ToString(testContext.DataRow["BusinessPhone"]); string fax = Convert.ToString(testContext.DataRow["Fax"]); string homePhone = Convert.ToString(testContext.DataRow["HomePhone"]); string mobilePhone = Convert.ToString(testContext.DataRow["MobilePhone"]); string pager = Convert.ToString(testContext.DataRow["Pager"]); string notes = Convert.ToString(testContext.DataRow["Notes"]); //Act ExgOrgMailContacts pageMailContacts = new ExgOrgMailContacts(); ExgCreateMailContact pagecreateMailContact = pageMailContacts.OpenCreateMailContactPage(); string standing = pagecreateMailContact.CreateMailContact(isSubOU, contactName, firstName, lastName, externalEmail, internalEmail, isHiddenFromAddressList, maximumRecipients, maximumReceiveSize, displayName, country, state, officeLocation, address, city, zipCode, jobTitle, company, department, managedBy, businessPhone, fax, homePhone, mobilePhone, pager, notes); //Verify var status = VerifyResult(ExchangeMessages.CreateMailContact, standing); if (status == TestStatus.Failed) { CloseDialogueBox(); } else { Thread.Sleep(5000); } ReporterClass.Reporter("Exchange", Settings.UserLevel, "Create Mail Contact", "Mail Contact Creation Test", organizationName, "Mail Contact", externalEmail, "SubOU: " + isSubOU + "; Internal Email: " + internalEmail + ": External Email: " + externalEmail + ": Contact Name :" + contactName +" Maximum Recepients: "+maximumRecipients+" Maximum Receive Size: "+maximumReceiveSize, status, standing); //if (string.IsNullOrEmpty(internalEmail)) //{ // TestTracker.mailContactStatus.Add(externalEmail, status); //} //else //{ // TestTracker.mailContactStatus.Add(internalEmail, status); //} TestTracker.mailContactStatus.Add(externalEmail, status); return status; } catch (Exception e) { LogClass.AppendLogs(e.Message); return TestStatus.Failed; } }
public string CreateMailbox(TestContext testContext) { try { //revisit - VerifyOUMethod //Stage string organizationName = Convert.ToString(testContext.DataRow["OrganizationName"]); string mailboxType = Convert.ToString(testContext.DataRow["MailboxType"]); bool isSubOU = Convert.ToBoolean(testContext.DataRow["IsSubOU"]); string email = Convert.ToString(testContext.DataRow["Email"]); bool isNewUser = Convert.ToBoolean(testContext.DataRow["IsNewUser"]); string mailboxPassword = Convert.ToString(testContext.DataRow["MailboxPassword"]); string mailboxSize = Convert.ToString(testContext.DataRow["MailboxSize"]); bool isCR = Convert.ToBoolean(testContext.DataRow["IsCR"]); bool passwordChange = Convert.ToBoolean(testContext.DataRow["IsChangePassword"]); string firstname = Convert.ToString(testContext.DataRow["FirstName"]); string lastName = Convert.ToString(testContext.DataRow["LastName"]); string displayName = Convert.ToString(testContext.DataRow["DisplayName"]); string country = Convert.ToString(testContext.DataRow["Country"]); string state = Convert.ToString(testContext.DataRow["State"]); string officeLocation = Convert.ToString(testContext.DataRow["OfficeLocation"]); string address = Convert.ToString(testContext.DataRow["Address"]); string city = Convert.ToString(testContext.DataRow["City"]); string zipCode = Convert.ToString(testContext.DataRow["ZipCode"]); string jobTitle = Convert.ToString(testContext.DataRow["JobTitle"]); string company = Convert.ToString(testContext.DataRow["Company"]); string department = Convert.ToString(testContext.DataRow["Department"]); string managedBy = Convert.ToString(testContext.DataRow["ManagedBy"]); string businessPhone = Convert.ToString(testContext.DataRow["BusinessPhone"]); string fax = Convert.ToString(testContext.DataRow["Fax"]); string homePhone = Convert.ToString(testContext.DataRow["HomePhone"]); string mobilePhone = Convert.ToString(testContext.DataRow["MobilePhone"]); string pager = Convert.ToString(testContext.DataRow["Pager"]); string notes = Convert.ToString(testContext.DataRow["Notes"]); //Act ExgOrgMailboxes pageOrgMailboxes = new ExgOrgMailboxes(); ExgCreateMailbox pageCreateMailbox = pageOrgMailboxes.OpenCreateMailboxPage(); string standing = pageCreateMailbox.CreateMailbox(mailboxType, isSubOU, isNewUser, email, mailboxPassword, isCR, mailboxSize, passwordChange, firstname, lastName, displayName, country, state, officeLocation, address, city, zipCode, jobTitle, company, department, managedBy, businessPhone, fax, homePhone, mobilePhone, pager, notes); //Verify var status = VerifyResult(ExchangeMessages.CreateMailbox, standing); if (status == TestStatus.Failed) { CloseDialogueBox(); } else { Thread.Sleep(5000); } ReporterClass.Reporter("Exchange", "Host", "Create Mailbox", "Mailbox Creation Test", organizationName, "Mailbox", email, "SubOU: " + isSubOU + "; IsNewUser: "******"; IsCr: " + isCR + "; Mailbox/CR Size :" + mailboxSize, status, standing); TestTracker.mailboxStatus.Add(email, status); return(status); } catch (Exception e) { LogClass.AppendLogs(e.Message); return(TestStatus.Failed); } }