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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: Search product with {string} keyword ### Output: public void searchProductWithKeyword(String productName) { homePage.searchProductData(productName); testContext.scenarioContext.setContext(Context.EXPECTED_DATA, productName); }
### 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 is same as list of individual (projects|locations) in dashboard ### Output: 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(); } }
### 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 see details ### Output: public void GivenIClickOnSeeDetails() { propertyDetailsPage.clickOnSeeDetails(); }
### 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 validate Success message should visible ### Output: public void validateSuccessPopupAndMessage() { Assert.assertTrue(success.isDisplayed()); Assert.assertTrue(successMessage.isDisplayed()); }
### 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 select (.*) from dropdown ### 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 validate that name, role, last active, member since & mapped locations columns should be visible ### Output: public void ThenIValidateThatNameRoleLastActiveMemberSinceMappedLocationsColumnsShouldBeVisible() { userManagementPage.varifyGridColumnsArePresent(); }
### 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 mapped locations ### Output: public void ThenIGetErrorMessageForMappedLocations(String expectedError) throws Exception { expectedError=commonPage.fetchUserManagementErrorMessageConstantsfromEnum(expectedError); userManagementPage.validateErrorMessage("Mapped Location(s)", 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 should successfully land to Login screen ### Output: public void validateLandedOnLoginScreen() { waitFor(sendMeACodeButton); }
### 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 assign (.*) Project ### Output: public void assignProject(String projectName) { waitFor(projectDropdown); clickOn(projectDropdown); String buttonXpath=String.format(parameterizedProject, projectName); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.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 select property (.*) from dropdown ### Output: public void clickOnSelectALocation() { clickOn(selectALocation); }
### 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 all location dropdown ### Output: public void clickOnAllLocations() { allLocations.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 prepare headers for (.*) API ### 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 Validate user firstname (.*) and lastname (.*) is 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: I verify delete user pop up should open ### Output: public void varifyDeleteUserPopupOpened() { Assert.assertTrue(deleteUserPopup.isVisible()); }
### 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 set request specification with the (.*) API for customer id (\\d+) with headers ### 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 click on group (.* ### 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 get error message (.*) for email ### Output: public void ThenIGetErrorMessageForEmail(String expectedError) throws Exception { expectedError=commonPage.fetchUserManagementErrorMessageConstantsfromEnum(expectedError); userManagementPage.validateErrorMessage("Email ID", 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: Input credentials to login without headers ### Output: public void inputCredentialsToLoginWithoutHeaders(DataTable dataTable) { List<String> dataRow = dataTable.row(0); String email = dataRow.get(0); System.out.println("row index 0 --- " + email); loginPage.fillEmailData(email); System.out.println("row index 1 --- " + dataRow.get(1)); System.out.println("row index 2 --- " + dataRow.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 page object 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 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 screen with static (text|subtext) (.*) in (Onboarding|Login|Signup) screen ### Output: public void waitForStaticText(String textOrSubText, String expectedStaticText, String screen) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); commonPage.waitForStaticText(textOrSubText,expectedStaticText); }
### 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 (.*) utility account number ### Output: public void enterUtilityAccountNumber(String utilityAccountNumber) { waitFor(utilityAccountNumber_txt); typeInto(utilityAccountNumber_txt, utilityAccountNumber); }
### 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 payment available is displayed ### Output: public void verifyNoPaymentavailable() { waitFor(noPaymentText); assertEquals(noPaymentText.getText(), "No payment 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I get error message (.*) for lastname ### Output: public void ThenIGetErrorMessageForLastname(String expectedError) throws Exception { expectedError=commonPage.fetchUserManagementErrorMessageConstantsfromEnum(expectedError); userManagementPage.validateErrorMessage("Last Name", 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I click on Sign Out on dashboard ### Output: public void clickSignOut(){ dashboardPage.signOut(); }
### 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 am on Onboarding screen with (.*) referral code ### Output: public void onOnboardingScreenWithReferralCode(String file, String referralCode) throws Throwable { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); onboardingFirstScreenPage.openReferralLink(referralCode); } }
### 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 have {int} {product} in the cart ### Output: public void addToCart(String productName) { String raw = "a[aria-label='Add “" + productName + "” to your cart']"; byte[] bytes = raw.getBytes(StandardCharsets.UTF_8); String utf8Encoded = new String(bytes, StandardCharsets.UTF_8); By addToCartBtn = By.cssSelector(utf8Encoded); waitForElementVisibility(titleTxt); click(addToCartBtn); click(viewCartLink); }
### 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 get error message (.*) for mobile_number ### 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I verify create group pop up should open ### Output: public void ThenIVerifyCreateGroupPopUpShouldOpen() { userManagementPage.varifyCreateGroupPopupOpened(); }
### 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 value (.*) in Signup email textfield ### Output: public void enterEmail(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginEmail(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 search for (.*) in search box ### Output: public void searchItem(String file, String search) throws IOException { if((file!=null)&&(file.contains("data file"))) search=commonPage.fetchDataFromDataProperties(search); billingPage.searchItem(file, search); }
### 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 (.*) button ### Output: public void clickButton(String buttonText) { String buttonXpath=String.format(parameterizedButton, buttonText); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.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: Home page without authorizations ### Output: public boolean defaultHomePageIsDisplayed() { headerLogoButton.isDisplayed(); searchInput.isDisplayed(); cartButton.isDisplayed(); bhinnekaCopyrightFooter.isDisplayed(); return true; }
### 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: I successfully download the Bill ### Output: public void downloadBill() { clickOn(download_button); String downloadPath = "C:\\Users\\siddharth.rawat\\Downloads"; File file = new File(downloadPath); if (file.exists()) { System.out.println(downloadPath + " is present"); }
### 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 incorrect OTP (.*) in Signup screen ### Output: public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
### 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 mandatory fields first name (.*), last name, phone number, email id, role and mapped location (.*) from the list ### 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 question mark on total net metering panel ### Output: public void clickOnToolTip() { clickOn(questionMark); }
### 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 the banner with text {string} ### Output: public void iShouldSeeTheBannerWithTxt(String text) { Assert.assertTrue(productPage.getBannerTxt().contains(text), "Expected: " + text + ", ACTUAL: " + productPage.getBannerTxt()); } }
### 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 value (.*) in Signup email textfield ### Output: public void enterEmail(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); signUpFirstPage.enterLoginEmail(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 see static text (.*) in Login screen ### Output: public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); }
### 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 OTP in SignUp screen ### Output: public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
### 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 step 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 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)); } }
### 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 ### Output: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.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 page object definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I get error message (.*) for email or mobile textfield ### 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 step 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 ThenIClickOnEditUserButtonOnUserInfoPopUp() { userManagementPage.clickOnEditUserInfo(); }
### 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 rows per page ### Output: public void changeRows() { waitFor(rowsPerPage); if(rowsPerPage.isEnabled()){ clickOn(rowsPerPage); clickOn(tenrows); clickOn(rowsPerPage); clickOn(twentyfiverows); }
### 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 dashboard ### Output: public void reachedDashboard() { waitFor(logoutLink); }
### 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 Submit button on SignUp Page ### Output: public void submitLogin() { getStarted.click(); waitABit(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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: After fetching data from data file)? I click on property (.* ### Output: public void ThenIClickOnPropertyName(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.clickBreadcrumbLink(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 (.*) breadcrumb near to property breadcrumb ### Output: public void GivenIVerifyProjectBreadcrumbNearToPropertyBreadcrumb(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); propertyDetailsPage.varifyBreadcrumbIsPresent(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 wait for message that Your Bill is Uploaded ### Output: public void verifyBillIsUploaded() { waitFor(billUploadedMsg); }
### 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 textfield Referral code prepopulated with (.*) in Onboarding screen ### Output: public void isReferralCodePrepopulatedWith(String file, String referralCode) throws Exception { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); expandingFarmsScreenPage.isReferralCodePrepopulatedWith(referralCode); }
### 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 SignUp screen ### Output: public void enterOTP(){ signupOTPPage.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: I click on Sign Out on dashboard ### Output: public void signOut() { waitFor(logoutLink); clickOn(logoutLink); }
### 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 in Signup ### 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 validate user is deleted ### Output: public void verifyUserIsDeleted() { Assert.assertTrue(noUserAvailable.isVisible()); }
### 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 Send me a code ### Output: public void sendMeACode() { adminLoginPage.clickSendMeACode(); }
### 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 ### 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I click on all location dropdown ### Output: public void ThenIClickOnAllLocationDropdown() { userManagementPage.clickOnAllLocations(); }
### 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 No document available is displayed ### Output: public void verifyNoDocumentavailable() { dashboardPage.verifyNoDocumentavailable(); }
### 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 email 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I click on Delete Group button on delete group pop up ### Output: public void ThenIClickOnDeleteGroupButtonOnDeleteGroupPopUp() { userManagementPage.clickDeleteGroupOnPopup(); }
### 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 (projects|locations) in dashboard ### Output: 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); }
### 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 add {int} quantity ### 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 page object 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 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"); }
### 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: I should see the banner with text {string} ### Output: public String getBannerTxt() { return getElementText(bannerTxt); }
### 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 place an order ### Output: public void iPlaceAnOrder() { checkoutPage.placeOrder(); }
### 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 (.*) usage in Allocated Usage ### Output: public void enterAllocatedUsage(String usage) { waitFor(allocatedUsage_txt); typeInto(allocatedUsage_txt, usage); }
### 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 Customer Status to (.* ### Output: public void changeStatus(String status) { adminLoginPage.changeCustomerStatus(status); }
### 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 or mobile textfield ### Output: 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"); }
### 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|subtext) (.*) in Onboarding screen ### Output: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=SupReferralLoginStaticTextsEnum.LOGIN_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "LOGIN_SCREEN1_STATIC_TEXT_HEADING": expectedStaticText=SupReferralLoginStaticTextsEnum.LOGIN_SCREEN1_STATIC_TEXT_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING": expectedStaticText=SupReferralLoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_EMAIL_HEADING.getValue(); break; case "LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING": expectedStaticText=SupReferralLoginStaticTextsEnum.LOGIN_SCREEN2_STATIC_TEXT_MOBILE_HEADING.getValue(); break; case "ONBOARDING_EXPANDING_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_EXPANDING_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_FARM_AVAILABLE_MARYLAND_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_FARM_AVAILABLE_MARYLAND_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_FARM_AVAILABLE_HAWAII_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_FARM_AVAILABLE_HAWAII_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_FARM_AVAILABLE_NEW_JERSEY_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_FARM_AVAILABLE_NEW_JERSEY_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_FARM_AVAILABLE_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_FARM_AVAILABLE_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_MARYLAND_GETTING_CLEANER_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_MARYLAND_GETTING_CLEANER_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_HAWAII_GETTING_CLEANER_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_HAWAII_GETTING_CLEANER_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_NEW_JERSEY_GETTING_CLEANER_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_NEW_JERSEY_GETTING_CLEANER_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_COMMUNITY_GREEN_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_COMMUNITY_GREEN_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_YOU_ARE_ALL_DONE_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_YOU_ARE_ALL_DONE_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_THANK_YOU_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_THANK_YOU_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_THANK_YOU_SCREEN_FARM_UNAVAILABLE_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_THANK_YOU_SCREEN_FARM_UNAVAILABLE_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_ESTIMATE_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_ESTIMATE_SCREEN_STATIC_TEXT_BLUE_BAR.getValue(); break; case "ONBOARDING_UTILITY_SCREEN_STATIC_TEXT": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_UTILITY_SCREEN_STATIC_TEXT.getValue(); break; case "ONBOARDING_LMI_SCREEN_STATIC_TEXT": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_LMI_SCREEN_STATIC_TEXT.getValue(); break; case "ONBOARDING_BENEFIT_SCREEN_STATIC_TEXT": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_BENEFIT_SCREEN_STATIC_TEXT.getValue(); break; case "ONBOARDING_PAYMENT_SCREEN_STATIC_TEXT_BLUE_BAR": expectedStaticText=OnboardingStaticTextsEnum.ONBOARDING_PAYMENT_SCREEN_STATIC_TEXT_BLUE_BAR.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: After fetching data from data file )?I search for (.*) in search box ### Output: public void searchColumn(String file, String search) throws IOException { if((file!=null)&&(file.contains("data file"))) search=commonPage.fetchDataFromDataProperties(search); adminLoginPage.searchColumn(search); }
### 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 heading will be Edit User ### Output: public void ThenIVerifyThatHeadingWillBeEditUser() { userManagementPage.varifyEditUserHeading(); } public int getRandomNumberUsingNextInt( ) { Random random = new Random(); return random.nextInt(9999 - 1001) + 1001; }
### 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 (tenant|landlord) tab of side navigation bar ### Output: public void clickTenantTab() { waitFor(tenantTab); clickOn(tenantTab); }
### 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 )?get error message (.*) for OTP textfields ### Output: 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); } }
### 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 add a {product} to the cart ### Output: public void addToCart(String productName) { String raw = "a[aria-label='Add “" + productName + "” to your cart']"; byte[] bytes = raw.getBytes(StandardCharsets.UTF_8); String utf8Encoded = new String(bytes, StandardCharsets.UTF_8); By addToCartBtn = By.cssSelector(utf8Encoded); waitForElementVisibility(titleTxt); click(addToCartBtn); click(viewCartLink); }
### 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 Send me a Code button ### Output: public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); }
### 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 set request specification with the (.*) API for customer id (\\d+) with headers ### 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 (dont )?give consent to send me a Code to my mobile number ### Output: public void giveOTPConsentForMobile(String dontFlag) throws Exception { if(dontFlag==null) loginFirstScreenPage.giveOTPConsentForMobile(); else loginFirstScreenPage.dontGiveOTPConsentForMobile(); } }
### 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 Cancel button to close groups popup ### Output: public void clickCancelGroupspopup() { clickOn(cancelGroupspopup); }
### 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 mobile_number ### Output: public void ThenIGetErrorMessageForMobile_Number(String expectedError) throws Exception { expectedError=commonPage.fetchUserManagementErrorMessageConstantsfromEnum(expectedError); userManagementPage.validateErrorMessage("Mobile Number", 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 validate dashboard shows (.*) message ### Output: public void validateTextPresent(String msg) { String path=String.format(message, msg); WebElement elem=getDriver().findElement(By.xpath(path)); assertTrue(elem.isDisplayed()); }
### 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 all the details for signing up in Signup Screen-2 ### Output: public void enterAddress1(String address1) { enter(address1).into(address1_txt); }
### 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 (.*) generation 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 page object definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I select the role (.* ### Output: 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); }
### 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 see secondary static text (.*) in Login screen ### Output: public void validateSecondaryStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateSecondaryStaticText(expectedStaticText); }
### 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 search for (.*) in search box ### 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 select (.*) select a location dropdown ### 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 upload (.*) document for LMI document ### 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 wait for message that Your Bill is Uploaded ### Output: public void verifyBillIsUploaded() { utilityScreenPage.verifyBillIsUploaded(); }
### 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 click on delete button icon to delete user (.* ### Output: 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); }
### 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 firstname ### 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 step definition function, written using Cucumber and Selenium frameworks, for the following input: ### Input: I wait for (\\d+) seconds ### Output: public void waitForDuration(int duration) { commonPage.waitForSometime(duration*1000); }
### 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 Utility provider dropdown ### Output: public void waitForUtilityProviderDropdown() { utilityProviderDropdown.waitUntilVisible(); }
### 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 select (.*) location from the list ### Output: public void ThenISelectLocationFromTheList(int locationNumberInDropdown) throws InterruptedException { userManagementPage.clickOnMappedLocations(); userManagementPage.selectNthLocationFromThedropdown(locationNumberInDropdown); }
### 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 click on delete button icon to delete 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: I get error message (.*) for referral code textfield ### 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"); }