step_file_name
stringclasses
26 values
scenario
stringlengths
13
161
step_function
stringlengths
33
2.68k
page_function
stringlengths
41
4.12k
step_function_scenario
stringlengths
59
2.81k
code
stringlengths
110
4.43k
text
stringlengths
305
4.7k
CommonSteps.java
I validate dashboard shows (.*) message
public void validateTextPresent(String msg){ commonPage.validateTextPresent(msg); }
public void validateTextPresent(String msg) { String path=String.format(message, msg); WebElement elem=getDriver().findElement(By.xpath(path)); assertTrue(elem.isDisplayed()); }
@Then("^I validate dashboard shows (.*) message$") public void validateTextPresent(String msg){ commonPage.validateTextPresent(msg); }
//step_function: public void validateTextPresent(String msg){ commonPage.validateTextPresent(msg); } //page_function: public void validateTextPresent(String msg) { String path=String.format(message, msg); WebElement elem=getDriver().findElement(By.xpath(path)); assertTrue(elem.isDisplayed()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I validate dashboard shows (.*) message ### response: //step_function: public void validateTextPresent(String msg){ commonPage.validateTextPresent(msg); } //page_function: public void validateTextPresent(String msg) { String path=String.format(message, msg); WebElement elem=getDriver().findElement(By.xpath(path)); assertTrue(elem.isDisplayed()); }
CommonSteps.java
I zoom out in browser
public void zoomOut() throws AWTException{ commonPage.zoomOut(); } }
public void zoomOut() throws AWTException { Robot robot=new Robot(); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_SUBTRACT); robot.keyRelease(KeyEvent.VK_SUBTRACT); robot.keyRelease(KeyEvent.VK_CONTROL); }
@Then("^I zoom out in browser$") public void zoomOut() throws AWTException{ commonPage.zoomOut(); } }
//step_function: public void zoomOut() throws AWTException{ commonPage.zoomOut(); } } //page_function: public void zoomOut() throws AWTException { Robot robot=new Robot(); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_SUBTRACT); robot.keyRelease(KeyEvent.VK_SUBTRACT); robot.keyRelease(KeyEvent.VK_CONTROL); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I zoom out in browser ### response: //step_function: public void zoomOut() throws AWTException{ commonPage.zoomOut(); } } //page_function: public void zoomOut() throws AWTException { Robot robot=new Robot(); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_SUBTRACT); robot.keyRelease(KeyEvent.VK_SUBTRACT); robot.keyRelease(KeyEvent.VK_CONTROL); }
DashboardAPISteps.java
I prepare headers for (.*) API
public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^I prepare headers for (.*) API$") public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); }
//step_function: public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I prepare headers for (.*) API ### response: //step_function: public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I prepare payload for email (.*) for (.*) API( with (.*) (project|location))?
public String preparePayload(String file, String email, String apiName, String anyProjectOrLocation, String specificProjectOrLocations, String projectOrlocation) throws Exception { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); int businessEntityId, cId; String landlordProjectIds, locationId, locationId1, locationId2, locationId3, groupName, bcAssetId, projectIds1, projectIds2, projectIds, bcAssetId1, bcAssetId2; switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; case "landLease": String projectId="", vendorId=""; if((file!=null) && (file.contains("data file"))) { projectId=commonPage.fetchDataFromDataProperties("projectIdForIncomeAPI"); // vendorId=commonPage.fetchDataFromDataProperties("vendorIdForIncomeAPI"); } // String payload5=String.format(incomeAPIParameterizedPayload1, projectId); // String payload6=String.format(incomeAPIParameterizedPayload2, vendorId); // payload=payload5+payload6; // landlordProjectIds=commonPage.fetchDataFromDataProperties("landlordProjectIds"); businessEntityId=Integer.parseInt(commonPage.fetchDataFromDataProperties("businessEntityId2")); cId=Integer.parseInt(commonPage.fetchDataFromDataProperties("customerId2")); payload=Payload.projectsForLandlord(businessEntityId, cId, projectId); break; case "helpAndSupportEmail": payload=String.format(helpAndSupportEmailParameterizedPayload, email); break; case "createNewUser": String firstName=commonPage.fetchDataFromDataProperties("userFirstName"); String lastName=commonPage.fetchDataFromDataProperties("userLastName"); String userEmail="automationemail"+(commonPage.generatedString)+"
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I prepare payload for email (.*) for (.*) API( with (.*) (project|location))?$") public String preparePayload(String file, String email, String apiName, String anyProjectOrLocation, String specificProjectOrLocations, String projectOrlocation) throws Exception { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); int businessEntityId, cId; String landlordProjectIds, locationId, locationId1, locationId2, locationId3, groupName, bcAssetId, projectIds1, projectIds2, projectIds, bcAssetId1, bcAssetId2; switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; case "landLease": String projectId="", vendorId=""; if((file!=null) && (file.contains("data file"))) { projectId=commonPage.fetchDataFromDataProperties("projectIdForIncomeAPI"); // vendorId=commonPage.fetchDataFromDataProperties("vendorIdForIncomeAPI"); } // String payload5=String.format(incomeAPIParameterizedPayload1, projectId); // String payload6=String.format(incomeAPIParameterizedPayload2, vendorId); // payload=payload5+payload6; // landlordProjectIds=commonPage.fetchDataFromDataProperties("landlordProjectIds"); businessEntityId=Integer.parseInt(commonPage.fetchDataFromDataProperties("businessEntityId2")); cId=Integer.parseInt(commonPage.fetchDataFromDataProperties("customerId2")); payload=Payload.projectsForLandlord(businessEntityId, cId, projectId); break; case "helpAndSupportEmail": payload=String.format(helpAndSupportEmailParameterizedPayload, email); break; case "createNewUser": String firstName=commonPage.fetchDataFromDataProperties("userFirstName"); String lastName=commonPage.fetchDataFromDataProperties("userLastName"); String userEmail="automationemail"+(commonPage.generatedString)+"
//step_function: public String preparePayload(String file, String email, String apiName, String anyProjectOrLocation, String specificProjectOrLocations, String projectOrlocation) throws Exception { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); int businessEntityId, cId; String landlordProjectIds, locationId, locationId1, locationId2, locationId3, groupName, bcAssetId, projectIds1, projectIds2, projectIds, bcAssetId1, bcAssetId2; switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; case "landLease": String projectId="", vendorId=""; if((file!=null) && (file.contains("data file"))) { projectId=commonPage.fetchDataFromDataProperties("projectIdForIncomeAPI"); // vendorId=commonPage.fetchDataFromDataProperties("vendorIdForIncomeAPI"); } // String payload5=String.format(incomeAPIParameterizedPayload1, projectId); // String payload6=String.format(incomeAPIParameterizedPayload2, vendorId); // payload=payload5+payload6; // landlordProjectIds=commonPage.fetchDataFromDataProperties("landlordProjectIds"); businessEntityId=Integer.parseInt(commonPage.fetchDataFromDataProperties("businessEntityId2")); cId=Integer.parseInt(commonPage.fetchDataFromDataProperties("customerId2")); payload=Payload.projectsForLandlord(businessEntityId, cId, projectId); break; case "helpAndSupportEmail": payload=String.format(helpAndSupportEmailParameterizedPayload, email); break; case "createNewUser": String firstName=commonPage.fetchDataFromDataProperties("userFirstName"); String lastName=commonPage.fetchDataFromDataProperties("userLastName"); String userEmail="automationemail"+(commonPage.generatedString)+" //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I prepare payload for email (.*) for (.*) API( with (.*) (project|location))? ### response: //step_function: public String preparePayload(String file, String email, String apiName, String anyProjectOrLocation, String specificProjectOrLocations, String projectOrlocation) throws Exception { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); int businessEntityId, cId; String landlordProjectIds, locationId, locationId1, locationId2, locationId3, groupName, bcAssetId, projectIds1, projectIds2, projectIds, bcAssetId1, bcAssetId2; switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; case "landLease": String projectId="", vendorId=""; if((file!=null) && (file.contains("data file"))) { projectId=commonPage.fetchDataFromDataProperties("projectIdForIncomeAPI"); // vendorId=commonPage.fetchDataFromDataProperties("vendorIdForIncomeAPI"); } // String payload5=String.format(incomeAPIParameterizedPayload1, projectId); // String payload6=String.format(incomeAPIParameterizedPayload2, vendorId); // payload=payload5+payload6; // landlordProjectIds=commonPage.fetchDataFromDataProperties("landlordProjectIds"); businessEntityId=Integer.parseInt(commonPage.fetchDataFromDataProperties("businessEntityId2")); cId=Integer.parseInt(commonPage.fetchDataFromDataProperties("customerId2")); payload=Payload.projectsForLandlord(businessEntityId, cId, projectId); break; case "helpAndSupportEmail": payload=String.format(helpAndSupportEmailParameterizedPayload, email); break; case "createNewUser": String firstName=commonPage.fetchDataFromDataProperties("userFirstName"); String lastName=commonPage.fetchDataFromDataProperties("userLastName"); String userEmail="automationemail"+(commonPage.generatedString)+" //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers
public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers$") public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); }
//step_function: public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers ### response: //step_function: public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I set request specification with the (.*) API (for customer id \\d+ )?with headers and payload
public void add_API_Payload(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I set request specification with the (.*) API (for customer id \\d+ )?with headers and payload$") public void add_API_Payload(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); }
//step_function: public void add_API_Payload(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I set request specification with the (.*) API (for customer id \\d+ )?with headers and payload ### response: //step_function: public void add_API_Payload(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I add API params with parameter (.*) as (.*
public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I add API params with parameter (.*) as (.*)$") public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); }
//step_function: public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I add API params with parameter (.*) as (.* ### response: //step_function: public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
I verify fuel details on property overview page and dataHealth dashboard Api are same
public void GivenIVerifyFuelDetailsOnPropertyOverviewPageAndDataHealthDashboardApiAreSame() throws Exception { String fuelType=propertyDetailsPage.getFuelUsageText(); System.out.println(fuelType); HashMap<String, String> fuelDetails=response.jsonPath().get("dashboardData[0].fuelDetails"); if(fuelDetails.containsKey("fuelOilConsumption") && fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil") && fuelType.contains("Natural Gas")); }else if(fuelDetails.containsKey("fuelOilConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil")); }else if(fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Natural Gas")); }else { Assert.assertTrue(fuelType.contains("--")); } }
public String getFuelUsageText() { return fuelUsageType.getText(); }
@Given("I verify fuel details on property overview page and dataHealth dashboard Api are same$") public void GivenIVerifyFuelDetailsOnPropertyOverviewPageAndDataHealthDashboardApiAreSame() throws Exception { String fuelType=propertyDetailsPage.getFuelUsageText(); System.out.println(fuelType); HashMap<String, String> fuelDetails=response.jsonPath().get("dashboardData[0].fuelDetails"); if(fuelDetails.containsKey("fuelOilConsumption") && fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil") && fuelType.contains("Natural Gas")); }else if(fuelDetails.containsKey("fuelOilConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil")); }else if(fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Natural Gas")); }else { Assert.assertTrue(fuelType.contains("--")); } }
//step_function: public void GivenIVerifyFuelDetailsOnPropertyOverviewPageAndDataHealthDashboardApiAreSame() throws Exception { String fuelType=propertyDetailsPage.getFuelUsageText(); System.out.println(fuelType); HashMap<String, String> fuelDetails=response.jsonPath().get("dashboardData[0].fuelDetails"); if(fuelDetails.containsKey("fuelOilConsumption") && fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil") && fuelType.contains("Natural Gas")); }else if(fuelDetails.containsKey("fuelOilConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil")); }else if(fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Natural Gas")); }else { Assert.assertTrue(fuelType.contains("--")); } } //page_function: public String getFuelUsageText() { return fuelUsageType.getText(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify fuel details on property overview page and dataHealth dashboard Api are same ### response: //step_function: public void GivenIVerifyFuelDetailsOnPropertyOverviewPageAndDataHealthDashboardApiAreSame() throws Exception { String fuelType=propertyDetailsPage.getFuelUsageText(); System.out.println(fuelType); HashMap<String, String> fuelDetails=response.jsonPath().get("dashboardData[0].fuelDetails"); if(fuelDetails.containsKey("fuelOilConsumption") && fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil") && fuelType.contains("Natural Gas")); }else if(fuelDetails.containsKey("fuelOilConsumption")) { Assert.assertTrue(fuelType.contains("Fuel Oil")); }else if(fuelDetails.containsKey("naturalGasConsumption")) { Assert.assertTrue(fuelType.contains("Natural Gas")); }else { Assert.assertTrue(fuelType.contains("--")); } } //page_function: public String getFuelUsageText() { return fuelUsageType.getText(); }
DashboardAPISteps.java
I prepare API headers( and pass authkey)?
public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^I prepare API headers( and pass authkey)?$") public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); }
//step_function: public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I prepare API headers( and pass authkey)? ### response: //step_function: public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file)? I verify correct (.*) assign to (.*
public void ThenAfterFetchingDataFromDataFileIVerifyCorectProjectIdsAssignToLocationId(String file, String keyProjectID,String keyLocationId) throws FileNotFoundException, IOException { String valueProjectID=""; String valueLocationId=""; if((file!=null) && (file.contains("data file"))) { for(int index=1; index<3; index++) { valueProjectID=commonPage.fetchDataFromDataProperties(keyProjectID+index); valueLocationId=commonPage.fetchDataFromDataProperties(keyLocationId+index); int num=index-1; String apiResponseProjectMap=response.jsonPath().get("projectMap["+num+"].projectId"); String apiResponseTenantLocationMap=response.jsonPath().get("tenantLocationMap["+num+"].locationId"); Assert.assertTrue(valueProjectID.equals(apiResponseProjectMap)); Assert.assertTrue(valueLocationId.equals(apiResponseTenantLocationMap)); } } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("(After fetching data from data file)? I verify correct (.*) assign to (.*)$") public void ThenAfterFetchingDataFromDataFileIVerifyCorectProjectIdsAssignToLocationId(String file, String keyProjectID,String keyLocationId) throws FileNotFoundException, IOException { String valueProjectID=""; String valueLocationId=""; if((file!=null) && (file.contains("data file"))) { for(int index=1; index<3; index++) { valueProjectID=commonPage.fetchDataFromDataProperties(keyProjectID+index); valueLocationId=commonPage.fetchDataFromDataProperties(keyLocationId+index); int num=index-1; String apiResponseProjectMap=response.jsonPath().get("projectMap["+num+"].projectId"); String apiResponseTenantLocationMap=response.jsonPath().get("tenantLocationMap["+num+"].locationId"); Assert.assertTrue(valueProjectID.equals(apiResponseProjectMap)); Assert.assertTrue(valueLocationId.equals(apiResponseTenantLocationMap)); } } }
//step_function: public void ThenAfterFetchingDataFromDataFileIVerifyCorectProjectIdsAssignToLocationId(String file, String keyProjectID,String keyLocationId) throws FileNotFoundException, IOException { String valueProjectID=""; String valueLocationId=""; if((file!=null) && (file.contains("data file"))) { for(int index=1; index<3; index++) { valueProjectID=commonPage.fetchDataFromDataProperties(keyProjectID+index); valueLocationId=commonPage.fetchDataFromDataProperties(keyLocationId+index); int num=index-1; String apiResponseProjectMap=response.jsonPath().get("projectMap["+num+"].projectId"); String apiResponseTenantLocationMap=response.jsonPath().get("tenantLocationMap["+num+"].locationId"); Assert.assertTrue(valueProjectID.equals(apiResponseProjectMap)); Assert.assertTrue(valueLocationId.equals(apiResponseTenantLocationMap)); } } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I verify correct (.*) assign to (.* ### response: //step_function: public void ThenAfterFetchingDataFromDataFileIVerifyCorectProjectIdsAssignToLocationId(String file, String keyProjectID,String keyLocationId) throws FileNotFoundException, IOException { String valueProjectID=""; String valueLocationId=""; if((file!=null) && (file.contains("data file"))) { for(int index=1; index<3; index++) { valueProjectID=commonPage.fetchDataFromDataProperties(keyProjectID+index); valueLocationId=commonPage.fetchDataFromDataProperties(keyLocationId+index); int num=index-1; String apiResponseProjectMap=response.jsonPath().get("projectMap["+num+"].projectId"); String apiResponseTenantLocationMap=response.jsonPath().get("tenantLocationMap["+num+"].locationId"); Assert.assertTrue(valueProjectID.equals(apiResponseProjectMap)); Assert.assertTrue(valueLocationId.equals(apiResponseTenantLocationMap)); } } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I verify (.*) generation with (.*
public void verify_total_generation(String file, String key,String totalgen) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; double sumOfAllPlus=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } System.out.println("The total amount is "+sumOfAll); if(sumOfAll>100000){ sumOfAll=sumOfAll/10; sumOfAll=Math.round(sumOfAll); sumOfAll=sumOfAll/100; } sumOfAllPlus=sumOfAll+0.01; String val=df.format(sumOfAll); String valPlus=df.format(sumOfAllPlus); String total=getJsonPath(response,totalgen); assertTrue(val.equals(total)||(valPlus.equals(total))); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I verify (.*) generation with (.*)$") public void verify_total_generation(String file, String key,String totalgen) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; double sumOfAllPlus=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } System.out.println("The total amount is "+sumOfAll); if(sumOfAll>100000){ sumOfAll=sumOfAll/10; sumOfAll=Math.round(sumOfAll); sumOfAll=sumOfAll/100; } sumOfAllPlus=sumOfAll+0.01; String val=df.format(sumOfAll); String valPlus=df.format(sumOfAllPlus); String total=getJsonPath(response,totalgen); assertTrue(val.equals(total)||(valPlus.equals(total))); }
//step_function: public void verify_total_generation(String file, String key,String totalgen) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; double sumOfAllPlus=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } System.out.println("The total amount is "+sumOfAll); if(sumOfAll>100000){ sumOfAll=sumOfAll/10; sumOfAll=Math.round(sumOfAll); sumOfAll=sumOfAll/100; } sumOfAllPlus=sumOfAll+0.01; String val=df.format(sumOfAll); String valPlus=df.format(sumOfAllPlus); String total=getJsonPath(response,totalgen); assertTrue(val.equals(total)||(valPlus.equals(total))); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I verify (.*) generation with (.* ### response: //step_function: public void verify_total_generation(String file, String key,String totalgen) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; double sumOfAllPlus=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } System.out.println("The total amount is "+sumOfAll); if(sumOfAll>100000){ sumOfAll=sumOfAll/10; sumOfAll=Math.round(sumOfAll); sumOfAll=sumOfAll/100; } sumOfAllPlus=sumOfAll+0.01; String val=df.format(sumOfAll); String valPlus=df.format(sumOfAllPlus); String total=getJsonPath(response,totalgen); assertTrue(val.equals(total)||(valPlus.equals(total))); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I verify (.*) sunshine factor with (.*
public void verify_sunshine_factor(String file, String key,String totalSunshine) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } sumOfAll=sumOfAll/responseSize; String val=df.format(sumOfAll); System.out.println("The average amount is "+sumOfAll); String total=getJsonPath(response,totalSunshine); assertEquals(total,val); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I verify (.*) sunshine factor with (.*)") public void verify_sunshine_factor(String file, String key,String totalSunshine) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } sumOfAll=sumOfAll/responseSize; String val=df.format(sumOfAll); System.out.println("The average amount is "+sumOfAll); String total=getJsonPath(response,totalSunshine); assertEquals(total,val); }
//step_function: public void verify_sunshine_factor(String file, String key,String totalSunshine) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } sumOfAll=sumOfAll/responseSize; String val=df.format(sumOfAll); System.out.println("The average amount is "+sumOfAll); String total=getJsonPath(response,totalSunshine); assertEquals(total,val); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I verify (.*) sunshine factor with (.* ### response: //step_function: public void verify_sunshine_factor(String file, String key,String totalSunshine) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); double sumOfAll=0.0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); sumOfAll=sumOfAll+Double.parseDouble(arr[i]); } sumOfAll=sumOfAll/responseSize; String val=df.format(sumOfAll); System.out.println("The average amount is "+sumOfAll); String total=getJsonPath(response,totalSunshine); assertEquals(total,val); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
After fetching data from data file )?I verify (.*) rides saved with (.*
public void verifyRidesSaved(String file, String key,String totalRidesSaved) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); long sumOfAll=0; int sumOfAllMinus=0; int sumOfAllPlus=0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); if(arr[i].endsWith("K")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000; else if(arr[i].endsWith("M")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000000; else sumOfAll=sumOfAll+Long.parseLong(arr[i].trim()); } System.out.println("The total amount is "+sumOfAll); String total=getJsonPath(response,totalRidesSaved); String resultFlag; if(sumOfAll>1000000){ sumOfAll=sumOfAll/1000000; resultFlag="M"; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else if(sumOfAll>10000){ sumOfAll=sumOfAll/1000; resultFlag="K"; sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else { assertEquals(valueOf(sumOfAll),total); } System.out.println("Rides saved matched"); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I verify (.*) rides saved with (.*)$") public void verifyRidesSaved(String file, String key,String totalRidesSaved) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); long sumOfAll=0; int sumOfAllMinus=0; int sumOfAllPlus=0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); if(arr[i].endsWith("K")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000; else if(arr[i].endsWith("M")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000000; else sumOfAll=sumOfAll+Long.parseLong(arr[i].trim()); } System.out.println("The total amount is "+sumOfAll); String total=getJsonPath(response,totalRidesSaved); String resultFlag; if(sumOfAll>1000000){ sumOfAll=sumOfAll/1000000; resultFlag="M"; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else if(sumOfAll>10000){ sumOfAll=sumOfAll/1000; resultFlag="K"; sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else { assertEquals(valueOf(sumOfAll),total); } System.out.println("Rides saved matched"); }
//step_function: public void verifyRidesSaved(String file, String key,String totalRidesSaved) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); long sumOfAll=0; int sumOfAllMinus=0; int sumOfAllPlus=0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); if(arr[i].endsWith("K")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000; else if(arr[i].endsWith("M")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000000; else sumOfAll=sumOfAll+Long.parseLong(arr[i].trim()); } System.out.println("The total amount is "+sumOfAll); String total=getJsonPath(response,totalRidesSaved); String resultFlag; if(sumOfAll>1000000){ sumOfAll=sumOfAll/1000000; resultFlag="M"; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else if(sumOfAll>10000){ sumOfAll=sumOfAll/1000; resultFlag="K"; sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else { assertEquals(valueOf(sumOfAll),total); } System.out.println("Rides saved matched"); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I verify (.*) rides saved with (.* ### response: //step_function: public void verifyRidesSaved(String file, String key,String totalRidesSaved) throws IOException { if((file!=null) && (file.contains("data file"))) key=commonPage.fetchDataFromDataProperties(key); String value=getJsonPath(response,key); int l=value.length(); value=getJsonPath(response,key).substring(1, (l-1)); long sumOfAll=0; int sumOfAllMinus=0; int sumOfAllPlus=0; int responseSize=0; responseSize=response.body().jsonPath().getList("cityPerformanceDataTOs").size(); String[] arr = null; arr=value.split(","); for(int i=0;i<responseSize;i++){ System.out.println("The amount value fetched is "+arr[i]); assertFalse(arr[i].startsWith("-")); if(arr[i].endsWith("K")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000; else if(arr[i].endsWith("M")) sumOfAll=sumOfAll+(Long.parseLong(arr[i].substring(0,arr[i].length()-1).trim()))*1000000; else sumOfAll=sumOfAll+Long.parseLong(arr[i].trim()); } System.out.println("The total amount is "+sumOfAll); String total=getJsonPath(response,totalRidesSaved); String resultFlag; if(sumOfAll>1000000){ sumOfAll=sumOfAll/1000000; resultFlag="M"; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else if(sumOfAll>10000){ sumOfAll=sumOfAll/1000; resultFlag="K"; sumOfAllMinus=(int)sumOfAll-1; sumOfAllPlus=(int)sumOfAll+1; assertTrue(total.endsWith(resultFlag)); total=total.substring(0, total.length()-1); assertTrue((valueOf(sumOfAll).equals(total))||(valueOf(sumOfAllPlus).equals(total))||(valueOf(sumOfAllMinus).equals(total))); }else { assertEquals(valueOf(sumOfAll),total); } System.out.println("Rides saved matched"); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardAPISteps.java
I fetch value of (.*) from response of (.*) API and write to data file
public void writeToDataFileFromResponse(String key, String apiName) throws IOException { String value=getJsonPath(response,key); if(apiName.contains("history")) { docId=value; System.out.println("doc id value is: "+docId); commonPage.writeToDataProperties(docId); } }
public void writeToDataProperties(String value) throws IOException { properties=new Properties(); properties.put("docId", value); outputStream = new FileOutputStream(".\\data.properties"); properties.replace("docId", value); properties.store(outputStream, "docId Stored successfully!!"); }
@When("^I fetch value of (.*) from response of (.*) API and write to data file$") public void writeToDataFileFromResponse(String key, String apiName) throws IOException { String value=getJsonPath(response,key); if(apiName.contains("history")) { docId=value; System.out.println("doc id value is: "+docId); commonPage.writeToDataProperties(docId); } }
//step_function: public void writeToDataFileFromResponse(String key, String apiName) throws IOException { String value=getJsonPath(response,key); if(apiName.contains("history")) { docId=value; System.out.println("doc id value is: "+docId); commonPage.writeToDataProperties(docId); } } //page_function: public void writeToDataProperties(String value) throws IOException { properties=new Properties(); properties.put("docId", value); outputStream = new FileOutputStream(".\\data.properties"); properties.replace("docId", value); properties.store(outputStream, "docId Stored successfully!!"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I fetch value of (.*) from response of (.*) API and write to data file ### response: //step_function: public void writeToDataFileFromResponse(String key, String apiName) throws IOException { String value=getJsonPath(response,key); if(apiName.contains("history")) { docId=value; System.out.println("doc id value is: "+docId); commonPage.writeToDataProperties(docId); } } //page_function: public void writeToDataProperties(String value) throws IOException { properties=new Properties(); properties.put("docId", value); outputStream = new FileOutputStream(".\\data.properties"); properties.replace("docId", value); properties.store(outputStream, "docId Stored successfully!!"); }
DashboardAPISteps.java
After fetching data from data file )?I set request specification with the (.*) API and (.*) for customer id (\\d+) with headers
public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I set request specification with the (.*) API and (.*) for customer id (\\d+) with headers$") public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); }
//step_function: public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I set request specification with the (.*) API and (.*) for customer id (\\d+) with headers ### response: //step_function: public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DashboardScreenSteps.java
I should successfully land to dashboard
public void reachedDashboard(){ dashboardPage.reachedDashboard(); }
public void reachedDashboard() { waitFor(logoutLink); }
@Then("^I should successfully land to dashboard$") public void reachedDashboard(){ dashboardPage.reachedDashboard(); }
//step_function: public void reachedDashboard(){ dashboardPage.reachedDashboard(); } //page_function: public void reachedDashboard() { waitFor(logoutLink); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I should successfully land to dashboard ### response: //step_function: public void reachedDashboard(){ dashboardPage.reachedDashboard(); } //page_function: public void reachedDashboard() { waitFor(logoutLink); }
DashboardScreenSteps.java
I click on Sign Out on dashboard
public void clickSignOut(){ dashboardPage.signOut(); }
public void signOut() { waitFor(logoutLink); clickOn(logoutLink); }
@When("^I click on Sign Out on dashboard$") public void clickSignOut(){ dashboardPage.signOut(); }
//step_function: public void clickSignOut(){ dashboardPage.signOut(); } //page_function: public void signOut() { waitFor(logoutLink); clickOn(logoutLink); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on Sign Out on dashboard ### response: //step_function: public void clickSignOut(){ dashboardPage.signOut(); } //page_function: public void signOut() { waitFor(logoutLink); clickOn(logoutLink); }
DashboardScreenSteps.java
I verify that (project|location) dropdown list is same as list of individual (projects|locations) in dashboard
public void verifyProjectLists(String projectOrLocationsDropdown, String individualProjectsOrLocations){ if((projectOrLocationsDropdown.contains("project"))&&(individualProjectsOrLocations.contains("project"))) { dashboardPage.verifyProjectLists(); }else if((projectOrLocationsDropdown.contains("location"))&&(individualProjectsOrLocations.contains("location"))) { dashboardPage.verifyLocationLists(); } }
public void verifyProjectLists() { waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); List<WebElement> dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); List<String> dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { dropdownList.add(dropdownProjectList.get(i).getText()); System.out.println("dropdown project " + i + " : " + dropdownList.get(i)); }
@Then("^I verify that (project|location) dropdown list is same as list of individual (projects|locations) in dashboard$") public void verifyProjectLists(String projectOrLocationsDropdown, String individualProjectsOrLocations){ if((projectOrLocationsDropdown.contains("project"))&&(individualProjectsOrLocations.contains("project"))) { dashboardPage.verifyProjectLists(); }else if((projectOrLocationsDropdown.contains("location"))&&(individualProjectsOrLocations.contains("location"))) { dashboardPage.verifyLocationLists(); } }
//step_function: public void verifyProjectLists(String projectOrLocationsDropdown, String individualProjectsOrLocations){ if((projectOrLocationsDropdown.contains("project"))&&(individualProjectsOrLocations.contains("project"))) { dashboardPage.verifyProjectLists(); }else if((projectOrLocationsDropdown.contains("location"))&&(individualProjectsOrLocations.contains("location"))) { dashboardPage.verifyLocationLists(); } } //page_function: public void verifyProjectLists() { waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); List<WebElement> dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); List<String> dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { dropdownList.add(dropdownProjectList.get(i).getText()); System.out.println("dropdown project " + i + " : " + dropdownList.get(i)); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify that (project|location) dropdown list is same as list of individual (projects|locations) in dashboard ### response: //step_function: public void verifyProjectLists(String projectOrLocationsDropdown, String individualProjectsOrLocations){ if((projectOrLocationsDropdown.contains("project"))&&(individualProjectsOrLocations.contains("project"))) { dashboardPage.verifyProjectLists(); }else if((projectOrLocationsDropdown.contains("location"))&&(individualProjectsOrLocations.contains("location"))) { dashboardPage.verifyLocationLists(); } } //page_function: public void verifyProjectLists() { waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); List<WebElement> dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); List<String> dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { dropdownList.add(dropdownProjectList.get(i).getText()); System.out.println("dropdown project " + i + " : " + dropdownList.get(i)); }
DashboardScreenSteps.java
I verify the individual (projects|locations) in dashboard
public void verifyIndividualProjects(String projectOrLocation) { if(projectOrLocation.contains("project")) { dashboardPage.verifyIndividualProjects(); } else if(projectOrLocation.contains("location")) { dashboardPage.verifyIndividualLocations(); } }
public void verifyIndividualProjects(){ individualProjectList = getDriver().findElements(By.xpath("//p[@class='MuiTypography-root MuiTypography-body1 css-fb8gxk']")); for (int i = 0; i < individualProjectList.size(); i++) { System.out.println("individual project " + i + " : " + individualProjectList.get(i).getText()); js = (JavascriptExecutor) getDriver(); clickOn(individualProjectList.get(i)); assertTrue(dashboardButton.isPresent()); clickOn(dashboardButton); individualProjectList = getDriver().findElements(By.xpath("//p[@class='MuiTypography-root MuiTypography-body1 css-fb8gxk']")); if (viewMoreButton.isPresent()) { WebElement element = getDriver().findElement(By.xpath("//p[text()='View More']")); js.executeScript("arguments[0].scrollIntoView(true);", element); js.executeScript("arguments[0].click();", element); }
@Then("^I verify the individual (projects|locations) in dashboard$") public void verifyIndividualProjects(String projectOrLocation) { if(projectOrLocation.contains("project")) { dashboardPage.verifyIndividualProjects(); } else if(projectOrLocation.contains("location")) { dashboardPage.verifyIndividualLocations(); } }
//step_function: public void verifyIndividualProjects(String projectOrLocation) { if(projectOrLocation.contains("project")) { dashboardPage.verifyIndividualProjects(); } else if(projectOrLocation.contains("location")) { dashboardPage.verifyIndividualLocations(); } } //page_function: public void verifyIndividualProjects(){ individualProjectList = getDriver().findElements(By.xpath("//p[@class='MuiTypography-root MuiTypography-body1 css-fb8gxk']")); for (int i = 0; i < individualProjectList.size(); i++) { System.out.println("individual project " + i + " : " + individualProjectList.get(i).getText()); js = (JavascriptExecutor) getDriver(); clickOn(individualProjectList.get(i)); assertTrue(dashboardButton.isPresent()); clickOn(dashboardButton); individualProjectList = getDriver().findElements(By.xpath("//p[@class='MuiTypography-root MuiTypography-body1 css-fb8gxk']")); if (viewMoreButton.isPresent()) { WebElement element = getDriver().findElement(By.xpath("//p[text()='View More']")); js.executeScript("arguments[0].scrollIntoView(true);", element); js.executeScript("arguments[0].click();", element); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify the individual (projects|locations) in dashboard ### response: //step_function: public void verifyIndividualProjects(String projectOrLocation) { if(projectOrLocation.contains("project")) { dashboardPage.verifyIndividualProjects(); } else if(projectOrLocation.contains("location")) { dashboardPage.verifyIndividualLocations(); } } //page_function: public void verifyIndividualProjects(){ individualProjectList = getDriver().findElements(By.xpath("//p[@class='MuiTypography-root MuiTypography-body1 css-fb8gxk']")); for (int i = 0; i < individualProjectList.size(); i++) { System.out.println("individual project " + i + " : " + individualProjectList.get(i).getText()); js = (JavascriptExecutor) getDriver(); clickOn(individualProjectList.get(i)); assertTrue(dashboardButton.isPresent()); clickOn(dashboardButton); individualProjectList = getDriver().findElements(By.xpath("//p[@class='MuiTypography-root MuiTypography-body1 css-fb8gxk']")); if (viewMoreButton.isPresent()) { WebElement element = getDriver().findElement(By.xpath("//p[text()='View More']")); js.executeScript("arguments[0].scrollIntoView(true);", element); js.executeScript("arguments[0].click();", element); }
DashboardScreenSteps.java
I verify that (project|location) dropdown list (projects|locations) in dashboard
public void verifyLeftPannelProjects(String locationOrProjectDropdown, String projectsOrLocations) { dashboardPage.verifyLeftPannelProjectsOrLocations(); }
public void verifyLeftPannelProjectsOrLocations(){ waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); List<String> findAProjectTexts=new ArrayList<String>(); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { if(i!=0) { findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); findAProjectOrLocation.click(); waitABit(1000); }
@Then("^I verify that (project|location) dropdown list (projects|locations) in dashboard$") public void verifyLeftPannelProjects(String locationOrProjectDropdown, String projectsOrLocations) { dashboardPage.verifyLeftPannelProjectsOrLocations(); }
//step_function: public void verifyLeftPannelProjects(String locationOrProjectDropdown, String projectsOrLocations) { dashboardPage.verifyLeftPannelProjectsOrLocations(); } //page_function: public void verifyLeftPannelProjectsOrLocations(){ waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); List<String> findAProjectTexts=new ArrayList<String>(); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { if(i!=0) { findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); findAProjectOrLocation.click(); waitABit(1000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify that (project|location) dropdown list (projects|locations) in dashboard ### response: //step_function: public void verifyLeftPannelProjects(String locationOrProjectDropdown, String projectsOrLocations) { dashboardPage.verifyLeftPannelProjectsOrLocations(); } //page_function: public void verifyLeftPannelProjectsOrLocations(){ waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); List<String> findAProjectTexts=new ArrayList<String>(); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { if(i!=0) { findAProjectOrLocation = getDriver().findElement(By.xpath("//div[@id='demo-simple-select-outlined']/span")); findAProjectOrLocation.click(); waitABit(1000); }
DashboardScreenSteps.java
I click on the (Carbon|Billing|Data Health|Income|Documents|\'Help And Support\') button in left panel of dashboard
public void click_Carbon_Billing(String value) { if(value.contains("Carbon")) dashboardPage.clickCarbon(); else if(value.contains("Billing")) dashboardPage.clickBilling(); else if(value.contains("Data Health")) dashboardPage.clickDataHealth(); else if(value.contains("Help And Support")) dashboardPage.clickHelpAndSupport(); else if(value.contains("Income")) dashboardPage.clickIncome(); else if(value.contains("Documents")) dashboardPage.clickDocuments(); }
public void clickCarbon() { waitFor(carbonButton); clickOn(carbonButton); }
@Then("^I click on the (Carbon|Billing|Data Health|Income|Documents|\'Help And Support\') button in left panel of dashboard$") public void click_Carbon_Billing(String value) { if(value.contains("Carbon")) dashboardPage.clickCarbon(); else if(value.contains("Billing")) dashboardPage.clickBilling(); else if(value.contains("Data Health")) dashboardPage.clickDataHealth(); else if(value.contains("Help And Support")) dashboardPage.clickHelpAndSupport(); else if(value.contains("Income")) dashboardPage.clickIncome(); else if(value.contains("Documents")) dashboardPage.clickDocuments(); }
//step_function: public void click_Carbon_Billing(String value) { if(value.contains("Carbon")) dashboardPage.clickCarbon(); else if(value.contains("Billing")) dashboardPage.clickBilling(); else if(value.contains("Data Health")) dashboardPage.clickDataHealth(); else if(value.contains("Help And Support")) dashboardPage.clickHelpAndSupport(); else if(value.contains("Income")) dashboardPage.clickIncome(); else if(value.contains("Documents")) dashboardPage.clickDocuments(); } //page_function: public void clickCarbon() { waitFor(carbonButton); clickOn(carbonButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on the (Carbon|Billing|Data Health|Income|Documents|\'Help And Support\') button in left panel of dashboard ### response: //step_function: public void click_Carbon_Billing(String value) { if(value.contains("Carbon")) dashboardPage.clickCarbon(); else if(value.contains("Billing")) dashboardPage.clickBilling(); else if(value.contains("Data Health")) dashboardPage.clickDataHealth(); else if(value.contains("Help And Support")) dashboardPage.clickHelpAndSupport(); else if(value.contains("Income")) dashboardPage.clickIncome(); else if(value.contains("Documents")) dashboardPage.clickDocuments(); } //page_function: public void clickCarbon() { waitFor(carbonButton); clickOn(carbonButton); }
DashboardScreenSteps.java
I verify Project list for (Carbon|Billing
public void verifyCarbon_Billing_IndividualProjects(String value) { dashboardPage.verifyCarbon_Billing_IndividualProjects(value); }
public void verifyCarbon_Billing_IndividualProjects(String value) { waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("(//div[@id='demo-simple-select-outlined'])[2]")); List<String> findAProjectTexts=new ArrayList<String>(); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { if(i!=0) { findAProjectOrLocation = getDriver().findElement(By.xpath("(//div[@id='demo-simple-select-outlined'])[2]")); findAProjectOrLocation.click(); waitABit(1000); }
@Then("^I verify Project list for (Carbon|Billing)$") public void verifyCarbon_Billing_IndividualProjects(String value) { dashboardPage.verifyCarbon_Billing_IndividualProjects(value); }
//step_function: public void verifyCarbon_Billing_IndividualProjects(String value) { dashboardPage.verifyCarbon_Billing_IndividualProjects(value); } //page_function: public void verifyCarbon_Billing_IndividualProjects(String value) { waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("(//div[@id='demo-simple-select-outlined'])[2]")); List<String> findAProjectTexts=new ArrayList<String>(); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { if(i!=0) { findAProjectOrLocation = getDriver().findElement(By.xpath("(//div[@id='demo-simple-select-outlined'])[2]")); findAProjectOrLocation.click(); waitABit(1000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify Project list for (Carbon|Billing ### response: //step_function: public void verifyCarbon_Billing_IndividualProjects(String value) { dashboardPage.verifyCarbon_Billing_IndividualProjects(value); } //page_function: public void verifyCarbon_Billing_IndividualProjects(String value) { waitFor(findAProjectOrLocationDropdown); findAProjectOrLocation = getDriver().findElement(By.xpath("(//div[@id='demo-simple-select-outlined'])[2]")); List<String> findAProjectTexts=new ArrayList<String>(); System.out.println("Project dropdown is: " + findAProjectOrLocation.isEnabled()); assertTrue(findAProjectOrLocation.isEnabled()); js = (JavascriptExecutor) getDriver(); js.executeScript("arguments[0].click();", findAProjectOrLocation); findAProjectOrLocation.click(); waitABit(1000); dropdownProjectList = getDriver().findElements(By.xpath("//ul[@role='listbox']/li")); dropdownList = new ArrayList<String>(); for (int i = 0; i < dropdownProjectList.size(); i++) { if(i!=0) { findAProjectOrLocation = getDriver().findElement(By.xpath("(//div[@id='demo-simple-select-outlined'])[2]")); findAProjectOrLocation.click(); waitABit(1000); }
DashboardScreenSteps.java
I verify No payment available is displayed
public void verifyNoPaymentavailable() { dashboardPage.verifyNoPaymentavailable(); }
public void verifyNoPaymentavailable() { waitFor(noPaymentText); assertEquals(noPaymentText.getText(), "No payment available"); }
@Then("^I verify No payment available is displayed$") public void verifyNoPaymentavailable() { dashboardPage.verifyNoPaymentavailable(); }
//step_function: public void verifyNoPaymentavailable() { dashboardPage.verifyNoPaymentavailable(); } //page_function: public void verifyNoPaymentavailable() { waitFor(noPaymentText); assertEquals(noPaymentText.getText(), "No payment available"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify No payment available is displayed ### response: //step_function: public void verifyNoPaymentavailable() { dashboardPage.verifyNoPaymentavailable(); } //page_function: public void verifyNoPaymentavailable() { waitFor(noPaymentText); assertEquals(noPaymentText.getText(), "No payment available"); }
DashboardScreenSteps.java
I verify No document available is displayed
public void verifyNoDocumentavailable() { dashboardPage.verifyNoDocumentavailable(); }
public void verifyNoDocumentavailable() { waitFor(noDocumentText); assertEquals(noDocumentText.getText(), "No document available"); }
@Then("^I verify No document available is displayed$") public void verifyNoDocumentavailable() { dashboardPage.verifyNoDocumentavailable(); }
//step_function: public void verifyNoDocumentavailable() { dashboardPage.verifyNoDocumentavailable(); } //page_function: public void verifyNoDocumentavailable() { waitFor(noDocumentText); assertEquals(noDocumentText.getText(), "No document available"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify No document available is displayed ### response: //step_function: public void verifyNoDocumentavailable() { dashboardPage.verifyNoDocumentavailable(); } //page_function: public void verifyNoDocumentavailable() { waitFor(noDocumentText); assertEquals(noDocumentText.getText(), "No document available"); }
DashboardScreenSteps.java
I click on (tenant|landlord) tab of side navigation bar
public void clickTenantLandlordTab(String tenantOrLandlordTab) { if(tenantOrLandlordTab.toLowerCase().contains("tenant")) { dashboardPage.clickTenantTab(); }else if(tenantOrLandlordTab.toLowerCase().contains("landlord")) { dashboardPage.clickLandlordTab(); } } }
public void clickTenantTab() { waitFor(tenantTab); clickOn(tenantTab); }
@When("^I click on (tenant|landlord) tab of side navigation bar$") public void clickTenantLandlordTab(String tenantOrLandlordTab) { if(tenantOrLandlordTab.toLowerCase().contains("tenant")) { dashboardPage.clickTenantTab(); }else if(tenantOrLandlordTab.toLowerCase().contains("landlord")) { dashboardPage.clickLandlordTab(); } } }
//step_function: public void clickTenantLandlordTab(String tenantOrLandlordTab) { if(tenantOrLandlordTab.toLowerCase().contains("tenant")) { dashboardPage.clickTenantTab(); }else if(tenantOrLandlordTab.toLowerCase().contains("landlord")) { dashboardPage.clickLandlordTab(); } } } //page_function: public void clickTenantTab() { waitFor(tenantTab); clickOn(tenantTab); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on (tenant|landlord) tab of side navigation bar ### response: //step_function: public void clickTenantLandlordTab(String tenantOrLandlordTab) { if(tenantOrLandlordTab.toLowerCase().contains("tenant")) { dashboardPage.clickTenantTab(); }else if(tenantOrLandlordTab.toLowerCase().contains("landlord")) { dashboardPage.clickLandlordTab(); } } } //page_function: public void clickTenantTab() { waitFor(tenantTab); clickOn(tenantTab); }
DataHealthSteps.java
After fetching data from data file )?I upload (.*) Utility bill document
public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); dataHealthPagePage.uploadDocument(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I upload (.*) Utility bill document$") public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); dataHealthPagePage.uploadDocument(value); }
//step_function: public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); dataHealthPagePage.uploadDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I upload (.*) Utility bill document ### response: //step_function: public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); dataHealthPagePage.uploadDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
DataHealthSteps.java
After fetching data from data file )?I choose (.*) from Utility provider dropdown
public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); dataHealthPagePage.selectUtilityProvider(utilityProvider); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@And("^(After fetching data from data file )?I choose (.*) from Utility provider dropdown$") public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); dataHealthPagePage.selectUtilityProvider(utilityProvider); }
//step_function: public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); dataHealthPagePage.selectUtilityProvider(utilityProvider); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I choose (.*) from Utility provider dropdown ### response: //step_function: public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); dataHealthPagePage.selectUtilityProvider(utilityProvider); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
FetchLoginOTPviaEmailSteps.java
I enter the correct Email OTP in Login screen
public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } }
public String openNewTabAndSwitch() throws InterruptedException { WebDriver driver = getDriver(); //Keys.chord(Keys.CONTROL,"T"); enter(Keys.CONTROL+"t").into(enterEmail_txt); wait(5000); String newTabID = (String)(driver.getWindowHandles().stream().toArray())[1]; driver.switchTo().window(newTabID); return newTabID; }
@And("^I enter the correct Email OTP in Login screen$") public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } }
//step_function: public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } } //page_function: public String openNewTabAndSwitch() throws InterruptedException { WebDriver driver = getDriver(); //Keys.chord(Keys.CONTROL,"T"); enter(Keys.CONTROL+"t").into(enterEmail_txt); wait(5000); String newTabID = (String)(driver.getWindowHandles().stream().toArray())[1]; driver.switchTo().window(newTabID); return newTabID; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter the correct Email OTP in Login screen ### response: //step_function: public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } } //page_function: public String openNewTabAndSwitch() throws InterruptedException { WebDriver driver = getDriver(); //Keys.chord(Keys.CONTROL,"T"); enter(Keys.CONTROL+"t").into(enterEmail_txt); wait(5000); String newTabID = (String)(driver.getWindowHandles().stream().toArray())[1]; driver.switchTo().window(newTabID); return newTabID; }
HelpAndSupportSteps.java
After fetching data from data file )?I validate that (.*) field is prepopulated with (.*) value
public void verifyFieldIsPrepopulatedWithValue(String file, String field, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) { helpAndSupportPage.verifyFieldsPrepopulated(field, commonPage.fetchDataFromDataProperties(value)); } else{ helpAndSupportPage.verifyFieldsPrepopulated(field, value); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I validate that (.*) field is prepopulated with (.*) value$") public void verifyFieldIsPrepopulatedWithValue(String file, String field, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) { helpAndSupportPage.verifyFieldsPrepopulated(field, commonPage.fetchDataFromDataProperties(value)); } else{ helpAndSupportPage.verifyFieldsPrepopulated(field, value); } }
//step_function: public void verifyFieldIsPrepopulatedWithValue(String file, String field, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) { helpAndSupportPage.verifyFieldsPrepopulated(field, commonPage.fetchDataFromDataProperties(value)); } else{ helpAndSupportPage.verifyFieldsPrepopulated(field, value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I validate that (.*) field is prepopulated with (.*) value ### response: //step_function: public void verifyFieldIsPrepopulatedWithValue(String file, String field, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) { helpAndSupportPage.verifyFieldsPrepopulated(field, commonPage.fetchDataFromDataProperties(value)); } else{ helpAndSupportPage.verifyFieldsPrepopulated(field, value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
HelpAndSupportSteps.java
I enter value (.*) in description textarea
public void enterDescription(String value) { helpAndSupportPage.enterEmailContent(value); }
public void enterEmailContent(String value) { typeInto(descriptionTextarea,value); }
@When("^I enter value (.*) in description textarea$") public void enterDescription(String value) { helpAndSupportPage.enterEmailContent(value); }
//step_function: public void enterDescription(String value) { helpAndSupportPage.enterEmailContent(value); } //page_function: public void enterEmailContent(String value) { typeInto(descriptionTextarea,value); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter value (.*) in description textarea ### response: //step_function: public void enterDescription(String value) { helpAndSupportPage.enterEmailContent(value); } //page_function: public void enterEmailContent(String value) { typeInto(descriptionTextarea,value); }
HelpAndSupportSteps.java
I click on Request Information button on \'Help And Support\' screen
public void clickRequestInformationButton() { helpAndSupportPage.clickRequestInformationButton(); }
public void clickRequestInformationButton() { clickOn(requestInformationButton); }
@When("^I click on Request Information button on \'Help And Support\' screen$") public void clickRequestInformationButton() { helpAndSupportPage.clickRequestInformationButton(); }
//step_function: public void clickRequestInformationButton() { helpAndSupportPage.clickRequestInformationButton(); } //page_function: public void clickRequestInformationButton() { clickOn(requestInformationButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on Request Information button on \'Help And Support\' screen ### response: //step_function: public void clickRequestInformationButton() { helpAndSupportPage.clickRequestInformationButton(); } //page_function: public void clickRequestInformationButton() { clickOn(requestInformationButton); }
HelpAndSupportSteps.java
I validate that Email is successfully sent
public void validateEmailSent() { helpAndSupportPage.validateEmailSentSuccessfully(); } }
public void validateEmailSentSuccessfully() { waitFor(emailSentSuccessfullyMessage); }
@Then("^I validate that Email is successfully sent$") public void validateEmailSent() { helpAndSupportPage.validateEmailSentSuccessfully(); } }
//step_function: public void validateEmailSent() { helpAndSupportPage.validateEmailSentSuccessfully(); } } //page_function: public void validateEmailSentSuccessfully() { waitFor(emailSentSuccessfullyMessage); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I validate that Email is successfully sent ### response: //step_function: public void validateEmailSent() { helpAndSupportPage.validateEmailSentSuccessfully(); } } //page_function: public void validateEmailSentSuccessfully() { waitFor(emailSentSuccessfullyMessage); }
LoginFirstScreenSteps.java
After fetching data from data file )?I enter value (.*) in email or mobile textfield
public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I enter value (.*) in email or mobile textfield$") public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); }
//step_function: public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter value (.*) in email or mobile textfield ### response: //step_function: public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
LoginFirstScreenSteps.java
I click Send me a Code button
public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); }
public void clickLoginSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); }
@And("^I click Send me a Code button$") public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); }
//step_function: public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); } //page_function: public void clickLoginSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click Send me a Code button ### response: //step_function: public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); } //page_function: public void clickLoginSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); }
LoginFirstScreenSteps.java
I get error message (.*) for email or mobile textfield
public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); }
public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
@Then("^I get error message (.*) for email or mobile textfield$") public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); }
//step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I get error message (.*) for email or mobile textfield ### response: //step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
LoginFirstScreenSteps.java
After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield
public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield$") public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); }
//step_function: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield ### response: //step_function: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
LoginFirstScreenSteps.java
I (dont )?see default text (.*) in email or mobile textfield
public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); }
public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { Assert.assertEquals("true",emailOrMobileTextFieldLabel.getAttribute("data-shrink")); }
@When("^I (dont )?see default text (.*) in email or mobile textfield$") public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); }
//step_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); } //page_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { Assert.assertEquals("true",emailOrMobileTextFieldLabel.getAttribute("data-shrink")); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I (dont )?see default text (.*) in email or mobile textfield ### response: //step_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); } //page_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { Assert.assertEquals("true",emailOrMobileTextFieldLabel.getAttribute("data-shrink")); }
LoginFirstScreenSteps.java
I see static text (.*) in Login screen
public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); }
public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; default: throw new Exception("This Expected Static Text in feature file is not present in the list of expected static texts in switch case or Enum file"); }
@Then("^I see static text (.*) in Login screen$") public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); }
//step_function: public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); } //page_function: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; default: throw new Exception("This Expected Static Text in feature file is not present in the list of expected static texts in switch case or Enum file"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I see static text (.*) in Login screen ### response: //step_function: public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); } //page_function: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; default: throw new Exception("This Expected Static Text in feature file is not present in the list of expected static texts in switch case or Enum file"); }
LoginFirstScreenSteps.java
I see secondary static text (.*) in Login screen
public void validateSecondaryStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateSecondaryStaticText(expectedStaticText); }
public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; default: throw new Exception("This Expected Static Text in feature file is not present in the list of expected static texts in switch case or Enum file"); }
@Then("^I see secondary static text (.*) in Login screen$") public void validateSecondaryStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateSecondaryStaticText(expectedStaticText); }
//step_function: public void validateSecondaryStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateSecondaryStaticText(expectedStaticText); } //page_function: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; default: throw new Exception("This Expected Static Text in feature file is not present in the list of expected static texts in switch case or Enum file"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I see secondary static text (.*) in Login screen ### response: //step_function: public void validateSecondaryStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateSecondaryStaticText(expectedStaticText); } //page_function: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN1_SECONDARY_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=LoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; default: throw new Exception("This Expected Static Text in feature file is not present in the list of expected static texts in switch case or Enum file"); }
LoginFirstScreenSteps.java
I should successfully land to Login screen
public void validateLandedOnLoginScreen() throws Exception { loginFirstScreenPage.validateLandedOnLoginScreen(); }
public void validateLandedOnLoginScreen() { waitFor(sendMeACodeButton); }
@Then("^I should successfully land to Login screen$") public void validateLandedOnLoginScreen() throws Exception { loginFirstScreenPage.validateLandedOnLoginScreen(); }
//step_function: public void validateLandedOnLoginScreen() throws Exception { loginFirstScreenPage.validateLandedOnLoginScreen(); } //page_function: public void validateLandedOnLoginScreen() { waitFor(sendMeACodeButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I should successfully land to Login screen ### response: //step_function: public void validateLandedOnLoginScreen() throws Exception { loginFirstScreenPage.validateLandedOnLoginScreen(); } //page_function: public void validateLandedOnLoginScreen() { waitFor(sendMeACodeButton); }
LoginFirstScreenSteps.java
I (dont )?give consent to send me a Code to my mobile number
public void giveOTPConsentForMobile(String dontFlag) throws Exception { if(dontFlag==null) loginFirstScreenPage.giveOTPConsentForMobile(); else loginFirstScreenPage.dontGiveOTPConsentForMobile(); } }
public void giveOTPConsentForMobile() { mobileOtpConsentCheckbox=getDriver().findElement(By.xpath("//input[@type='checkbox']")); JavascriptExecutor js=(JavascriptExecutor)getDriver(); if(!mobileOtpConsentCheckbox.isSelected()) js.executeScript("arguments[0].click();", mobileOtpConsentCheckbox); }
@Then("^I (dont )?give consent to send me a Code to my mobile number$") public void giveOTPConsentForMobile(String dontFlag) throws Exception { if(dontFlag==null) loginFirstScreenPage.giveOTPConsentForMobile(); else loginFirstScreenPage.dontGiveOTPConsentForMobile(); } }
//step_function: public void giveOTPConsentForMobile(String dontFlag) throws Exception { if(dontFlag==null) loginFirstScreenPage.giveOTPConsentForMobile(); else loginFirstScreenPage.dontGiveOTPConsentForMobile(); } } //page_function: public void giveOTPConsentForMobile() { mobileOtpConsentCheckbox=getDriver().findElement(By.xpath("//input[@type='checkbox']")); JavascriptExecutor js=(JavascriptExecutor)getDriver(); if(!mobileOtpConsentCheckbox.isSelected()) js.executeScript("arguments[0].click();", mobileOtpConsentCheckbox); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I (dont )?give consent to send me a Code to my mobile number ### response: //step_function: public void giveOTPConsentForMobile(String dontFlag) throws Exception { if(dontFlag==null) loginFirstScreenPage.giveOTPConsentForMobile(); else loginFirstScreenPage.dontGiveOTPConsentForMobile(); } } //page_function: public void giveOTPConsentForMobile() { mobileOtpConsentCheckbox=getDriver().findElement(By.xpath("//input[@type='checkbox']")); JavascriptExecutor js=(JavascriptExecutor)getDriver(); if(!mobileOtpConsentCheckbox.isSelected()) js.executeScript("arguments[0].click();", mobileOtpConsentCheckbox); }
LoginSecondScreenSteps.java
I click on Submit button on Login screen
public void submit() { loginSecondScreenPage.submitLogin(); }
public void submitLogin() { otpTextFields.submit(); waitABit(10000); }
@When("^I click on Submit button on Login screen$") public void submit() { loginSecondScreenPage.submitLogin(); }
//step_function: public void submit() { loginSecondScreenPage.submitLogin(); } //page_function: public void submitLogin() { otpTextFields.submit(); waitABit(10000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on Submit button on Login screen ### response: //step_function: public void submit() { loginSecondScreenPage.submitLogin(); } //page_function: public void submitLogin() { otpTextFields.submit(); waitABit(10000); }
LoginSecondScreenSteps.java
I enter the incorrect OTP (.*) in Login screen
public void enterIncorrectOTP(String incorrectOtp) { loginSecondScreenPage.enterOtp(incorrectOtp); }
public void enterOtp(String correctOtp) { waitFor(otpTextFields); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); waitABit(200); typeInto(otpTextFields,correctOtp); }
@When("^I enter the incorrect OTP (.*) in Login screen$") public void enterIncorrectOTP(String incorrectOtp) { loginSecondScreenPage.enterOtp(incorrectOtp); }
//step_function: public void enterIncorrectOTP(String incorrectOtp) { loginSecondScreenPage.enterOtp(incorrectOtp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); waitABit(200); typeInto(otpTextFields,correctOtp); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter the incorrect OTP (.*) in Login screen ### response: //step_function: public void enterIncorrectOTP(String incorrectOtp) { loginSecondScreenPage.enterOtp(incorrectOtp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); waitABit(200); typeInto(otpTextFields,correctOtp); }
LoginSecondScreenSteps.java
I (dont )?get error message (.*) for OTP textfields
public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; loginSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginSecondScreenPage.validateErrorMessage(expectedError); } }
public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
@Then("^I (dont )?get error message (.*) for OTP textfields$") public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; loginSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginSecondScreenPage.validateErrorMessage(expectedError); } }
//step_function: public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; loginSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginSecondScreenPage.validateErrorMessage(expectedError); } } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I (dont )?get error message (.*) for OTP textfields ### response: //step_function: public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; loginSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginSecondScreenPage.validateErrorMessage(expectedError); } } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
LoginSecondScreenSteps.java
I choose to Go Back
public void goBack() { loginSecondScreenPage.goBack(); }
public void goBack() { goBack.click(); }
@When("^I choose to Go Back$") public void goBack() { loginSecondScreenPage.goBack(); }
//step_function: public void goBack() { loginSecondScreenPage.goBack(); } //page_function: public void goBack() { goBack.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I choose to Go Back ### response: //step_function: public void goBack() { loginSecondScreenPage.goBack(); } //page_function: public void goBack() { goBack.click(); }
LoginSecondScreenSteps.java
I see empty OTP textfields
public void validateEmptyOtpTextfields() { loginSecondScreenPage.validateOtpIsEmpty(); }
public void validateOtpIsEmpty() { String a=otpTextFields.getText(); Assert.assertTrue(a.equals("")); }
@Then("^I see empty OTP textfields$") public void validateEmptyOtpTextfields() { loginSecondScreenPage.validateOtpIsEmpty(); }
//step_function: public void validateEmptyOtpTextfields() { loginSecondScreenPage.validateOtpIsEmpty(); } //page_function: public void validateOtpIsEmpty() { String a=otpTextFields.getText(); Assert.assertTrue(a.equals("")); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I see empty OTP textfields ### response: //step_function: public void validateEmptyOtpTextfields() { loginSecondScreenPage.validateOtpIsEmpty(); } //page_function: public void validateOtpIsEmpty() { String a=otpTextFields.getText(); Assert.assertTrue(a.equals("")); }
LoginSecondScreenSteps.java
I choose to Resend OTP
public void resendOtp() { loginSecondScreenPage.resendOtp(); }
public void resendOtp() { clickOn(resendButton); }
@When("^I choose to Resend OTP$") public void resendOtp() { loginSecondScreenPage.resendOtp(); }
//step_function: public void resendOtp() { loginSecondScreenPage.resendOtp(); } //page_function: public void resendOtp() { clickOn(resendButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I choose to Resend OTP ### response: //step_function: public void resendOtp() { loginSecondScreenPage.resendOtp(); } //page_function: public void resendOtp() { clickOn(resendButton); }
LoginSecondScreenSteps.java
After fetching data from data file )?I should get a masking on (email|mobile number) (.*
public void maskedEmailOrMobileNumber(String file, String emailOrMobile, String value) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) { value=commonPage.fetchDataFromDataProperties(value); } if(emailOrMobile.equalsIgnoreCase("email")) loginSecondScreenPage.validateMaskingInEmail(value); else if(emailOrMobile.equalsIgnoreCase("mobile number")) loginSecondScreenPage.validateMaskingInMobile(value); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I should get a masking on (email|mobile number) (.*)$") public void maskedEmailOrMobileNumber(String file, String emailOrMobile, String value) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) { value=commonPage.fetchDataFromDataProperties(value); } if(emailOrMobile.equalsIgnoreCase("email")) loginSecondScreenPage.validateMaskingInEmail(value); else if(emailOrMobile.equalsIgnoreCase("mobile number")) loginSecondScreenPage.validateMaskingInMobile(value); } }
//step_function: public void maskedEmailOrMobileNumber(String file, String emailOrMobile, String value) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) { value=commonPage.fetchDataFromDataProperties(value); } if(emailOrMobile.equalsIgnoreCase("email")) loginSecondScreenPage.validateMaskingInEmail(value); else if(emailOrMobile.equalsIgnoreCase("mobile number")) loginSecondScreenPage.validateMaskingInMobile(value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I should get a masking on (email|mobile number) (.* ### response: //step_function: public void maskedEmailOrMobileNumber(String file, String emailOrMobile, String value) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) { value=commonPage.fetchDataFromDataProperties(value); } if(emailOrMobile.equalsIgnoreCase("email")) loginSecondScreenPage.validateMaskingInEmail(value); else if(emailOrMobile.equalsIgnoreCase("mobile number")) loginSecondScreenPage.validateMaskingInMobile(value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
I select property (.*) from dropdown
public void GivenISelectPropertyFromDropdown(String PropertyName) { propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(PropertyName); }
public void clickOnSelectALocation() { clickOn(selectALocation); }
@Given("I select property (.*) from dropdown$") public void GivenISelectPropertyFromDropdown(String PropertyName) { propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(PropertyName); }
//step_function: public void GivenISelectPropertyFromDropdown(String PropertyName) { propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(PropertyName); } //page_function: public void clickOnSelectALocation() { clickOn(selectALocation); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I select property (.*) from dropdown ### response: //step_function: public void GivenISelectPropertyFromDropdown(String PropertyName) { propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(PropertyName); } //page_function: public void clickOnSelectALocation() { clickOn(selectALocation); }
PropertyDetailSteps.java
I navigate to property detail page
public void ThenINavigateToPropertyDetailPage() { propertyDetailsPage.varifyBreadcrumbIsPresent("Dashboard"); }
public void varifyBreadcrumbIsPresent(String BreadcrumbName) { String project=String.format(parameterizedBreadcrumbName, BreadcrumbName); WebElement BreadcrumbEle=getDriver().findElement(By.xpath(project)); waitFor(BreadcrumbEle); Assert.isTrue(BreadcrumbEle.isDisplayed()); }
@Then("I navigate to property detail page$") public void ThenINavigateToPropertyDetailPage() { propertyDetailsPage.varifyBreadcrumbIsPresent("Dashboard"); }
//step_function: public void ThenINavigateToPropertyDetailPage() { propertyDetailsPage.varifyBreadcrumbIsPresent("Dashboard"); } //page_function: public void varifyBreadcrumbIsPresent(String BreadcrumbName) { String project=String.format(parameterizedBreadcrumbName, BreadcrumbName); WebElement BreadcrumbEle=getDriver().findElement(By.xpath(project)); waitFor(BreadcrumbEle); Assert.isTrue(BreadcrumbEle.isDisplayed()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I navigate to property detail page ### response: //step_function: public void ThenINavigateToPropertyDetailPage() { propertyDetailsPage.varifyBreadcrumbIsPresent("Dashboard"); } //page_function: public void varifyBreadcrumbIsPresent(String BreadcrumbName) { String project=String.format(parameterizedBreadcrumbName, BreadcrumbName); WebElement BreadcrumbEle=getDriver().findElement(By.xpath(project)); waitFor(BreadcrumbEle); Assert.isTrue(BreadcrumbEle.isDisplayed()); }
PropertyDetailSteps.java
I verify property name (.*) in selected in dropdown and on property detail page is same
public void ThenIVarifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String propertyName) { propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(propertyName); }
public void varifyPropertysSelectedOnDropdownAndPageAreSame(String propertyName) { String SelectedPropertyfromDropdown=String.format(parameterizedSelectedPropertyfromDropdown, propertyName); String PropertyNameOnPage=String.format(parameterizedPropertyNameOnPage, propertyName); WebElement SelectedPropertyfromDropdownEle=getDriver().findElement(By.xpath(SelectedPropertyfromDropdown)); WebElement PropertyNameOnPageEle=getDriver().findElement(By.xpath(PropertyNameOnPage)); Assert.isTrue((SelectedPropertyfromDropdownEle.getText()).equals(PropertyNameOnPageEle.getText())); }
@Then("I verify property name (.*) in selected in dropdown and on property detail page is same$") public void ThenIVarifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String propertyName) { propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(propertyName); }
//step_function: public void ThenIVarifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String propertyName) { propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(propertyName); } //page_function: public void varifyPropertysSelectedOnDropdownAndPageAreSame(String propertyName) { String SelectedPropertyfromDropdown=String.format(parameterizedSelectedPropertyfromDropdown, propertyName); String PropertyNameOnPage=String.format(parameterizedPropertyNameOnPage, propertyName); WebElement SelectedPropertyfromDropdownEle=getDriver().findElement(By.xpath(SelectedPropertyfromDropdown)); WebElement PropertyNameOnPageEle=getDriver().findElement(By.xpath(PropertyNameOnPage)); Assert.isTrue((SelectedPropertyfromDropdownEle.getText()).equals(PropertyNameOnPageEle.getText())); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify property name (.*) in selected in dropdown and on property detail page is same ### response: //step_function: public void ThenIVarifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String propertyName) { propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(propertyName); } //page_function: public void varifyPropertysSelectedOnDropdownAndPageAreSame(String propertyName) { String SelectedPropertyfromDropdown=String.format(parameterizedSelectedPropertyfromDropdown, propertyName); String PropertyNameOnPage=String.format(parameterizedPropertyNameOnPage, propertyName); WebElement SelectedPropertyfromDropdownEle=getDriver().findElement(By.xpath(SelectedPropertyfromDropdown)); WebElement PropertyNameOnPageEle=getDriver().findElement(By.xpath(PropertyNameOnPage)); Assert.isTrue((SelectedPropertyfromDropdownEle.getText()).equals(PropertyNameOnPageEle.getText())); }
PropertyDetailSteps.java
I verify title of (.*
public void ThenIVarifyTitleOfPropertDetailPageIsB2B_Location_Details(String pageName) throws Exception { String expectedTitle=propertyDetailsPage.fetchPageTitlesfromEnum(pageName); String actualTitle=propertyDetailsPage.getDriver().getTitle(); Assert.assertTrue(expectedTitle.equals(actualTitle)); }
public String fetchPageTitlesfromEnum(String expectedTitle) throws Exception { switch(expectedTitle) { case "property detail page": expectedTitle=LoginStaticTextsEnum.LOCATIONDETAILSPAGETITLE.getValue(); break; case "project detail page": expectedTitle=LoginStaticTextsEnum.PROJECTDETAILSPAGETITLE.getValue(); break; case "dashbaord page": expectedTitle=LoginStaticTextsEnum.DASHBOARDPAGETITLE.getValue(); break; case "data health page": expectedTitle=LoginStaticTextsEnum.DATAHEALTHPAGETITLE.getValue(); break; default: throw new Exception("unexpected page"); }
@Then("I verify title of (.*)$") public void ThenIVarifyTitleOfPropertDetailPageIsB2B_Location_Details(String pageName) throws Exception { String expectedTitle=propertyDetailsPage.fetchPageTitlesfromEnum(pageName); String actualTitle=propertyDetailsPage.getDriver().getTitle(); Assert.assertTrue(expectedTitle.equals(actualTitle)); }
//step_function: public void ThenIVarifyTitleOfPropertDetailPageIsB2B_Location_Details(String pageName) throws Exception { String expectedTitle=propertyDetailsPage.fetchPageTitlesfromEnum(pageName); String actualTitle=propertyDetailsPage.getDriver().getTitle(); Assert.assertTrue(expectedTitle.equals(actualTitle)); } //page_function: public String fetchPageTitlesfromEnum(String expectedTitle) throws Exception { switch(expectedTitle) { case "property detail page": expectedTitle=LoginStaticTextsEnum.LOCATIONDETAILSPAGETITLE.getValue(); break; case "project detail page": expectedTitle=LoginStaticTextsEnum.PROJECTDETAILSPAGETITLE.getValue(); break; case "dashbaord page": expectedTitle=LoginStaticTextsEnum.DASHBOARDPAGETITLE.getValue(); break; case "data health page": expectedTitle=LoginStaticTextsEnum.DATAHEALTHPAGETITLE.getValue(); break; default: throw new Exception("unexpected page"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify title of (.* ### response: //step_function: public void ThenIVarifyTitleOfPropertDetailPageIsB2B_Location_Details(String pageName) throws Exception { String expectedTitle=propertyDetailsPage.fetchPageTitlesfromEnum(pageName); String actualTitle=propertyDetailsPage.getDriver().getTitle(); Assert.assertTrue(expectedTitle.equals(actualTitle)); } //page_function: public String fetchPageTitlesfromEnum(String expectedTitle) throws Exception { switch(expectedTitle) { case "property detail page": expectedTitle=LoginStaticTextsEnum.LOCATIONDETAILSPAGETITLE.getValue(); break; case "project detail page": expectedTitle=LoginStaticTextsEnum.PROJECTDETAILSPAGETITLE.getValue(); break; case "dashbaord page": expectedTitle=LoginStaticTextsEnum.DASHBOARDPAGETITLE.getValue(); break; case "data health page": expectedTitle=LoginStaticTextsEnum.DATAHEALTHPAGETITLE.getValue(); break; default: throw new Exception("unexpected page"); }
PropertyDetailSteps.java
I verify that total net metering panel is visible
public void ThenIVarifyTotalNetMeteringPanelIsVisible() { propertyDetailsPage.varifyTotalNetMeteringIsVisible(); }
public void varifyTotalNetMeteringIsVisible() { Assert.isTrue(totalNetMetering.isVisible()); }
@Then("I verify that total net metering panel is visible$") public void ThenIVarifyTotalNetMeteringPanelIsVisible() { propertyDetailsPage.varifyTotalNetMeteringIsVisible(); }
//step_function: public void ThenIVarifyTotalNetMeteringPanelIsVisible() { propertyDetailsPage.varifyTotalNetMeteringIsVisible(); } //page_function: public void varifyTotalNetMeteringIsVisible() { Assert.isTrue(totalNetMetering.isVisible()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify that total net metering panel is visible ### response: //step_function: public void ThenIVarifyTotalNetMeteringPanelIsVisible() { propertyDetailsPage.varifyTotalNetMeteringIsVisible(); } //page_function: public void varifyTotalNetMeteringIsVisible() { Assert.isTrue(totalNetMetering.isVisible()); }
PropertyDetailSteps.java
I click on question mark on total net metering panel
public void IClickOnQuestionMarkOnTotalNetMeteringPanel() { propertyDetailsPage.clickOnToolTip(); }
public void clickOnToolTip() { clickOn(questionMark); }
@Then("I click on question mark on total net metering panel$") public void IClickOnQuestionMarkOnTotalNetMeteringPanel() { propertyDetailsPage.clickOnToolTip(); }
//step_function: public void IClickOnQuestionMarkOnTotalNetMeteringPanel() { propertyDetailsPage.clickOnToolTip(); } //page_function: public void clickOnToolTip() { clickOn(questionMark); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on question mark on total net metering panel ### response: //step_function: public void IClickOnQuestionMarkOnTotalNetMeteringPanel() { propertyDetailsPage.clickOnToolTip(); } //page_function: public void clickOnToolTip() { clickOn(questionMark); }
PropertyDetailSteps.java
I verify tooltip text
public void ThenIVerifyTooltipTextIs() { String expectedTotalNetMeteringToolTipText=LoginStaticTextsEnum.TOTALNETMETERINGTOOLTIPTEXT.getValue(); String actualTotalNetMeteringToolTipText=propertyDetailsPage.getToolTipText(); Assert.assertTrue(expectedTotalNetMeteringToolTipText.equals(actualTotalNetMeteringToolTipText)); }
public String getToolTipText() { waitFor(toolTip); String ActualTotalNetMeteringToolTipText=toolTip.getText(); return ActualTotalNetMeteringToolTipText; }
@Then("I verify tooltip text$") public void ThenIVerifyTooltipTextIs() { String expectedTotalNetMeteringToolTipText=LoginStaticTextsEnum.TOTALNETMETERINGTOOLTIPTEXT.getValue(); String actualTotalNetMeteringToolTipText=propertyDetailsPage.getToolTipText(); Assert.assertTrue(expectedTotalNetMeteringToolTipText.equals(actualTotalNetMeteringToolTipText)); }
//step_function: public void ThenIVerifyTooltipTextIs() { String expectedTotalNetMeteringToolTipText=LoginStaticTextsEnum.TOTALNETMETERINGTOOLTIPTEXT.getValue(); String actualTotalNetMeteringToolTipText=propertyDetailsPage.getToolTipText(); Assert.assertTrue(expectedTotalNetMeteringToolTipText.equals(actualTotalNetMeteringToolTipText)); } //page_function: public String getToolTipText() { waitFor(toolTip); String ActualTotalNetMeteringToolTipText=toolTip.getText(); return ActualTotalNetMeteringToolTipText; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify tooltip text ### response: //step_function: public void ThenIVerifyTooltipTextIs() { String expectedTotalNetMeteringToolTipText=LoginStaticTextsEnum.TOTALNETMETERINGTOOLTIPTEXT.getValue(); String actualTotalNetMeteringToolTipText=propertyDetailsPage.getToolTipText(); Assert.assertTrue(expectedTotalNetMeteringToolTipText.equals(actualTotalNetMeteringToolTipText)); } //page_function: public String getToolTipText() { waitFor(toolTip); String ActualTotalNetMeteringToolTipText=toolTip.getText(); return ActualTotalNetMeteringToolTipText; }
PropertyDetailSteps.java
After fetching data from data file)? I click on project (.*
public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnProjectName(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file)? I click on project (.*)$") public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnProjectName(value); }
//step_function: public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnProjectName(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I click on project (.* ### response: //step_function: public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnProjectName(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
After fetching data from data file)? I verify (.*) in selected in dropdown and on property detail page is same
public void ThenAfterFetchingDataFromDataFileIVerifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I verify (.*) in selected in dropdown and on property detail page is same$") public void ThenAfterFetchingDataFromDataFileIVerifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(value); }
//step_function: public void ThenAfterFetchingDataFromDataFileIVerifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I verify (.*) in selected in dropdown and on property detail page is same ### response: //step_function: public void ThenAfterFetchingDataFromDataFileIVerifyPropertyNameInSelectedInDropdownAndOnPropertyDetailPageIsSame(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); propertyDetailsPage.varifyPropertysSelectedOnDropdownAndPageAreSame(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
After fetching data from data file)? I select (.*) from dropdown
public void ThenAfterFetchingDataFromDataFileISelectPropertyNameFromDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I select (.*) from dropdown$") public void ThenAfterFetchingDataFromDataFileISelectPropertyNameFromDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(value); }
//step_function: public void ThenAfterFetchingDataFromDataFileISelectPropertyNameFromDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I select (.*) from dropdown ### response: //step_function: public void ThenAfterFetchingDataFromDataFileISelectPropertyNameFromDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectALocation(); propertyDetailsPage.selectProjectFromDropdown(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
After fetching data from data file)? I select (.*) select a location dropdown
public void ThenAfterFetchingDataFromDataFileISelectPropertyNameselectALocationDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectAProperty(); propertyDetailsPage.selectProjectFromDropdown(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I select (.*) select a location dropdown$") public void ThenAfterFetchingDataFromDataFileISelectPropertyNameselectALocationDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectAProperty(); propertyDetailsPage.selectProjectFromDropdown(value); }
//step_function: public void ThenAfterFetchingDataFromDataFileISelectPropertyNameselectALocationDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectAProperty(); propertyDetailsPage.selectProjectFromDropdown(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I select (.*) select a location dropdown ### response: //step_function: public void ThenAfterFetchingDataFromDataFileISelectPropertyNameselectALocationDropdown(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickOnSelectAProperty(); propertyDetailsPage.selectProjectFromDropdown(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
After fetching data from data file)? I verify (.*) breadcrumb near to property breadcrumb
public void GivenIVerifyProjectBreadcrumbNearToPropertyBreadcrumb(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file)? I verify (.*) breadcrumb near to property breadcrumb$") public void GivenIVerifyProjectBreadcrumbNearToPropertyBreadcrumb(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); }
//step_function: public void GivenIVerifyProjectBreadcrumbNearToPropertyBreadcrumb(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I verify (.*) breadcrumb near to property breadcrumb ### response: //step_function: public void GivenIVerifyProjectBreadcrumbNearToPropertyBreadcrumb(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
After fetching data from data file)? I click on property (.*
public void ThenIClickOnPropertyName(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickBreadcrumbLink(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I click on property (.*)$") public void ThenIClickOnPropertyName(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickBreadcrumbLink(value); }
//step_function: public void ThenIClickOnPropertyName(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickBreadcrumbLink(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I click on property (.* ### response: //step_function: public void ThenIClickOnPropertyName(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickBreadcrumbLink(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
PropertyDetailSteps.java
I click on see details
public void GivenIClickOnSeeDetails() { propertyDetailsPage.clickOnSeeDetails(); }
public void clickOnSeeDetails() { JavascriptExecutor jse = (JavascriptExecutor)getDriver();; jse.executeScript("window.scrollBy(0,500)"); if(seeDetails.isVisible()) { clickOn(seeDetails); }
@Given("I click on see details$") public void GivenIClickOnSeeDetails() { propertyDetailsPage.clickOnSeeDetails(); }
//step_function: public void GivenIClickOnSeeDetails() { propertyDetailsPage.clickOnSeeDetails(); } //page_function: public void clickOnSeeDetails() { JavascriptExecutor jse = (JavascriptExecutor)getDriver();; jse.executeScript("window.scrollBy(0,500)"); if(seeDetails.isVisible()) { clickOn(seeDetails); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on see details ### response: //step_function: public void GivenIClickOnSeeDetails() { propertyDetailsPage.clickOnSeeDetails(); } //page_function: public void clickOnSeeDetails() { JavascriptExecutor jse = (JavascriptExecutor)getDriver();; jse.executeScript("window.scrollBy(0,500)"); if(seeDetails.isVisible()) { clickOn(seeDetails); }
PropertyDetailSteps.java
I click on dashboard
public void ThenIClickOnDashboard() { propertyDetailsPage.clickBreadcrumbLink("Dashboard"); } }
public void clickBreadcrumbLink(String BreadcrumbName) { String project=String.format(parameterizedBreadcrumbName, BreadcrumbName); WebElement BreadcrumbEle=getDriver().findElement(By.xpath(project)); waitFor(BreadcrumbEle); clickOn(BreadcrumbEle); }
@Then("I click on dashboard") public void ThenIClickOnDashboard() { propertyDetailsPage.clickBreadcrumbLink("Dashboard"); } }
//step_function: public void ThenIClickOnDashboard() { propertyDetailsPage.clickBreadcrumbLink("Dashboard"); } } //page_function: public void clickBreadcrumbLink(String BreadcrumbName) { String project=String.format(parameterizedBreadcrumbName, BreadcrumbName); WebElement BreadcrumbEle=getDriver().findElement(By.xpath(project)); waitFor(BreadcrumbEle); clickOn(BreadcrumbEle); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on dashboard ### response: //step_function: public void ThenIClickOnDashboard() { propertyDetailsPage.clickBreadcrumbLink("Dashboard"); } } //page_function: public void clickBreadcrumbLink(String BreadcrumbName) { String project=String.format(parameterizedBreadcrumbName, BreadcrumbName); WebElement BreadcrumbEle=getDriver().findElement(By.xpath(project)); waitFor(BreadcrumbEle); clickOn(BreadcrumbEle); }
SignUpFirstScreenSteps.java
After fetching data from data file )?I enter all the details for signing up in Signup Screen-1
public void enterFirstScreenSignUpDetails(String file,DataTable dataTable) throws IOException { List<List<String>> data = dataTable.raw(); signUpFirstPage.enterFirstName(data.get(0).get(0)); signUpFirstPage.enterLastName(data.get(0).get(1)); if((file!=null)&&(file.contains("data file"))) { signUpFirstPage.enterEmail(commonPage.fetchDataFromDataProperties(data.get(0).get(2))); signUpFirstPage.enterMobileNumber(commonPage.fetchDataFromDataProperties(data.get(0).get(3))); } else{ signUpFirstPage.enterEmail(data.get(0).get(2)); signUpFirstPage.enterMobileNumber(data.get(0).get(3)); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I enter all the details for signing up in Signup Screen-1$") public void enterFirstScreenSignUpDetails(String file,DataTable dataTable) throws IOException { List<List<String>> data = dataTable.raw(); signUpFirstPage.enterFirstName(data.get(0).get(0)); signUpFirstPage.enterLastName(data.get(0).get(1)); if((file!=null)&&(file.contains("data file"))) { signUpFirstPage.enterEmail(commonPage.fetchDataFromDataProperties(data.get(0).get(2))); signUpFirstPage.enterMobileNumber(commonPage.fetchDataFromDataProperties(data.get(0).get(3))); } else{ signUpFirstPage.enterEmail(data.get(0).get(2)); signUpFirstPage.enterMobileNumber(data.get(0).get(3)); } }
//step_function: public void enterFirstScreenSignUpDetails(String file,DataTable dataTable) throws IOException { List<List<String>> data = dataTable.raw(); signUpFirstPage.enterFirstName(data.get(0).get(0)); signUpFirstPage.enterLastName(data.get(0).get(1)); if((file!=null)&&(file.contains("data file"))) { signUpFirstPage.enterEmail(commonPage.fetchDataFromDataProperties(data.get(0).get(2))); signUpFirstPage.enterMobileNumber(commonPage.fetchDataFromDataProperties(data.get(0).get(3))); } else{ signUpFirstPage.enterEmail(data.get(0).get(2)); signUpFirstPage.enterMobileNumber(data.get(0).get(3)); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter all the details for signing up in Signup Screen-1 ### response: //step_function: public void enterFirstScreenSignUpDetails(String file,DataTable dataTable) throws IOException { List<List<String>> data = dataTable.raw(); signUpFirstPage.enterFirstName(data.get(0).get(0)); signUpFirstPage.enterLastName(data.get(0).get(1)); if((file!=null)&&(file.contains("data file"))) { signUpFirstPage.enterEmail(commonPage.fetchDataFromDataProperties(data.get(0).get(2))); signUpFirstPage.enterMobileNumber(commonPage.fetchDataFromDataProperties(data.get(0).get(3))); } else{ signUpFirstPage.enterEmail(data.get(0).get(2)); signUpFirstPage.enterMobileNumber(data.get(0).get(3)); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
SignUpFirstScreenSteps.java
I click on continue button in Signup Screen-1
public void clickOnContinueButton(){ signUpFirstPage.clickOnContinue(); }
public void clickOnContinue(){ clickOn(continue_btn); }
@And("^I click on continue button in Signup Screen-1$") public void clickOnContinueButton(){ signUpFirstPage.clickOnContinue(); }
//step_function: public void clickOnContinueButton(){ signUpFirstPage.clickOnContinue(); } //page_function: public void clickOnContinue(){ clickOn(continue_btn); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on continue button in Signup Screen-1 ### response: //step_function: public void clickOnContinueButton(){ signUpFirstPage.clickOnContinue(); } //page_function: public void clickOnContinue(){ clickOn(continue_btn); }
SignUpFirstScreenSteps.java
After fetching data from data file )?I enter value (.*) in Signup mobile textfield
public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginMobile(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I enter value (.*) in Signup mobile textfield$") public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginMobile(value); }
//step_function: public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginMobile(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter value (.*) in Signup mobile textfield ### response: //step_function: public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginMobile(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
SignUpFirstScreenSteps.java
After fetching data from data file )?I enter value (.*) in Signup email textfield
public void enterEmail(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginEmail(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I enter value (.*) in Signup email textfield$") public void enterEmail(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginEmail(value); }
//step_function: public void enterEmail(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginEmail(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter value (.*) in Signup email textfield ### response: //step_function: public void enterEmail(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginEmail(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
SignUpFirstScreenSteps.java
I get error message (.*) for email or mobile textfield in Signup
public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpFirstPage.validateErrorMessage(expectedError); }
public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
@Then("^I get error message (.*) for email or mobile textfield in Signup$") public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpFirstPage.validateErrorMessage(expectedError); }
//step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpFirstPage.validateErrorMessage(expectedError); } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I get error message (.*) for email or mobile textfield in Signup ### response: //step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpFirstPage.validateErrorMessage(expectedError); } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
SignUpFirstScreenSteps.java
After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield in Signup
public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.validatePrepopulatedEmailOrMobileTextfield(value); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield in Signup$") public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.validatePrepopulatedEmailOrMobileTextfield(value); } }
//step_function: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.validatePrepopulatedEmailOrMobileTextfield(value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield in Signup ### response: //step_function: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.validatePrepopulatedEmailOrMobileTextfield(value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
SignUpSecondScreenSteps.java
I enter all the details for signing up in Signup Screen-2
public void enterSecondScreenDetails(DataTable dataTable) { List<List<String>> data = dataTable.raw(); signUpSecondScreenPage.enterAddress1(data.get(0).get(0)); signUpSecondScreenPage.enterAddress2(data.get(0).get(1)); signUpSecondScreenPage.enterZipCode(data.get(0).get(2)); signUpSecondScreenPage.enterCity(data.get(0).get(3)); signUpSecondScreenPage.selectState(data.get(0).get(4)); }
public void enterAddress1(String address1) { enter(address1).into(address1_txt); }
@When("^I enter all the details for signing up in Signup Screen-2$") public void enterSecondScreenDetails(DataTable dataTable) { List<List<String>> data = dataTable.raw(); signUpSecondScreenPage.enterAddress1(data.get(0).get(0)); signUpSecondScreenPage.enterAddress2(data.get(0).get(1)); signUpSecondScreenPage.enterZipCode(data.get(0).get(2)); signUpSecondScreenPage.enterCity(data.get(0).get(3)); signUpSecondScreenPage.selectState(data.get(0).get(4)); }
//step_function: public void enterSecondScreenDetails(DataTable dataTable) { List<List<String>> data = dataTable.raw(); signUpSecondScreenPage.enterAddress1(data.get(0).get(0)); signUpSecondScreenPage.enterAddress2(data.get(0).get(1)); signUpSecondScreenPage.enterZipCode(data.get(0).get(2)); signUpSecondScreenPage.enterCity(data.get(0).get(3)); signUpSecondScreenPage.selectState(data.get(0).get(4)); } //page_function: public void enterAddress1(String address1) { enter(address1).into(address1_txt); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter all the details for signing up in Signup Screen-2 ### response: //step_function: public void enterSecondScreenDetails(DataTable dataTable) { List<List<String>> data = dataTable.raw(); signUpSecondScreenPage.enterAddress1(data.get(0).get(0)); signUpSecondScreenPage.enterAddress2(data.get(0).get(1)); signUpSecondScreenPage.enterZipCode(data.get(0).get(2)); signUpSecondScreenPage.enterCity(data.get(0).get(3)); signUpSecondScreenPage.selectState(data.get(0).get(4)); } //page_function: public void enterAddress1(String address1) { enter(address1).into(address1_txt); }
SignUpSecondScreenSteps.java
I click on continue button in Signup Screen-2
public void ClickOnContinue() { signUpSecondScreenPage.clickOnContinue(); }
public void clickOnContinue(){ clickOn(continue_btn); }
@And("^I click on continue button in Signup Screen-2$") public void ClickOnContinue() { signUpSecondScreenPage.clickOnContinue(); }
//step_function: public void ClickOnContinue() { signUpSecondScreenPage.clickOnContinue(); } //page_function: public void clickOnContinue(){ clickOn(continue_btn); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on continue button in Signup Screen-2 ### response: //step_function: public void ClickOnContinue() { signUpSecondScreenPage.clickOnContinue(); } //page_function: public void clickOnContinue(){ clickOn(continue_btn); }
SignUpSecondScreenSteps.java
I enter the incorrect OTP (.*) in Signup screen
public void enterIncorrectOTP(String incorrectOtp) { signUpSecondScreenPage.enterOtp(incorrectOtp); }
public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
@When("^I enter the incorrect OTP (.*) in Signup screen$") public void enterIncorrectOTP(String incorrectOtp) { signUpSecondScreenPage.enterOtp(incorrectOtp); }
//step_function: public void enterIncorrectOTP(String incorrectOtp) { signUpSecondScreenPage.enterOtp(incorrectOtp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter the incorrect OTP (.*) in Signup screen ### response: //step_function: public void enterIncorrectOTP(String incorrectOtp) { signUpSecondScreenPage.enterOtp(incorrectOtp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
SignUpSecondScreenSteps.java
I (dont )?get error message (.*) for OTP textfields in Signup
public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; signUpSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpSecondScreenPage.validateErrorMessage(expectedError); } }
public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
@Then("^I (dont )?get error message (.*) for OTP textfields in Signup$") public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; signUpSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpSecondScreenPage.validateErrorMessage(expectedError); } }
//step_function: public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; signUpSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpSecondScreenPage.validateErrorMessage(expectedError); } } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I (dont )?get error message (.*) for OTP textfields in Signup ### response: //step_function: public void validateErrorMeesage(String dontFlag, String expectedError) throws Exception { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { expectedError=null; signUpSecondScreenPage.validateNoErrorMessage(); } else { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); signUpSecondScreenPage.validateErrorMessage(expectedError); } } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue(); break; case "INVALID_EMAIL_ERROR": expectedError=LoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue(); break; case "EMAIL_MAX_50_CHARS": expectedError=LoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue(); break; case "INCORRECT_OTP": expectedError=LoginErrorMessagesEnum.INCORRECT_OTP.getValue(); break; case "INCOMPLETE_OTP": expectedError=LoginErrorMessagesEnum.INCOMPLETE_OTP.getValue(); break; case "INVALID_SESSION": expectedError=LoginErrorMessagesEnum.INVALID_SESSION.getValue(); break; case "INCORRECT_PASSWORD": expectedError=LoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue(); break; case "USER_DISABLED": expectedError=LoginErrorMessagesEnum.USER_DISABLED.getValue(); break; default: throw new Exception("This Expected Error in feature file is not present in the list of expected errors in switch case or Enum file"); }
SignUpSecondScreenSteps.java
I choose to Go Back in Signup
public void goBack() { signUpSecondScreenPage.goBack(); }
public void goBack() { goBack.click(); }
@When("^I choose to Go Back in Signup$") public void goBack() { signUpSecondScreenPage.goBack(); }
//step_function: public void goBack() { signUpSecondScreenPage.goBack(); } //page_function: public void goBack() { goBack.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I choose to Go Back in Signup ### response: //step_function: public void goBack() { signUpSecondScreenPage.goBack(); } //page_function: public void goBack() { goBack.click(); }
SignUpSecondScreenSteps.java
I see empty OTP textfields in Signup
public void validateEmptyOtpTextfields() { signUpSecondScreenPage.validateOtpIsEmpty(); }
public void validateOtpIsEmpty() { String a=otpTextFields.getText(); Assert.assertTrue(a.equals("")); }
@Then("^I see empty OTP textfields in Signup$") public void validateEmptyOtpTextfields() { signUpSecondScreenPage.validateOtpIsEmpty(); }
//step_function: public void validateEmptyOtpTextfields() { signUpSecondScreenPage.validateOtpIsEmpty(); } //page_function: public void validateOtpIsEmpty() { String a=otpTextFields.getText(); Assert.assertTrue(a.equals("")); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I see empty OTP textfields in Signup ### response: //step_function: public void validateEmptyOtpTextfields() { signUpSecondScreenPage.validateOtpIsEmpty(); } //page_function: public void validateOtpIsEmpty() { String a=otpTextFields.getText(); Assert.assertTrue(a.equals("")); }
SignUpSecondScreenSteps.java
I choose to Resend OTP in Signup
public void resendOtp() { signUpSecondScreenPage.resendOtp(); } }
public void resendOtp() { clickOn(resendButton); }
@When("^I choose to Resend OTP in Signup$") public void resendOtp() { signUpSecondScreenPage.resendOtp(); } }
//step_function: public void resendOtp() { signUpSecondScreenPage.resendOtp(); } } //page_function: public void resendOtp() { clickOn(resendButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I choose to Resend OTP in Signup ### response: //step_function: public void resendOtp() { signUpSecondScreenPage.resendOtp(); } } //page_function: public void resendOtp() { clickOn(resendButton); }
UserManagementSteps.java
I clicks on User Management tab
public void WhenIClicksOnUserManagementTab() { userManagementPage.clickOnUserManagementTab(); }
public void clickOnUserManagementTab() { userManagementTab.click(); }
@When("^I clicks on User Management tab$") public void WhenIClicksOnUserManagementTab() { userManagementPage.clickOnUserManagementTab(); }
//step_function: public void WhenIClicksOnUserManagementTab() { userManagementPage.clickOnUserManagementTab(); } //page_function: public void clickOnUserManagementTab() { userManagementTab.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I clicks on User Management tab ### response: //step_function: public void WhenIClicksOnUserManagementTab() { userManagementPage.clickOnUserManagementTab(); } //page_function: public void clickOnUserManagementTab() { userManagementTab.click(); }
UserManagementSteps.java
I click on user info
public void ThenIClickOnUserInfo() { userManagementPage.clickOnUser(); }
public void clickOnUser() { clickOn(user); }
@Then("I click on user info$") public void ThenIClickOnUserInfo() { userManagementPage.clickOnUser(); }
//step_function: public void ThenIClickOnUserInfo() { userManagementPage.clickOnUser(); } //page_function: public void clickOnUser() { clickOn(user); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on user info ### response: //step_function: public void ThenIClickOnUserInfo() { userManagementPage.clickOnUser(); } //page_function: public void clickOnUser() { clickOn(user); }
UserManagementSteps.java
I click on edit user button on user info pop up
public void ThenIClickOnEditUserButtonOnUserInfoPopUp() { userManagementPage.clickOnEditUserInfo(); }
public void clickOnEditUserInfo() { clickOn(EditUserInfo); }
@Then("I click on edit user button on user info pop up$") public void ThenIClickOnEditUserButtonOnUserInfoPopUp() { userManagementPage.clickOnEditUserInfo(); }
//step_function: public void ThenIClickOnEditUserButtonOnUserInfoPopUp() { userManagementPage.clickOnEditUserInfo(); } //page_function: public void clickOnEditUserInfo() { clickOn(EditUserInfo); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on edit user button on user info pop up ### response: //step_function: public void ThenIClickOnEditUserButtonOnUserInfoPopUp() { userManagementPage.clickOnEditUserInfo(); } //page_function: public void clickOnEditUserInfo() { clickOn(EditUserInfo); }
UserManagementSteps.java
After fetching data from data file)? I Validate user firstname (.*) and lastname (.*) is edited
public void ThenIValidateUserFirstnameUsereditedAndLastnameUsereditedIsEdited(String file,String firstname , String lname) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) firstname=commonPage.fetchDataFromDataProperties(firstname); userManagementPage.ValidateUserInfoIsEdited(firstname+generatedString +" "+firstname+generatedString); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("(After fetching data from data file)? I Validate user firstname (.*) and lastname (.*) is edited$") public void ThenIValidateUserFirstnameUsereditedAndLastnameUsereditedIsEdited(String file,String firstname , String lname) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) firstname=commonPage.fetchDataFromDataProperties(firstname); userManagementPage.ValidateUserInfoIsEdited(firstname+generatedString +" "+firstname+generatedString); }
//step_function: public void ThenIValidateUserFirstnameUsereditedAndLastnameUsereditedIsEdited(String file,String firstname , String lname) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) firstname=commonPage.fetchDataFromDataProperties(firstname); userManagementPage.ValidateUserInfoIsEdited(firstname+generatedString +" "+firstname+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I Validate user firstname (.*) and lastname (.*) is edited ### response: //step_function: public void ThenIValidateUserFirstnameUsereditedAndLastnameUsereditedIsEdited(String file,String firstname , String lname) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) firstname=commonPage.fetchDataFromDataProperties(firstname); userManagementPage.ValidateUserInfoIsEdited(firstname+generatedString +" "+firstname+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
After fetching data from data file)? I edit firstname and last name as (.*
public void ThenIEditFirstnameAndLastNameAsAutomationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I edit firstname and last name as (.*)$") public void ThenIEditFirstnameAndLastNameAsAutomationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); }
//step_function: public void ThenIEditFirstnameAndLastNameAsAutomationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I edit firstname and last name as (.* ### response: //step_function: public void ThenIEditFirstnameAndLastNameAsAutomationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
I validate that name, role, last active, member since & mapped locations columns should be visible
public void ThenIValidateThatNameRoleLastActiveMemberSinceMappedLocationsColumnsShouldBeVisible() { userManagementPage.varifyGridColumnsArePresent(); }
public void varifyGridColumnsArePresent() { Assert.assertTrue(name.isDisplayed()); Assert.assertTrue(role.isDisplayed()); Assert.assertTrue(lastActive.isDisplayed()); Assert.assertTrue(memberSince.isDisplayed()); Assert.assertTrue(mappedLocations.isDisplayed()); Assert.assertTrue(totalMapped.isDisplayed()); }
@Then("I validate that name, role, last active, member since & mapped locations columns should be visible$") public void ThenIValidateThatNameRoleLastActiveMemberSinceMappedLocationsColumnsShouldBeVisible() { userManagementPage.varifyGridColumnsArePresent(); }
//step_function: public void ThenIValidateThatNameRoleLastActiveMemberSinceMappedLocationsColumnsShouldBeVisible() { userManagementPage.varifyGridColumnsArePresent(); } //page_function: public void varifyGridColumnsArePresent() { Assert.assertTrue(name.isDisplayed()); Assert.assertTrue(role.isDisplayed()); Assert.assertTrue(lastActive.isDisplayed()); Assert.assertTrue(memberSince.isDisplayed()); Assert.assertTrue(mappedLocations.isDisplayed()); Assert.assertTrue(totalMapped.isDisplayed()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I validate that name, role, last active, member since & mapped locations columns should be visible ### response: //step_function: public void ThenIValidateThatNameRoleLastActiveMemberSinceMappedLocationsColumnsShouldBeVisible() { userManagementPage.varifyGridColumnsArePresent(); } //page_function: public void varifyGridColumnsArePresent() { Assert.assertTrue(name.isDisplayed()); Assert.assertTrue(role.isDisplayed()); Assert.assertTrue(lastActive.isDisplayed()); Assert.assertTrue(memberSince.isDisplayed()); Assert.assertTrue(mappedLocations.isDisplayed()); Assert.assertTrue(totalMapped.isDisplayed()); }
UserManagementSteps.java
I verify that logged in user is at top with mentioned and does not have delete and edit icon
public void WhenIVerifyThatLoggedInUserIsAtTopWithMentionedAndDoesNotHaveDeleteAndEditIcon() { userManagementPage.varifyLoggedInUserShouldOnTOpOfGrid(); }
public void varifyLoggedInUserShouldOnTOpOfGrid() { String user=loggedInUser.getText(); Assert.assertTrue(user.contains("You")); }
@When("I verify that logged in user is at top with mentioned and does not have delete and edit icon$") public void WhenIVerifyThatLoggedInUserIsAtTopWithMentionedAndDoesNotHaveDeleteAndEditIcon() { userManagementPage.varifyLoggedInUserShouldOnTOpOfGrid(); }
//step_function: public void WhenIVerifyThatLoggedInUserIsAtTopWithMentionedAndDoesNotHaveDeleteAndEditIcon() { userManagementPage.varifyLoggedInUserShouldOnTOpOfGrid(); } //page_function: public void varifyLoggedInUserShouldOnTOpOfGrid() { String user=loggedInUser.getText(); Assert.assertTrue(user.contains("You")); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify that logged in user is at top with mentioned and does not have delete and edit icon ### response: //step_function: public void WhenIVerifyThatLoggedInUserIsAtTopWithMentionedAndDoesNotHaveDeleteAndEditIcon() { userManagementPage.varifyLoggedInUserShouldOnTOpOfGrid(); } //page_function: public void varifyLoggedInUserShouldOnTOpOfGrid() { String user=loggedInUser.getText(); Assert.assertTrue(user.contains("You")); }
UserManagementSteps.java
After fetching data from data file)? I searched for (.*) user
public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterValueInSearchbox(value+generatedString); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file)? I searched for (.*) user$") public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterValueInSearchbox(value+generatedString); }
//step_function: public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterValueInSearchbox(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I searched for (.*) user ### response: //step_function: public void userToEditInformationUser(String file,String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterValueInSearchbox(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
After fetching data from data file)? I click on edit button to edit user (.*
public void ThenIClickOnEditButtonToEditUser(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.editUser(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I click on edit button to edit user (.*)$") public void ThenIClickOnEditButtonToEditUser(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.editUser(value); }
//step_function: public void ThenIClickOnEditButtonToEditUser(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.editUser(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I click on edit button to edit user (.* ### response: //step_function: public void ThenIClickOnEditButtonToEditUser(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.editUser(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
After fetching data from data file)? I click on delete button icon to delete user (.*
public void ThenIClickOnDeleteButtonIconToDeleteUser(String file, String value) throws InterruptedException, FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.deleteUser(value+generatedString); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I click on delete button icon to delete user (.*)$") public void ThenIClickOnDeleteButtonIconToDeleteUser(String file, String value) throws InterruptedException, FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.deleteUser(value+generatedString); }
//step_function: public void ThenIClickOnDeleteButtonIconToDeleteUser(String file, String value) throws InterruptedException, FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.deleteUser(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I click on delete button icon to delete user (.* ### response: //step_function: public void ThenIClickOnDeleteButtonIconToDeleteUser(String file, String value) throws InterruptedException, FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.deleteUser(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
I verify that heading will be Edit User
public void ThenIVerifyThatHeadingWillBeEditUser() { userManagementPage.varifyEditUserHeading(); } public int getRandomNumberUsingNextInt( ) { Random random = new Random(); return random.nextInt(9999 - 1001) + 1001; }
public void varifyEditUserHeading() { Assert.assertTrue(editUserHeading.isVisible()); }
@Then("I verify that heading will be Edit User$") public void ThenIVerifyThatHeadingWillBeEditUser() { userManagementPage.varifyEditUserHeading(); } public int getRandomNumberUsingNextInt( ) { Random random = new Random(); return random.nextInt(9999 - 1001) + 1001; }
//step_function: public void ThenIVerifyThatHeadingWillBeEditUser() { userManagementPage.varifyEditUserHeading(); } public int getRandomNumberUsingNextInt( ) { Random random = new Random(); return random.nextInt(9999 - 1001) + 1001; } //page_function: public void varifyEditUserHeading() { Assert.assertTrue(editUserHeading.isVisible()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify that heading will be Edit User ### response: //step_function: public void ThenIVerifyThatHeadingWillBeEditUser() { userManagementPage.varifyEditUserHeading(); } public int getRandomNumberUsingNextInt( ) { Random random = new Random(); return random.nextInt(9999 - 1001) + 1001; } //page_function: public void varifyEditUserHeading() { Assert.assertTrue(editUserHeading.isVisible()); }
UserManagementSteps.java
After fetching data from data file)? I enter first name (.*), last name, phone number, email id and role in edit user popup
public void ThenIEnterFirstNameLastNamePhoneNumberEmailIdAndRoleInEditUserPopup(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); userManagementPage.enterEmail(value+generatedString+"
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file)? I enter first name (.*), last name, phone number, email id and role in edit user popup") public void ThenIEnterFirstNameLastNamePhoneNumberEmailIdAndRoleInEditUserPopup(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); userManagementPage.enterEmail(value+generatedString+"
//step_function: public void ThenIEnterFirstNameLastNamePhoneNumberEmailIdAndRoleInEditUserPopup(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); userManagementPage.enterEmail(value+generatedString+" //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I enter first name (.*), last name, phone number, email id and role in edit user popup ### response: //step_function: public void ThenIEnterFirstNameLastNamePhoneNumberEmailIdAndRoleInEditUserPopup(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.enterFirstName(value+generatedString); userManagementPage.enterLastName(value+generatedString); userManagementPage.enterEmail(value+generatedString+" //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
I click on submit button on edit user screen
public void ThenIClickOnSubmitButtonOnEditUserScreen() throws InterruptedException { userManagementPage.clickOnSubmitEditUser(); Thread.sleep(5000); }
public void clickOnSubmitEditUser(){ SubmitButton.click(); }
@Then("I click on submit button on edit user screen$") public void ThenIClickOnSubmitButtonOnEditUserScreen() throws InterruptedException { userManagementPage.clickOnSubmitEditUser(); Thread.sleep(5000); }
//step_function: public void ThenIClickOnSubmitButtonOnEditUserScreen() throws InterruptedException { userManagementPage.clickOnSubmitEditUser(); Thread.sleep(5000); } //page_function: public void clickOnSubmitEditUser(){ SubmitButton.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on submit button on edit user screen ### response: //step_function: public void ThenIClickOnSubmitButtonOnEditUserScreen() throws InterruptedException { userManagementPage.clickOnSubmitEditUser(); Thread.sleep(5000); } //page_function: public void clickOnSubmitEditUser(){ SubmitButton.click(); }
UserManagementSteps.java
I validate Success message should visible
public void ThenIValidateSuccessMessageShouldVisible() { userManagementPage.validateSuccessPopupAndMessage(); }
public void validateSuccessPopupAndMessage() { Assert.assertTrue(success.isDisplayed()); Assert.assertTrue(successMessage.isDisplayed()); }
@Then("I validate Success message should visible$") public void ThenIValidateSuccessMessageShouldVisible() { userManagementPage.validateSuccessPopupAndMessage(); }
//step_function: public void ThenIValidateSuccessMessageShouldVisible() { userManagementPage.validateSuccessPopupAndMessage(); } //page_function: public void validateSuccessPopupAndMessage() { Assert.assertTrue(success.isDisplayed()); Assert.assertTrue(successMessage.isDisplayed()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I validate Success message should visible ### response: //step_function: public void ThenIValidateSuccessMessageShouldVisible() { userManagementPage.validateSuccessPopupAndMessage(); } //page_function: public void validateSuccessPopupAndMessage() { Assert.assertTrue(success.isDisplayed()); Assert.assertTrue(successMessage.isDisplayed()); }
UserManagementSteps.java
I click on Continue button on success message
public void ThenIClickOnContinueButtonOnSuccessMessage() { userManagementPage.clickOnContinueButton(); }
public void clickOnContinueButton() { WebDriverWait wait=new WebDriverWait(getDriver(),30); wait.until(ExpectedConditions.elementToBeClickable(continueButton)); continueButton.click(); }
@Then("I click on Continue button on success message$") public void ThenIClickOnContinueButtonOnSuccessMessage() { userManagementPage.clickOnContinueButton(); }
//step_function: public void ThenIClickOnContinueButtonOnSuccessMessage() { userManagementPage.clickOnContinueButton(); } //page_function: public void clickOnContinueButton() { WebDriverWait wait=new WebDriverWait(getDriver(),30); wait.until(ExpectedConditions.elementToBeClickable(continueButton)); continueButton.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on Continue button on success message ### response: //step_function: public void ThenIClickOnContinueButtonOnSuccessMessage() { userManagementPage.clickOnContinueButton(); } //page_function: public void clickOnContinueButton() { WebDriverWait wait=new WebDriverWait(getDriver(),30); wait.until(ExpectedConditions.elementToBeClickable(continueButton)); continueButton.click(); }
UserManagementSteps.java
I click on add new user button to create user
public void ThenIClickOnAddNewUserButtonToCreateUser() { userManagementPage.clickOnAddNewUser(); }
public void clickOnAddNewUser() { addNewUser.click(); }
@Then("I click on add new user button to create user$") public void ThenIClickOnAddNewUserButtonToCreateUser() { userManagementPage.clickOnAddNewUser(); }
//step_function: public void ThenIClickOnAddNewUserButtonToCreateUser() { userManagementPage.clickOnAddNewUser(); } //page_function: public void clickOnAddNewUser() { addNewUser.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on add new user button to create user ### response: //step_function: public void ThenIClickOnAddNewUserButtonToCreateUser() { userManagementPage.clickOnAddNewUser(); } //page_function: public void clickOnAddNewUser() { addNewUser.click(); }
UserManagementSteps.java
I select the role user
public void ThenISelecTheRoleUser() { userManagementPage.selectRole(); }
public void selectRole(int num) throws InterruptedException { String role=String.format(parameterizedRole, num); WebElement elem=getDriver().findElement(By.xpath(role)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Thread.sleep(2000); clickOn(elem); }
@Then("I select the role user$") public void ThenISelecTheRoleUser() { userManagementPage.selectRole(); }
//step_function: public void ThenISelecTheRoleUser() { userManagementPage.selectRole(); } //page_function: public void selectRole(int num) throws InterruptedException { String role=String.format(parameterizedRole, num); WebElement elem=getDriver().findElement(By.xpath(role)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Thread.sleep(2000); clickOn(elem); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I select the role user ### response: //step_function: public void ThenISelecTheRoleUser() { userManagementPage.selectRole(); } //page_function: public void selectRole(int num) throws InterruptedException { String role=String.format(parameterizedRole, num); WebElement elem=getDriver().findElement(By.xpath(role)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Thread.sleep(2000); clickOn(elem); }
UserManagementSteps.java
I select the role (.*
public void ThenISelecTheRole(int num) throws InterruptedException { userManagementPage.selectRole(num); }
public void selectRole(int num) throws InterruptedException { String role=String.format(parameterizedRole, num); WebElement elem=getDriver().findElement(By.xpath(role)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Thread.sleep(2000); clickOn(elem); }
@Then("I select the role (.*)$") public void ThenISelecTheRole(int num) throws InterruptedException { userManagementPage.selectRole(num); }
//step_function: public void ThenISelecTheRole(int num) throws InterruptedException { userManagementPage.selectRole(num); } //page_function: public void selectRole(int num) throws InterruptedException { String role=String.format(parameterizedRole, num); WebElement elem=getDriver().findElement(By.xpath(role)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Thread.sleep(2000); clickOn(elem); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I select the role (.* ### response: //step_function: public void ThenISelecTheRole(int num) throws InterruptedException { userManagementPage.selectRole(num); } //page_function: public void selectRole(int num) throws InterruptedException { String role=String.format(parameterizedRole, num); WebElement elem=getDriver().findElement(By.xpath(role)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Thread.sleep(2000); clickOn(elem); }
UserManagementSteps.java
After fetching data from data file)? I verify (.*) user is created or edited
public void ThenIVerifyUserIsCreated(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.varifyUserCreatedOrEdited(value+generatedString); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
@Then("(After fetching data from data file)? I verify (.*) user is created or edited$") public void ThenIVerifyUserIsCreated(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.varifyUserCreatedOrEdited(value+generatedString); }
//step_function: public void ThenIVerifyUserIsCreated(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.varifyUserCreatedOrEdited(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file)? I verify (.*) user is created or edited ### response: //step_function: public void ThenIVerifyUserIsCreated(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); userManagementPage.varifyUserCreatedOrEdited(value+generatedString); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File("./data.properties"))); String value=properties.getProperty(key); return value; }
UserManagementSteps.java
I verify (.*) user is edited
public void ThenIVerifyUserIsEdited(String user) { userManagementPage.varifyUserCreatedOrEdited(user+generatedString); }
public void varifyUserCreatedOrEdited(String user) { String buttonXpath=String.format(parameterizedUserName, user); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Assert.assertTrue(elem.isDisplayed()); }
@Then("I verify (.*) user is edited$") public void ThenIVerifyUserIsEdited(String user) { userManagementPage.varifyUserCreatedOrEdited(user+generatedString); }
//step_function: public void ThenIVerifyUserIsEdited(String user) { userManagementPage.varifyUserCreatedOrEdited(user+generatedString); } //page_function: public void varifyUserCreatedOrEdited(String user) { String buttonXpath=String.format(parameterizedUserName, user); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Assert.assertTrue(elem.isDisplayed()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify (.*) user is edited ### response: //step_function: public void ThenIVerifyUserIsEdited(String user) { userManagementPage.varifyUserCreatedOrEdited(user+generatedString); } //page_function: public void varifyUserCreatedOrEdited(String user) { String buttonXpath=String.format(parameterizedUserName, user); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),15); wait.until(ExpectedConditions.elementToBeClickable(elem)); Assert.assertTrue(elem.isDisplayed()); }
UserManagementSteps.java
I verify groups pop up should open
public void IVerifyGroupsPopUpShouldOpen() { userManagementPage.varifyGroupsPopupOpened(); }
public void varifyGroupsPopupOpened() { Assert.assertTrue(groupsHeader.isVisible()); }
@Then("I verify groups pop up should open$") public void IVerifyGroupsPopUpShouldOpen() { userManagementPage.varifyGroupsPopupOpened(); }
//step_function: public void IVerifyGroupsPopUpShouldOpen() { userManagementPage.varifyGroupsPopupOpened(); } //page_function: public void varifyGroupsPopupOpened() { Assert.assertTrue(groupsHeader.isVisible()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify groups pop up should open ### response: //step_function: public void IVerifyGroupsPopUpShouldOpen() { userManagementPage.varifyGroupsPopupOpened(); } //page_function: public void varifyGroupsPopupOpened() { Assert.assertTrue(groupsHeader.isVisible()); }
UserManagementSteps.java
I verify delete group pop up should open
public void IVerifyDeleteGroupPopUpShouldOpen() { userManagementPage.varifyDeleteGroupPopupOpened(); }
public void varifyDeleteGroupPopupOpened() { Assert.assertTrue(deleteGroupPopup.isVisible()); }
@Then("I verify delete group pop up should open$") public void IVerifyDeleteGroupPopUpShouldOpen() { userManagementPage.varifyDeleteGroupPopupOpened(); }
//step_function: public void IVerifyDeleteGroupPopUpShouldOpen() { userManagementPage.varifyDeleteGroupPopupOpened(); } //page_function: public void varifyDeleteGroupPopupOpened() { Assert.assertTrue(deleteGroupPopup.isVisible()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify delete group pop up should open ### response: //step_function: public void IVerifyDeleteGroupPopUpShouldOpen() { userManagementPage.varifyDeleteGroupPopupOpened(); } //page_function: public void varifyDeleteGroupPopupOpened() { Assert.assertTrue(deleteGroupPopup.isVisible()); }
UserManagementSteps.java
I click on Delete Group button on delete group pop up
public void ThenIClickOnDeleteGroupButtonOnDeleteGroupPopUp() { userManagementPage.clickDeleteGroupOnPopup(); }
public void clickDeleteGroupOnPopup(){ clickOn(deleteGroupPopupButton); }
@Then("I click on Delete Group button on delete group pop up$") public void ThenIClickOnDeleteGroupButtonOnDeleteGroupPopUp() { userManagementPage.clickDeleteGroupOnPopup(); }
//step_function: public void ThenIClickOnDeleteGroupButtonOnDeleteGroupPopUp() { userManagementPage.clickDeleteGroupOnPopup(); } //page_function: public void clickDeleteGroupOnPopup(){ clickOn(deleteGroupPopupButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on Delete Group button on delete group pop up ### response: //step_function: public void ThenIClickOnDeleteGroupButtonOnDeleteGroupPopUp() { userManagementPage.clickDeleteGroupOnPopup(); } //page_function: public void clickDeleteGroupOnPopup(){ clickOn(deleteGroupPopupButton); }
UserManagementSteps.java
I verify create group pop up should open
public void ThenIVerifyCreateGroupPopUpShouldOpen() { userManagementPage.varifyCreateGroupPopupOpened(); }
public void varifyCreateGroupPopupOpened() { Assert.assertTrue(createGroupHeader.isVisible()); }
@Then("I verify create group pop up should open$") public void ThenIVerifyCreateGroupPopUpShouldOpen() { userManagementPage.varifyCreateGroupPopupOpened(); }
//step_function: public void ThenIVerifyCreateGroupPopUpShouldOpen() { userManagementPage.varifyCreateGroupPopupOpened(); } //page_function: public void varifyCreateGroupPopupOpened() { Assert.assertTrue(createGroupHeader.isVisible()); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I verify create group pop up should open ### response: //step_function: public void ThenIVerifyCreateGroupPopUpShouldOpen() { userManagementPage.varifyCreateGroupPopupOpened(); } //page_function: public void varifyCreateGroupPopupOpened() { Assert.assertTrue(createGroupHeader.isVisible()); }