text
stringlengths 413
4.53k
|
---|
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I add API params with parameter (.*) as (.*
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify the individual (projects|locations) in dashboard
### Output:
public void verifyIndividualProjects(String projectOrLocation) {
if(projectOrLocation.contains("project")) {
dashboardPage.verifyIndividualProjects();
} else if(projectOrLocation.contains("location")) {
dashboardPage.verifyIndividualLocations();
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify that (project|location) dropdown list is same as list of individual (projects|locations) in dashboard
### Output:
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));
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I enter (card|US bank account) details for utility savings
### Output:
public void enterCardDetails(String type, DataTable dt){
List<String> list=dt.asList(String.class);
if(type.contains("card"))
stripePaymentScreenPage.enterCardDetails(list.get(0),list.get(1),list.get(2), list.get(3));
else if(type.contains("bank"))
stripePaymentScreenPage.enterAccountDetails(list.get(0),list.get(1),list.get(2));
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I change rows per page
### Output:
public void change_rows() {
billingPage.changeRows();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Input credentials to login with headers table
### Output:
public void inputCredentialsToLoginWithHeadersTable(DataTable dataTable) {
List<Map<String,String>> dataRow = dataTable.asMaps(String.class,String.class);
//Use for...loop if you have multiple data table
for (Map<String, String> dataMap : dataRow) {
String email = dataMap.get("Email");
loginPage.fillEmailData(email);
System.out.println("row header email " + email);
System.out.println("row index 1 --- " + dataMap.get("Password"));
System.out.println("row index 2 --- " + dataMap.get("Account Type"));
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Input data with {string} in search bar
### Output:
public void inputDataSearch(String data) {
homePage.setSearchInput(data);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I zoom out in browser
### Output:
public void zoomOut() throws AWTException{
commonPage.zoomOut();
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I enter firstname (.*), lastname (.*) mobile number (.*) and email (.*
### Output:
public void enterFirstName(String firstname) {
firstName.clear();
firstName.sendKeys(firstname);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on continue button in Signup Screen-1
### Output:
public void clickOnContinueButton(){
signUpFirstPage.clickOnContinue();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I validate Success message should visible
### Output:
public void ThenIValidateSuccessMessageShouldVisible()
{
userManagementPage.validateSuccessPopupAndMessage();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on (.*) button
### Output:
public void clickButton(String buttonText) {
commonPage.clickButton(buttonText);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I enter value (.*) in email or mobile textfield
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on the close button on Admin Page popup
### Output:
public void clickClosePopup() {
waitFor(closePopupButton);
clickOn(closePopupButton);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on (.*) button
### Output:
public void clickButton(String buttonText) {
commonPage.clickButton(buttonText);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify that total net metering panel is visible
### Output:
public void ThenIVarifyTotalNetMeteringPanelIsVisible()
{
propertyDetailsPage.varifyTotalNetMeteringIsVisible();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I enter the correct Email OTP in Login screen
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click outside
### Output:
public void clickOutside() {
commonPage.clickOutside();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I see static text (.*) in Login screen
### Output:
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");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I validate dashboard shows (.*) message
### Output:
public void validateTextPresent(String msg){
commonPage.validateTextPresent(msg);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I wait for message that Your Document is Uploaded
### Output:
public void verifyDocumentIsUploaded() {
waitFor(documentUploadedMsg);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Product detail with {string} type is displayed
### Output:
public void productDetailWithType(String type) {
Assert.assertTrue(productDetailPage.defaultProductDetailPageIsDisplayed());
switch (type) {
case "non fisik":
Assert.assertTrue(productDetailPage.nonFisikProductDetailDataIsDisplayed());
break;
case "fisik":
Assert.assertTrue(productDetailPage.fisikProductDetailDataIsDisplayed());
break;
}
String actualBreadcrumbName = productDetailPage.getAllBreadcrumbName(3).toLowerCase();
String expectedBreadcrumbName = testContext.scenarioContext.getContext(Context.EXPECTED_DATA).toString().toLowerCase();
Assert.assertTrue(actualBreadcrumbName.contains(expectedBreadcrumbName));
Assert.assertTrue(productDetailPage.moreBreadcrumbIsDisplayed());
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I get error message (.*) for lastname
### Output:
public String fetchUserManagementErrorMessageConstantsfromEnum(String expectedError) throws Exception {
switch(expectedError) {
case "INVALID_FIRSTNAME_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_FIRSTNAME_ERROR.getValue();
break;
case "INVALID_LASSTNAME_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_LASSTNAME_ERROR.getValue();
break;
case "FIRSTNAME_NUMBER_SPECIAL_CHAR_ERROR":
expectedError=UserManagementErrorMessagesEnum.FIRSTNAME_NUMBER_SPECIAL_CHAR_ERROR.getValue();
break;
case "LASTNAME_NUMBER_SPECIAL_CHAR_ERROR":
expectedError=UserManagementErrorMessagesEnum.LASTNAME_NUMBER_SPECIAL_CHAR_ERROR.getValue();
break;
case "INVALID_MOBILE_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue();
break;
case "MOBILE_START_ZERO_ERROR":
expectedError=UserManagementErrorMessagesEnum.MOBILE_START_ZERO_ERROR.getValue();
break;
case "INVALID_EMAIL_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue();
break;
case "EMAIL_MAX_50_CHARS":
expectedError=UserManagementErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue();
break;
case "SELECT_ROLE_ERROR":
expectedError=UserManagementErrorMessagesEnum.SELECT_ROLE_ERROR.getValue();
break;
case "SELECT_MAPPED_LOCATIONS_ERROR":
expectedError=UserManagementErrorMessagesEnum.SELECT_MAPPED_LOCATIONS_ERROR.getValue();
break;
case "FIRSTNAME_MAX_30_CHARS":
expectedError=UserManagementErrorMessagesEnum.FIRSTNAME_MAX_30_CHARS.getValue();
break;
case "LASTNAME_MAX_25_CHARS":
expectedError=UserManagementErrorMessagesEnum.LASTNAME_MAX_25_CHARS.getValue();
break;
case "INVALID_GROUPNAME_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_GROUPNAME_ERROR.getValue();
break;
case "GROUPNAME_NUMBER_SPECIAL_CHAR_ERROR":
expectedError=UserManagementErrorMessagesEnum.GROUPNAME_NUMBER_SPECIAL_CHAR_ERROR.getValue();
break;
case "GROUPNAME_MAX_30_CHARS":
expectedError=UserManagementErrorMessagesEnum.GROUPNAME_MAX_30_CHARS.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");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I change to (.*) filter
### Output:
public void changeFilter(String filter){
if(filter.contains("1M"))
clickOn(oneMonthFilter);
else if(filter.contains("6M"))
clickOn(sixMonthFilter);
else if(filter.contains("1Y"))
clickOn(oneYearFilter);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I verify (.*) generation with (.*
### Output:
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)));
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Search product link with {string} data is displayed
### Output:
public void searchProductLinkWithDataIsDisplayed(String data) {
String dataLowerCase = data.toLowerCase();
String actualSearchProductLink = homePage.getSearchProductLink().toLowerCase();
Assert.assertEquals("tampilkan pencarian dari " + dataLowerCase, actualSearchProductLink);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I enter in Referral code textfield \([\]*)\ in Onboarding screen
### Output:
public void enterSpecialCharInReferralCode(String value) throws Throwable {
expandingFarmsScreenPage.enterSpecialCharInReferralCode(value);
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on edit user button on user info pop up
### Output:
public void clickOnEditUserInfo() {
clickOn(EditUserInfo);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I enter all the details for signing up in Signup Screen-1
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on the Save button on Admin Page
### Output:
public void clickSave() {
adminLoginPage.clickSave();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I verify (.*) user is created or edited
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Go to cart page without authorizations
### Output:
public void clickCartButton() {
cartButton.isEnabled();
cartButton.click();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I enter first name (.*), last name, phone number, email id and role in edit user popup
### Output:
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+" |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I verify (.*) user is created or edited
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I use {word} arrow to change the quantity
### Output:
public int updateQuantityUsingArrows(String direction) {
switch (direction) {
case "up": {
waitForElementToBeClickable(quantityInputFld).sendKeys(Keys.ARROW_UP);
break;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I prepare headers for (.*) API
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I searched for (.*) user
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I add API params with parameter (.*) as (.*
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Click selanjutnya button
### Output:
public void clickSelanjutnyaButton() {
selanjutnyaButton.isEnabled();
selanjutnyaButton.click();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I choose to Resend OTP
### Output:
public void resendOtp() {
clickOn(resendButton);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on the close button on Admin Page popup
### Output:
public void clickClosePopup() {
adminLoginPage.clickClosePopup();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Input credentials to login without headers
### Output:
public void fillEmailData(String email) {
emailField.isEnabled();
emailField.clear();
emailField.sendKeys(email);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
the selected quantity is {int}
### Output:
public void theSelectedQuantityIs(int currentQuantity) {
productPage.enterQuantity(currentQuantity);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I add API params with parameter (.*) as (.*
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Select product in {int} list
### Output:
public void selectProductInList(int list) {
Assert.assertTrue(productListPage.searchResultPageIsDisplayed());
productListPage.selectProductInList(list);
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify No document available is displayed
### Output:
public void verifyNoDocumentavailable() {
waitFor(noDocumentText);
assertEquals(noDocumentText.getText(), "No document available");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I enter (.*) in Referral code textfield in Onboarding screen
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield in Signup
### Output:
public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException {
if((file!=null)&&(file.contains("data file")))
value=commonPage.fetchDataFromDataProperties(value);
signUpFirstPage.validatePrepopulatedEmailOrMobileTextfield(value);
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I fetch OTP of Email (.*
### Output:
public String getEmailOtp(String file, String email) throws InterruptedException, FileNotFoundException, IOException {
yopMailHomePage.openNewTabAndSwitch();
yopMailHomePage.getDriver().get("https://yopmail.com/en/");
if((file!=null) && (file.contains("data file")))
email=commonPage.fetchDataFromDataProperties(email);
yopMailHomePage.enterEmail(email);
otp =yopMailHomePage.getOtp();
yopMailHomePage.switchBackToOriginalWindow();
return otp;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I verify (.*) in selected in dropdown and on property detail page is same
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
Click selanjutnya button
### Output:
public void clickSelanjutnyaButton() {
loginPage.clickSelanjutnyaButton();
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I (dont )?see default text (.*) in email or mobile textfield
### Output:
public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) {
loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I searched for (.*) user
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I should successfully land to Admin Dashboard
### Output:
public void landAdminDashboard() {
adminDashboard.shouldBeVisible();
waitFor(5000);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I edit Customer Name as (.*) and save
### Output:
public void CustomerName(String name) {
adminLoginPage.enterCustomerName(name);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I enter the correct OTP in Login screen( but the old one| but the expired one)?
### Output:
public void enterCorrectlyFetchedOtp(String oldOrNew) {
loginSecondScreenPage.enterOtp(otp);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
validate number of users asign to selected location or group
### Output:
public int getNumOfUsers() {
String users=numOfUsers.getText();
users=users.substring(users.length()-2, users.length());
int NumberOfUsers=Integer.parseInt(users);
return NumberOfUsers;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify delete user pop up should open
### Output:
public void ThenIVerifyDeleteUserPopUpShouldOpen()
{
userManagementPage.varifyDeleteUserPopupOpened();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I should see an error
### Output:
public void iShouldSeeAnError() {
Assert.assertEquals(productPage.getValidationMsg(), "Value must be greater than or equal to 1.");
Assert.fail("Failing this step intentionally to check the screenshot attached int the Report");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I (dont )?see textfield Referral code in Onboarding screen
### Output:
public void validateTextfieldReferralCode(String dontFlag) throws Exception {
expandingFarmsScreenPage.validateTextfieldReferralCode(dontFlag);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on Send me a code
### Output:
public void clickSendMeACode() {
waitFor(sendMeACodeButton);
clickOn(sendMeACodeButton);
waitFor(10000);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
the selected quantity is {int}
### Output:
public void enterQuantity(int quantity) {
clearAndSendKeys(quantityInputFld, Integer.toString(quantity));
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify that (project|location) dropdown list (projects|locations) in dashboard
### Output:
public void verifyLeftPannelProjects(String locationOrProjectDropdown, String projectsOrLocations) {
dashboardPage.verifyLeftPannelProjectsOrLocations();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I validate user is deleted
### Output:
public void GivenIValidateUserIsDeleted()
{
userManagementPage.verifyUserIsDeleted();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I choose (.*) from Utility provider dropdown
### Output:
public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException {
if((file!=null) && (file.contains("data file")))
utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider);
checkAvailabilityScreenPage.selectUtilityProvider(utilityProvider);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I should successfully land to Admin Dashboard
### Output:
public void landAdminDashboard(){
adminLoginPage.landAdminDashboard();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I select (.*) select a location dropdown
### Output:
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);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on continue button in Signup Screen-1
### Output:
public void clickOnContinue(){
clickOn(continue_btn);
waitABit(8000);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify Project list for (Carbon|Billing
### Output:
public void verifyCarbon_Billing_IndividualProjects(String value) {
dashboardPage.verifyCarbon_Billing_IndividualProjects(value);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I verify correct (.*) assign to (.*
### Output:
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));
}
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I enter value (.*) in Signup mobile textfield
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I (dont )?give consent to send me a Code to my mobile number
### Output:
public void giveOTPConsentForMobile() {
mobileOtpConsentCheckbox=getDriver().findElement(By.xpath("//input[@type='checkbox']"));
JavascriptExecutor js=(JavascriptExecutor)getDriver();
if(!mobileOtpConsentCheckbox.isSelected())
js.executeScript("arguments[0].click();", mobileOtpConsentCheckbox);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on question mark on total net metering panel
### Output:
public void IClickOnQuestionMarkOnTotalNetMeteringPanel()
{
propertyDetailsPage.clickOnToolTip();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I use {word} arrow to change the quantity
### Output:
public void iUseDirectionArrowToChangeTheQuantity(String direction) {
context.product = new Product();
context.product.setQuantity(productPage.updateQuantityUsingArrows(direction));
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify groups pop up should open
### Output:
public void IVerifyGroupsPopUpShouldOpen()
{
userManagementPage.varifyGroupsPopupOpened();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I edit firstname and last name as (.*
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I should get a masking on (email|mobile number) (.*
### Output:
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);
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I have {int} {product} in the cart
### Output:
public void iHaveInTheCart(int quantity, Product product) throws Exception {
// storePage.addToCart("Blue Shoes");
// CartApi cartApi = new CartApi(context.cookies.get());
CartApi cartApi = new CartApi(context.cookies.getCookies());
product = context.productList.getProductByName(product.getName());
cartApi.addToCart(product.getId(), quantity);
// context.cookies.set(cartApi.getCookies());
context.cookies.setCookies(cartApi.getCookies());
context.cookies.injectCookiesToBrowser(context.driver);
context.product = product;
}
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I enter (.*) in Referral code textfield in Onboarding screen
### Output:
public void enterValueInReferralCode(String file, String value) throws Throwable {
if((file!=null)&&(file.contains("data file")))
value=commonPage.fetchDataFromDataProperties(value);
expandingFarmsScreenPage.enterReferralCode(value);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file)? I validate group (.*) is created or edited
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I am on Onboarding screen with (.*) referral code
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I navigate to property detail page
### Output:
public void ThenINavigateToPropertyDetailPage()
{
propertyDetailsPage.varifyBreadcrumbIsPresent("Dashboard");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I verify tooltip text
### Output:
public void ThenIVerifyTooltipTextIs()
{
String expectedTotalNetMeteringToolTipText=LoginStaticTextsEnum.TOTALNETMETERINGTOOLTIPTEXT.getValue();
String actualTotalNetMeteringToolTipText=propertyDetailsPage.getToolTipText();
Assert.assertTrue(expectedTotalNetMeteringToolTipText.equals(actualTotalNetMeteringToolTipText));
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I enter the incorrect OTP (.*) in Signup screen
### Output:
public void enterIncorrectOTP(String incorrectOtp) {
signUpSecondScreenPage.enterOtp(incorrectOtp);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I get error message (.*) for email or mobile textfield
### Output:
public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception {
expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError);
loginFirstScreenPage.validateErrorMessage(expectedError);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I choose to Go Back
### Output:
public void goBack() {
goBack.click();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on add new user button to create user
### Output:
public void clickOnAddNewUser() {
addNewUser.click();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I close the browser
### Output:
public void closeBrowser(){
getDriver().close();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I verify (.*) rides saved with (.*
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I choose to Go Back in Signup
### Output:
public void goBack() {
signUpSecondScreenPage.goBack();
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on Request Information button on \'Help And Support\' screen
### Output:
public void clickRequestInformationButton() {
clickOn(requestInformationButton);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I fetch value of (.*) from response of (.*) API and write to data file
### Output:
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!!");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a step definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I get error message (.*) for email or mobile textfield in Signup
### Output:
public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception {
expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError);
signUpFirstPage.validateErrorMessage(expectedError);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield in Signup
### Output:
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;
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on continue button in Signup Screen-2
### Output:
public void clickOnContinue(){
clickOn(continue_btn);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I click on the (Carbon|Billing|Data Health|Income|Documents|\'Help And Support\') button in left panel of dashboard
### Output:
public void clickCarbon() {
waitFor(carbonButton);
clickOn(carbonButton);
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I (dont )?get error message (.*) for OTP textfields in Signup
### Output:
public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception {
switch(expectedError) {
case "INVALID_MOBILE_ERROR":
expectedError=SupReferralLoginErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue();
break;
case "INVALID_EMAIL_ERROR":
expectedError=SupReferralLoginErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue();
break;
case "INVALID_EMAIL_MOBILE_ERROR":
expectedError=SupReferralLoginErrorMessagesEnum.INVALID_EMAIL_MOBILE_ERROR.getValue();
break;
case "EMAIL_MAX_50_CHARS":
expectedError=SupReferralLoginErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue();
break;
case "INCORRECT_OTP":
expectedError=SupReferralLoginErrorMessagesEnum.INCORRECT_OTP.getValue();
break;
case "INCOMPLETE_OTP":
expectedError=SupReferralLoginErrorMessagesEnum.INCOMPLETE_OTP.getValue();
break;
case "INVALID_SESSION":
expectedError=SupReferralLoginErrorMessagesEnum.INVALID_SESSION.getValue();
break;
case "INCORRECT_PASSWORD":
expectedError=SupReferralLoginErrorMessagesEnum.INCORRECT_PASSWORD.getValue();
break;
case "REFERRAL_CODE_NOT_EXIST":
expectedError=OnboardingErrorMessagesEnum.REFERRAL_CODE_NOT_EXIST.getValue();
break;
case "REFERRAL_CODE_SPECIAL_CHARACTER":
expectedError=OnboardingErrorMessagesEnum.REFERRAL_CODE_SPECIAL_CHARACTER.getValue();
break;
case "USER_DISABLED":
expectedError=SupReferralLoginErrorMessagesEnum.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");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I get error message (.*) for email
### Output:
public String fetchUserManagementErrorMessageConstantsfromEnum(String expectedError) throws Exception {
switch(expectedError) {
case "INVALID_FIRSTNAME_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_FIRSTNAME_ERROR.getValue();
break;
case "INVALID_LASSTNAME_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_LASSTNAME_ERROR.getValue();
break;
case "FIRSTNAME_NUMBER_SPECIAL_CHAR_ERROR":
expectedError=UserManagementErrorMessagesEnum.FIRSTNAME_NUMBER_SPECIAL_CHAR_ERROR.getValue();
break;
case "LASTNAME_NUMBER_SPECIAL_CHAR_ERROR":
expectedError=UserManagementErrorMessagesEnum.LASTNAME_NUMBER_SPECIAL_CHAR_ERROR.getValue();
break;
case "INVALID_MOBILE_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_MOBILE_ERROR.getValue();
break;
case "MOBILE_START_ZERO_ERROR":
expectedError=UserManagementErrorMessagesEnum.MOBILE_START_ZERO_ERROR.getValue();
break;
case "INVALID_EMAIL_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_EMAIL_ERROR.getValue();
break;
case "EMAIL_MAX_50_CHARS":
expectedError=UserManagementErrorMessagesEnum.EMAIL_MAX_50_CHARS.getValue();
break;
case "SELECT_ROLE_ERROR":
expectedError=UserManagementErrorMessagesEnum.SELECT_ROLE_ERROR.getValue();
break;
case "SELECT_MAPPED_LOCATIONS_ERROR":
expectedError=UserManagementErrorMessagesEnum.SELECT_MAPPED_LOCATIONS_ERROR.getValue();
break;
case "FIRSTNAME_MAX_30_CHARS":
expectedError=UserManagementErrorMessagesEnum.FIRSTNAME_MAX_30_CHARS.getValue();
break;
case "LASTNAME_MAX_25_CHARS":
expectedError=UserManagementErrorMessagesEnum.LASTNAME_MAX_25_CHARS.getValue();
break;
case "INVALID_GROUPNAME_ERROR":
expectedError=UserManagementErrorMessagesEnum.INVALID_GROUPNAME_ERROR.getValue();
break;
case "GROUPNAME_NUMBER_SPECIAL_CHAR_ERROR":
expectedError=UserManagementErrorMessagesEnum.GROUPNAME_NUMBER_SPECIAL_CHAR_ERROR.getValue();
break;
case "GROUPNAME_MAX_30_CHARS":
expectedError=UserManagementErrorMessagesEnum.GROUPNAME_MAX_30_CHARS.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");
} |
### Instruction: Use the Task below and the Input given to write the Response, which is a Java programming code that can solve the following Task:
### Task: Write automation script for UI Testing that contains only a page object definition function, written using Cucumber and Selenium frameworks, for the following input:
### Input:
I edit Customer Name as (.*) and save
### Output:
public void enterCustomerName(String name) {
typeInto(name_txt, name);
waitFor(5000);
} |