public IncidentPage clickProcess() { if (clickByXpath("CREATEINC_Process_Xpath")) Reporter.reportStep("The Process Tab is clicked successfully", "SUCCESS"); else Reporter.reportStep("The Process Tab could not be entered", "FAILURE"); return this; }
public IncidentPage verifyErrorMessage(String errorMessage) { if (getTextAndAcceptAlert().equals(errorMessage)) Reporter.reportStep( "The error message :" + errorMessage + " appeared as expected", "SUCCESS"); else Reporter.reportStep("The error message :" + errorMessage + " did not appear", "FAILURE"); return this; }
public IncidentPage enterAssignedTo(String asgTo) { if (enterAndChoose("CREATEINC_AssignedTo_Xpath", asgTo)) Reporter.reportStep("The Assigned To is entered successfully", "SUCCESS"); else Reporter.reportStep( "The Assigned To: " + asgTo + " not found / could not be entered", "FAILURE"); return this; }
// The page allows the user to submit the incident form public IncidentPage submitIncident() { clickByXpath("CREATEINC_Submit_Xpath"); if (isExistById("Welcome_Id")) Reporter.reportStep("The Create Incident process is successful", "SUCCESS"); else Reporter.reportStep("The Create Incident process failed. Check snapshot", "SUCCESS"); return this; }
public IncidentPage clickFirstIncident() { // click the first Incident Link if (clickByXpath("ALERTPROFILE_FirstAlert_Xpath")) Reporter.reportStep("The First Incident is clicked Successfully", "SUCCESS"); else Reporter.reportStep("The First Incident could not be clicked", "FAILURE"); return new IncidentPage(driver); }
public IncidentPage enterAffectedUser(String aUser) { if (enterAndChoose("CREATEINC_AffectedUser_Xpath", aUser)) Reporter.reportStep("The Affected User is entered successfully", "SUCCESS"); else Reporter.reportStep( "The Affected User: "******" not found / could not be entered", "FAILURE"); return this; }
public IncidentPage enterBusinessServiceForSuccess(String configItem) { if (enterAndChoose("CREATEINC_ConfigItem_Xpath", configItem)) Reporter.reportStep( "The configuration item: " + configItem + " found and entered", "SUCCESS"); else Reporter.reportStep( "The configuration item: " + configItem + " not found / could not be entered", "FAILURE"); return this; }
// The page allows the user to submit the incident form public IncidentPage saveIncident() { clickById("Save_Id"); Wait(5000); if (getTextByXpath("CREATEINC_Pointer_Xpath").contains(getIncidentNumber())) Reporter.reportStep("The Create Incident process is successful", "SUCCESS"); else Reporter.reportStep("The Create Incident process failed. Check snapshot", "SUCCESS"); return this; }
public IncidentPage enterConfigurationItemForFailure(String configItem) { if (!enterAndChoose("CREATEINC_ConfigItem_Xpath", configItem)) Reporter.reportStep( "The configuration item: " + configItem + " not found as expected", "SUCCESS"); else Reporter.reportStep( "The configuration item: " + configItem + " found and entered", "FAILURE"); return this; }
public IncidentPage hoverCallerId() { mouseOverById("CREATEINC_Caller_Id"); if (isExistById("CREATEINC_SysUserName_Id")) Reporter.reportStep("The User Information displayed successfully", "SUCCESS"); else Reporter.reportStep("The User Information is not on mouse Over", "FAILURE"); return this; }
public IncidentPage verifyBusinessServiceContent(String sBusinessService) { // Switch to the menu frame switchToMainFrame(); if (getAttributeByXpath("CREATEINC_BusinesService_Xpath", "value").equals(sBusinessService)) Reporter.reportStep( "The business service field has value: " + sBusinessService + " as expected", "SUCCESS"); else Reporter.reportStep( "The business service field do not have value: " + sBusinessService + "; hence failed", "FAILURE"); return this; }
public IncidentPage enterConfigurationItem(String configItem) { if (!enterAndChoose("CREATEINC_ConfigItem_Xpath", configItem)) Reporter.reportStep( "The configuration item: " + configItem + " not found / could not be entered", "FAILURE"); return this; }
public IncidentPage enterReportingCustomer(String repCust) { if (!enterAndChoose("CREATEINC_RepCust_Xpath", repCust)) Reporter.reportStep( "The reporting customer: " + repCust + " not found / could not be entered", "FAILURE"); return this; }
public IncidentPage enterAssignmentGroup(String asgGroup) { if (!enterAndChoose("CREATEINC_AsgGroup_Xpath", asgGroup)) Reporter.reportStep( "The Assignment Group: " + asgGroup + " not found / could not be entered", "FAILURE"); return this; }
public String getIncidentNumber() { incidentNumber = getAttributeByXpath("CREATEINC_IncidentNumber_Xpath", "value"); if (incidentNumber.equals("")) Reporter.reportStep("The incident number is blank for newly created incident", "FAILURE"); return incidentNumber; }
public IncidentsListPage(RemoteWebDriver driver) { this.driver = driver; switchToMainFrame(); // Check that we're on the right page. if (!isExistByXpath("INCLIST_Table_Xpath")) { Reporter.reportStep("This is not the Incident List page", "FAILURE"); } switchToMainFrame(); }
public IncidentPage populateMandatoryFields( String configItem, String repCust, String asgGroup, String desc) { enterConfigurationItem(configItem) .enterReportingCustomer(repCust) .enterAssignmentGroup(asgGroup) .enterShortDescription(desc); Reporter.reportStep( "The Mandatory fields of Create Incident are entered successfully", "SUCCESS"); return this; }
public IncidentPage(RemoteWebDriver driver) { this.driver = driver; goOutOfFrame(); // Check that we're on the right page. if (!isExistById("Welcome_Id")) { Reporter.reportStep("This is not the home page", "FAILURE"); } switchToMainFrame(); }
public HomePage() { if (!driver.getTitle().contains("Welcome")) { Reporter.reportStep("This is not Home page !! ", "FAIL"); } }
public IncidentPage enterShortDescription(String desc) { if (!enterByXpath("CREATEINC_shortDesc_Xpath", desc)) Reporter.reportStep("The short description: " + desc + " could not be entered", "FAILURE"); return this; }