private static void Collapse() { if (IsUserConfigMenuExpanded()) { log.Info("Collapsing User Config Menu..."); GeneralPage.ClickOnObject(GeneralPage.ID.userConfigCog); } else { log.Info("Tried to collapse the User Config Menu but it was already collapsed."); } }
private static void ClickToExpandNavBar() { if (!IsNavBarExpanded()) { log.Info("Expanding Module Navigation Bar..."); GeneralPage.ClickOnObject(GeneralPage.ID.navbarTriggerBtn); } else { log.Info("Tried to expand the module navigation bar but it was already open."); } }
//No longer used private static void Collapse() { if (IsNavBarExpanded()) { log.Info("Collapsing Module Navigation Bar..."); GeneralPage.ClickOnObject(GeneralPage.ID.navbarTriggerBtn); } else { log.Info("Tried to collapse the module navigation bar but it was already collapsed."); } }
private static void Expand() { if (!IsUserConfigMenuExpanded()) { log.Info("Expanding User Config Menu..."); GeneralPage.ClickOnObject(GeneralPage.ID.userConfigCog); } else { log.Info("Tried to expand the User Config Menu but it was already open."); } }
//Overload of ClickNew() for Service Request types public static void ClickNew(string ticketType) { string xPathType = ""; switch (ticketType) { case "Access Request": { xPathType = "AccessRequest"; break; } case "General Request": { xPathType = "GeneralRequest"; break; } case "Hardware Request": { xPathType = "HardwareRequest"; break; } case "Move Request": { xPathType = "MoveRequest"; break; } case "Software Request": { xPathType = "SoftwareRequest"; break; } case "Training Request": { xPathType = "TrainingRequest"; break; } default: { Assert.Fail("Unknown Service request Type. Check the feature file for errors."); break; } } GeneralPage.ClickOnObject(ID.newBtn); GeneralPage.ClickOnObject(ID.GenerateSRNewTypeXPath(xPathType)); }
public static void ClickUserSettingsOption(string BtnSel) { string option = BtnSel; Expand(); switch (option) { case "Preferences": { GeneralPage.ClickOnObject(GeneralPage.ID.userPreferencesLink); log.Info("Clicked on Preferences in the User Config menu."); break; } case "Help": { GeneralPage.ClickOnObject(GeneralPage.ID.helpLink); log.Info("Clicked on Help in the User Config menu."); break; } case "Log Off": { GeneralPage.ClickOnObject(GeneralPage.ID.logOffLink); log.Info("Clicked on Log Off in the User Config menu."); break; } default: { log.Error("This selection[" + option + "] does not exist. Check the feature file for errors."); Assert.Fail("This selection[" + option + "] does not exist. Check the feature file for errors."); break; } } }
public static void ClickHyperlink() { GeneralPage.ClickOnObject(ID.hyperlink); }
//This can be used to see if highlight works by single clicking a row in the grid. This particular test is not yet implemented. public static void ClickOnTicket(int ticketPosition) { GeneralPage.ClickOnObject(ID.GenerateTicketGridXPath(ticketPosition)); }
public static void ClickDuplicate() { GeneralPage.ClickOnObject(ID.duplicate); }
public static void ClickEdit() { GeneralPage.ClickOnObject(ID.edit); }
public static void ClickTemplateDD(string template) { GeneralPage.ClickOnObject(ID.templateDD); //implement template }
public static void ClickPrint() { GeneralPage.ClickOnObject(ID.print); }
public static void ClickEmail() { GeneralPage.ClickOnObject(ID.email); }
public static void ClickSearch() { GeneralPage.ClickOnObject(ID.search); }
public static void ClickRefresh() { GeneralPage.ClickOnObject(ID.refresh); }
public static void ClickDelete() { GeneralPage.ClickOnObject(ID.delete); }
public static void ClickAction(string action) { GeneralPage.ClickOnObject(ID.GenerateTicketActionXPath(action)); }
public static void Click(string moduleBtnSel) { string moduleBtn = moduleBtnSel; ClickToExpandNavBar(); if (moduleBtn.Contains("Flex")) { //Determine if Flex module is valid bool moduleValid = false; for (int i = 1; i < 10; i++) { if (moduleBtn == ("Flex" + i)) { moduleValid |= true; break; } } if (!moduleValid) { log.Error("This module[" + moduleBtn + "] does not exist. Check the feature file for errors."); Assert.Fail("This module[" + moduleBtn + "] does not exist. Check the feature file for errors."); return; } GeneralPage.ClickOnObject(FlexModulePage.ID.GenerateFlexNavBarXPath(moduleBtn)); log.Info("Clicked on " + moduleBtn + " module in the module navigation bar."); return; } switch (moduleBtn) { case "Incident": { GeneralPage.ClickOnObject(IncidentModulePage.ID.sidebarIncidentModuleSelectBtn); log.Info("Clicked on Incident module in the module navigation bar."); break; } case "Problem": { GeneralPage.ClickOnObject(ProblemModulePage.ID.sidebarProblemModuleSelectBtn); log.Info("Clicked on Problem module in the module navigation bar."); break; } case "Change": { GeneralPage.ClickOnObject(ChangeModulePage.ID.sidebarChangeModuleSelectBtn); log.Info("Clicked on Change module in the module navigation bar."); break; } case "Service Catalog": { GeneralPage.ClickOnObject(ServiceCatalogPage.ID.sidebarServiceCatalogModuleSelectBtn); log.Info("Clicked on Service Catalog module in the navigation bar."); break; } case "CMDB": { GeneralPage.ClickOnObject(CMDBModulePage.ID.sidebarCMDBModuleSelectBtn); log.Info("Clicked on CMDB module in the navigation bar."); break; } case "Knowledge Base": { GeneralPage.ClickOnObject(KBModulePage.ID.sidebarKBModuleSelectBtn); log.Info("Clicked on Knowledge Base module in the navigation bar."); break; } case "Survey": { GeneralPage.ClickOnObject(SurveyModulePage.ID.sidebarSurveyModuleSelectBtn); log.Info("Clicked on Survey module in the navigation bar."); break; } case "Reports": { GeneralPage.ClickOnObject(ReportsModulePage.ID.sidebarReportsModuleSelectBtn); log.Info("Clicked on Reports module in the navigation bar."); break; } case "Service Request": { GeneralPage.ClickOnObject(ServiceRequestPage.ID.sidebarServiceRequestModuleSelectBtn); log.Info("Clicked on " + moduleBtn + " module in the navigation bar."); break; } default: { log.Error("This module[" + moduleBtn + "] does not exist. Check the feature file for errors."); Assert.Fail("This module[" + moduleBtn + "] does not exist. Check the feature file for errors."); break; } } }
public static void ClickOnView(string viewName) { log.Info("Clicking on view: " + viewName); GeneralPage.ClickOnObject(ID.GenerateViewXpath(viewName)); }
public static void ClickNew() { GeneralPage.ClickOnObject(ID.newBtn); }