step_file_name
stringclasses
26 values
scenario
stringlengths
13
161
step_function
stringlengths
33
2.68k
page_function
stringlengths
41
4.12k
step_function_scenario
stringlengths
59
2.81k
code
stringlengths
110
4.43k
text
stringlengths
305
4.7k
BrowserControlSteps.java
I close the browser
public void closeBrowser(){ browserControlPage.closeBrowser(); } }
public void closeBrowser(){ getDriver().close(); }
@And("I close the browser") public void closeBrowser(){ browserControlPage.closeBrowser(); } }
//step_function: public void closeBrowser(){ browserControlPage.closeBrowser(); } } //page_function: public void closeBrowser(){ getDriver().close(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I close the browser ### response: //step_function: public void closeBrowser(){ browserControlPage.closeBrowser(); } } //page_function: public void closeBrowser(){ getDriver().close(); }
CommonSteps.java
I wait for (\\d+) seconds
public void waitForDuration(int duration) { commonPage.waitForSometime(duration*1000); }
public void waitForSometime(int duration) { waitABit(duration); }
@When("^I wait for (\\d+) seconds$") public void waitForDuration(int duration) { commonPage.waitForSometime(duration*1000); }
//step_function: public void waitForDuration(int duration) { commonPage.waitForSometime(duration*1000); } //page_function: public void waitForSometime(int duration) { waitABit(duration); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I wait for (\\d+) seconds ### response: //step_function: public void waitForDuration(int duration) { commonPage.waitForSometime(duration*1000); } //page_function: public void waitForSometime(int duration) { waitABit(duration); }
CommonSteps.java
I click outside
public void clickOutside() { commonPage.clickOutside(); }
public void clickOutside() { outside.click(); }
@When("^I click outside$") public void clickOutside() { commonPage.clickOutside(); }
//step_function: public void clickOutside() { commonPage.clickOutside(); } //page_function: public void clickOutside() { outside.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click outside ### response: //step_function: public void clickOutside() { commonPage.clickOutside(); } //page_function: public void clickOutside() { outside.click(); }
CommonSteps.java
I click on (.*) button
public void clickButton(String buttonText) { commonPage.clickButton(buttonText); }
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(); }
@Then("^I click on (.*) button$") public void clickButton(String buttonText) { commonPage.clickButton(buttonText); }
//step_function: public void clickButton(String buttonText) { commonPage.clickButton(buttonText); } //page_function: 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(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on (.*) button ### response: //step_function: public void clickButton(String buttonText) { commonPage.clickButton(buttonText); } //page_function: 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(); }
CommonSteps.java
I click on (.*) tab
public void clickTab(String tabText) { commonPage.clickTab(tabText); }
public void clickTab(String tabText) { String buttonXpath=String.format(parameterizedTab, tabText); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.click(); }
@Then("^I click on (.*) tab$") public void clickTab(String tabText) { commonPage.clickTab(tabText); }
//step_function: public void clickTab(String tabText) { commonPage.clickTab(tabText); } //page_function: public void clickTab(String tabText) { String buttonXpath=String.format(parameterizedTab, tabText); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on (.*) tab ### response: //step_function: public void clickTab(String tabText) { commonPage.clickTab(tabText); } //page_function: public void clickTab(String tabText) { String buttonXpath=String.format(parameterizedTab, tabText); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.click(); }
CommonSteps.java
After fetching data from data file )?I fetch OTP of Email (.*
public void 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(); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@And("^(After fetching data from data file )?I fetch OTP of Email (.*)$") public void 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(); }
//step_function: public void 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(); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I fetch OTP of Email (.* ### response: //step_function: public void 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(); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
CommonSteps.java
I enter the correct OTP in Login screen( but the old one| but the expired one)?
public void enterCorrectlyFetchedOtp(String oldOrNew) { loginSecondScreenPage.enterOtp(otp); }
public void enterOtp(String correctOtp) { waitFor(otpTextFields); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); waitABit(200); typeInto(otpTextFields,correctOtp); }
@And("^I enter the correct OTP in Login screen( but the old one| but the expired one)?$") public void enterCorrectlyFetchedOtp(String oldOrNew) { loginSecondScreenPage.enterOtp(otp); }
//step_function: public void enterCorrectlyFetchedOtp(String oldOrNew) { loginSecondScreenPage.enterOtp(otp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); waitABit(200); typeInto(otpTextFields,correctOtp); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter the correct OTP in Login screen( but the old one| but the expired one)? ### response: //step_function: public void enterCorrectlyFetchedOtp(String oldOrNew) { loginSecondScreenPage.enterOtp(otp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); otpTextFields.clear(); waitABit(200); typeInto(otpTextFields,correctOtp); }
CommonSteps.java
I enter the correct OTP in SignUp screen
public void enterOTP(){ signupOTPPage.enterOtp(otp); }
public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
@And("^I enter the correct OTP in SignUp screen$") public void enterOTP(){ signupOTPPage.enterOtp(otp); }
//step_function: public void enterOTP(){ signupOTPPage.enterOtp(otp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter the correct OTP in SignUp screen ### response: //step_function: public void enterOTP(){ signupOTPPage.enterOtp(otp); } //page_function: public void enterOtp(String correctOtp) { waitFor(otpTextFields); typeInto(otpTextFields,correctOtp); }
CommonSteps.java
I navigate to screen with static (text|subtext) (.*) in (Onboarding|Login|Signup) screen
public void waitForStaticText(String textOrSubText, String expectedStaticText, String screen) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); commonPage.waitForStaticText(textOrSubText,expectedStaticText); }
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"); }
@Then("^I navigate to screen with static (text|subtext) (.*) in (Onboarding|Login|Signup) screen$") public void waitForStaticText(String textOrSubText, String expectedStaticText, String screen) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); commonPage.waitForStaticText(textOrSubText,expectedStaticText); }
//step_function: public void waitForStaticText(String textOrSubText, String expectedStaticText, String screen) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); commonPage.waitForStaticText(textOrSubText,expectedStaticText); } //page_function: 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"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I navigate to screen with static (text|subtext) (.*) in (Onboarding|Login|Signup) screen ### response: //step_function: public void waitForStaticText(String textOrSubText, String expectedStaticText, String screen) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); commonPage.waitForStaticText(textOrSubText,expectedStaticText); } //page_function: 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"); }
adminLoginSteps.java
I click on Send me a code
public void sendMeACode() { adminLoginPage.clickSendMeACode(); }
public void clickSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); waitFor(10000); }
@And("^I click on Send me a code$") public void sendMeACode() { adminLoginPage.clickSendMeACode(); }
//step_function: public void sendMeACode() { adminLoginPage.clickSendMeACode(); } //page_function: public void clickSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); waitFor(10000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on Send me a code ### response: //step_function: public void sendMeACode() { adminLoginPage.clickSendMeACode(); } //page_function: public void clickSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); waitFor(10000); }
adminLoginSteps.java
I should successfully land to Admin Dashboard
public void landAdminDashboard(){ adminLoginPage.landAdminDashboard(); }
public void landAdminDashboard() { adminDashboard.shouldBeVisible(); waitFor(5000); }
@Then("^I should successfully land to Admin Dashboard$") public void landAdminDashboard(){ adminLoginPage.landAdminDashboard(); }
//step_function: public void landAdminDashboard(){ adminLoginPage.landAdminDashboard(); } //page_function: public void landAdminDashboard() { adminDashboard.shouldBeVisible(); waitFor(5000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I should successfully land to Admin Dashboard ### response: //step_function: public void landAdminDashboard(){ adminLoginPage.landAdminDashboard(); } //page_function: public void landAdminDashboard() { adminDashboard.shouldBeVisible(); waitFor(5000); }
adminLoginSteps.java
After fetching data from data file )?I search for (.*) in search box
public void searchColumn(String file, String search) throws IOException { if((file!=null)&&(file.contains("data file"))) search=commonPage.fetchDataFromDataProperties(search); adminLoginPage.searchColumn(search); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I search for (.*) in search box$") public void searchColumn(String file, String search) throws IOException { if((file!=null)&&(file.contains("data file"))) search=commonPage.fetchDataFromDataProperties(search); adminLoginPage.searchColumn(search); }
//step_function: public void searchColumn(String file, String search) throws IOException { if((file!=null)&&(file.contains("data file"))) search=commonPage.fetchDataFromDataProperties(search); adminLoginPage.searchColumn(search); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I search for (.*) in search box ### response: //step_function: public void searchColumn(String file, String search) throws IOException { if((file!=null)&&(file.contains("data file"))) search=commonPage.fetchDataFromDataProperties(search); adminLoginPage.searchColumn(search); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
adminLoginSteps.java
I click the (.*) customer on Customer grid
public void customerGrid(String value) { adminLoginPage.clickCustomerGrid(value); }
public void clickCustomerGrid(String value) { waitFor(search_entry); String actualColumnButton=String.format(parameterizedColumnButton, value); clickOn(getDriver().findElement(By.xpath(actualColumnButton))); }
@And("^I click the (.*) customer on Customer grid$") public void customerGrid(String value) { adminLoginPage.clickCustomerGrid(value); }
//step_function: public void customerGrid(String value) { adminLoginPage.clickCustomerGrid(value); } //page_function: public void clickCustomerGrid(String value) { waitFor(search_entry); String actualColumnButton=String.format(parameterizedColumnButton, value); clickOn(getDriver().findElement(By.xpath(actualColumnButton))); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click the (.*) customer on Customer grid ### response: //step_function: public void customerGrid(String value) { adminLoginPage.clickCustomerGrid(value); } //page_function: public void clickCustomerGrid(String value) { waitFor(search_entry); String actualColumnButton=String.format(parameterizedColumnButton, value); clickOn(getDriver().findElement(By.xpath(actualColumnButton))); }
adminLoginSteps.java
I select Flag customer application
public void flagCustomer() { adminLoginPage.clickFlagCustomer(); }
public void clickFlagCustomer() { waitFor(flagCustomerButton); clickOn(flagCustomerButton); }
@And("^I select Flag customer application$") public void flagCustomer() { adminLoginPage.clickFlagCustomer(); }
//step_function: public void flagCustomer() { adminLoginPage.clickFlagCustomer(); } //page_function: public void clickFlagCustomer() { waitFor(flagCustomerButton); clickOn(flagCustomerButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I select Flag customer application ### response: //step_function: public void flagCustomer() { adminLoginPage.clickFlagCustomer(); } //page_function: public void clickFlagCustomer() { waitFor(flagCustomerButton); clickOn(flagCustomerButton); }
adminLoginSteps.java
I edit Customer Name as (.*) and save
public void CustomerName(String name) { adminLoginPage.enterCustomerName(name); }
public void enterCustomerName(String name) { typeInto(name_txt, name); waitFor(5000); }
@And("^I edit Customer Name as (.*) and save$") public void CustomerName(String name) { adminLoginPage.enterCustomerName(name); }
//step_function: public void CustomerName(String name) { adminLoginPage.enterCustomerName(name); } //page_function: public void enterCustomerName(String name) { typeInto(name_txt, name); waitFor(5000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I edit Customer Name as (.*) and save ### response: //step_function: public void CustomerName(String name) { adminLoginPage.enterCustomerName(name); } //page_function: public void enterCustomerName(String name) { typeInto(name_txt, name); waitFor(5000); }
adminLoginSteps.java
After fetching data from data file )?I edit Address in Customer Profile
public void enterSecondScreenDetails(String file,DataTable dataTable) { List<List<String>> data = dataTable.raw(); adminLoginPage.enterCity(data.get(0).get(0)); adminLoginPage.enterAddress1(data.get(0).get(1)); adminLoginPage.enterAddress2(data.get(0).get(2)); }
public void enterCity(String city) { enter(city).into(city_txt); }
@Then("^(After fetching data from data file )?I edit Address in Customer Profile$") public void enterSecondScreenDetails(String file,DataTable dataTable) { List<List<String>> data = dataTable.raw(); adminLoginPage.enterCity(data.get(0).get(0)); adminLoginPage.enterAddress1(data.get(0).get(1)); adminLoginPage.enterAddress2(data.get(0).get(2)); }
//step_function: public void enterSecondScreenDetails(String file,DataTable dataTable) { List<List<String>> data = dataTable.raw(); adminLoginPage.enterCity(data.get(0).get(0)); adminLoginPage.enterAddress1(data.get(0).get(1)); adminLoginPage.enterAddress2(data.get(0).get(2)); } //page_function: public void enterCity(String city) { enter(city).into(city_txt); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I edit Address in Customer Profile ### response: //step_function: public void enterSecondScreenDetails(String file,DataTable dataTable) { List<List<String>> data = dataTable.raw(); adminLoginPage.enterCity(data.get(0).get(0)); adminLoginPage.enterAddress1(data.get(0).get(1)); adminLoginPage.enterAddress2(data.get(0).get(2)); } //page_function: public void enterCity(String city) { enter(city).into(city_txt); }
adminLoginSteps.java
I click on the Save button on Admin Page
public void clickSave() { adminLoginPage.clickSave(); }
public void clickSave() { waitFor(5000); waitFor(saveButton); clickOn(saveButton); }
@And("^I click on the Save button on Admin Page$") public void clickSave() { adminLoginPage.clickSave(); }
//step_function: public void clickSave() { adminLoginPage.clickSave(); } //page_function: public void clickSave() { waitFor(5000); waitFor(saveButton); clickOn(saveButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on the Save button on Admin Page ### response: //step_function: public void clickSave() { adminLoginPage.clickSave(); } //page_function: public void clickSave() { waitFor(5000); waitFor(saveButton); clickOn(saveButton); }
adminLoginSteps.java
I click on the Save button on Admin Page popup
public void clickSavePopup() { adminLoginPage.clickSavePopup(); }
public void clickSavePopup() { waitFor(savePopupButton); clickOn(savePopupButton); }
@And("^I click on the Save button on Admin Page popup$") public void clickSavePopup() { adminLoginPage.clickSavePopup(); }
//step_function: public void clickSavePopup() { adminLoginPage.clickSavePopup(); } //page_function: public void clickSavePopup() { waitFor(savePopupButton); clickOn(savePopupButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on the Save button on Admin Page popup ### response: //step_function: public void clickSavePopup() { adminLoginPage.clickSavePopup(); } //page_function: public void clickSavePopup() { waitFor(savePopupButton); clickOn(savePopupButton); }
adminLoginSteps.java
I click on the close button on Admin Page popup
public void clickClosePopup() { adminLoginPage.clickClosePopup(); }
public void clickClosePopup() { waitFor(closePopupButton); clickOn(closePopupButton); }
@And("^I click on the close button on Admin Page popup$") public void clickClosePopup() { adminLoginPage.clickClosePopup(); }
//step_function: public void clickClosePopup() { adminLoginPage.clickClosePopup(); } //page_function: public void clickClosePopup() { waitFor(closePopupButton); clickOn(closePopupButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click on the close button on Admin Page popup ### response: //step_function: public void clickClosePopup() { adminLoginPage.clickClosePopup(); } //page_function: public void clickClosePopup() { waitFor(closePopupButton); clickOn(closePopupButton); }
adminLoginSteps.java
I assign (.*) Project
public void Project(String projectName) { adminLoginPage.assignProject(projectName); }
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(); }
@And("^I assign (.*) Project$") public void Project(String projectName) { adminLoginPage.assignProject(projectName); }
//step_function: public void Project(String projectName) { adminLoginPage.assignProject(projectName); } //page_function: 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(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I assign (.*) Project ### response: //step_function: public void Project(String projectName) { adminLoginPage.assignProject(projectName); } //page_function: 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(); }
adminLoginSteps.java
I enter (.*) usage in Allocated Usage
public void allocatedUsage(String usage) { adminLoginPage.enterAllocatedUsage(usage); }
public void enterAllocatedUsage(String usage) { waitFor(allocatedUsage_txt); typeInto(allocatedUsage_txt, usage); }
@And("^I enter (.*) usage in Allocated Usage$") public void allocatedUsage(String usage) { adminLoginPage.enterAllocatedUsage(usage); }
//step_function: public void allocatedUsage(String usage) { adminLoginPage.enterAllocatedUsage(usage); } //page_function: public void enterAllocatedUsage(String usage) { waitFor(allocatedUsage_txt); typeInto(allocatedUsage_txt, usage); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter (.*) usage in Allocated Usage ### response: //step_function: public void allocatedUsage(String usage) { adminLoginPage.enterAllocatedUsage(usage); } //page_function: public void enterAllocatedUsage(String usage) { waitFor(allocatedUsage_txt); typeInto(allocatedUsage_txt, usage); }
adminLoginSteps.java
I enter (.*) utility account number
public void UtilityAccountNumber(String utilityAccountNumber) { adminLoginPage.enterUtilityAccountNumber(utilityAccountNumber); }
public void enterUtilityAccountNumber(String utilityAccountNumber) { waitFor(utilityAccountNumber_txt); typeInto(utilityAccountNumber_txt, utilityAccountNumber); }
@And("^I enter (.*) utility account number$") public void UtilityAccountNumber(String utilityAccountNumber) { adminLoginPage.enterUtilityAccountNumber(utilityAccountNumber); }
//step_function: public void UtilityAccountNumber(String utilityAccountNumber) { adminLoginPage.enterUtilityAccountNumber(utilityAccountNumber); } //page_function: public void enterUtilityAccountNumber(String utilityAccountNumber) { waitFor(utilityAccountNumber_txt); typeInto(utilityAccountNumber_txt, utilityAccountNumber); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter (.*) utility account number ### response: //step_function: public void UtilityAccountNumber(String utilityAccountNumber) { adminLoginPage.enterUtilityAccountNumber(utilityAccountNumber); } //page_function: public void enterUtilityAccountNumber(String utilityAccountNumber) { waitFor(utilityAccountNumber_txt); typeInto(utilityAccountNumber_txt, utilityAccountNumber); }
adminLoginSteps.java
I change Customer Status to (.*
public void changeStatus(String status) { adminLoginPage.changeCustomerStatus(status); }
public void changeCustomerStatus(String status) { waitFor(customerStatusDropdown); clickOn(customerStatusDropdown); String buttonXpath=String.format(parameterizedCustomerStatus, status); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.click(); }
@And("^I change Customer Status to (.*)$") public void changeStatus(String status) { adminLoginPage.changeCustomerStatus(status); }
//step_function: public void changeStatus(String status) { adminLoginPage.changeCustomerStatus(status); } //page_function: public void changeCustomerStatus(String status) { waitFor(customerStatusDropdown); clickOn(customerStatusDropdown); String buttonXpath=String.format(parameterizedCustomerStatus, status); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.click(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I change Customer Status to (.* ### response: //step_function: public void changeStatus(String status) { adminLoginPage.changeCustomerStatus(status); } //page_function: public void changeCustomerStatus(String status) { waitFor(customerStatusDropdown); clickOn(customerStatusDropdown); String buttonXpath=String.format(parameterizedCustomerStatus, status); WebElement elem=getDriver().findElement(By.xpath(buttonXpath)); WebDriverWait wait=new WebDriverWait(getDriver(),10); wait.until(ExpectedConditions.elementToBeClickable(elem)); elem.click(); }
adminLoginSteps.java
After fetching data from data file )?I upload (.*) Utility Usage Document
public void uploadUtilityDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadUtilityDocument(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I upload (.*) Utility Usage Document$") public void uploadUtilityDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadUtilityDocument(value); }
//step_function: public void uploadUtilityDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadUtilityDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I upload (.*) Utility Usage Document ### response: //step_function: public void uploadUtilityDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadUtilityDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
adminLoginSteps.java
After fetching data from data file )?I upload (.*) LMI Bill Document
public void uploadLMIDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadLMIDocument(value); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I upload (.*) LMI Bill Document$") public void uploadLMIDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadLMIDocument(value); } }
//step_function: public void uploadLMIDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadLMIDocument(value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I upload (.*) LMI Bill Document ### response: //step_function: public void uploadLMIDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); adminLoginPage.uploadLMIDocument(value); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
I prepare headers for (.*) API
public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^I prepare headers for (.*) API$") public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); }
//step_function: public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I prepare headers for (.*) API ### response: //step_function: public void prepareHeaders(String apiName) throws IOException { String target = null; if(apiName.contains("session")) target=commonPage.fetchDataFromDataProperties("sessionAPIAmzTarget"); else if(apiName.contains("authkey")) target=commonPage.fetchDataFromDataProperties("authkeyAPIAmzTarget"); headersMap.put("Content-Type","application/x-amz-json-1.1"); headersMap.put("x-amz-target",target); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
After fetching data from data file )?I prepare payload for email (.*) for (.*) API( with (.*) project)?
public String preparePayload(String file, String email, String apiName, String anyProject, String specificProject) throws IOException { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; default: if(anyProject!=null) { payload=String.format(projectParameterizedPayload, commonPage.fetchDataFromDataProperties(specificProject)); } } System.out.println("Session/Authkey/Consent/Income/Other API payload is: "+payload); return payload; }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Then("^(After fetching data from data file )?I prepare payload for email (.*) for (.*) API( with (.*) project)?$") public String preparePayload(String file, String email, String apiName, String anyProject, String specificProject) throws IOException { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; default: if(anyProject!=null) { payload=String.format(projectParameterizedPayload, commonPage.fetchDataFromDataProperties(specificProject)); } } System.out.println("Session/Authkey/Consent/Income/Other API payload is: "+payload); return payload; }
//step_function: public String preparePayload(String file, String email, String apiName, String anyProject, String specificProject) throws IOException { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; default: if(anyProject!=null) { payload=String.format(projectParameterizedPayload, commonPage.fetchDataFromDataProperties(specificProject)); } } System.out.println("Session/Authkey/Consent/Income/Other API payload is: "+payload); return payload; } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I prepare payload for email (.*) for (.*) API( with (.*) project)? ### response: //step_function: public String preparePayload(String file, String email, String apiName, String anyProject, String specificProject) throws IOException { if((file!=null) && (file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(email); } clientid=commonPage.fetchDataFromDataProperties("clientId"); switch(apiName) { case "session": payload=sessionAPIParameterizedPayload1+clientid+(String.format(sessionAPIParameterizedPayload2, email)); break; case "authkey": String payload1=String.format(authkeyAPIParameterizedPayload, email); String otpCode=CommonSteps.otp.toString(); String payload2="\"},\"ClientId\":\""; String payload3="\",\"Session\":\""; String payload4="\"}"; payload=payload1+otpCode+payload2+clientid+payload3+session+payload4; break; case "consent": payload=String.format(consentAPIParameterizedPayload, email); break; default: if(anyProject!=null) { payload=String.format(projectParameterizedPayload, commonPage.fetchDataFromDataProperties(specificProject)); } } System.out.println("Session/Authkey/Consent/Income/Other API payload is: "+payload); return payload; } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers
public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers$") public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); }
//step_function: public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I set request specification with the (.*) API for customer id (\\d+) with headers ### response: //step_function: public void add_API_Payload_with(String file, String apiURL, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006", customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
After fetching data from data file )?I set request specification with the (.*) API with headers and payload
public void add_API_Payload(String file, String apiURL) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I set request specification with the (.*) API with headers and payload$") public void add_API_Payload(String file, String apiURL) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); }
//step_function: public void add_API_Payload(String file, String apiURL) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I set request specification with the (.*) API with headers and payload ### response: //step_function: public void add_API_Payload(String file, String apiURL) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } // int index=apiURL.indexOf("1006"); // if(index>=0) // apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap).body(payload.getBytes()); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
After fetching data from data file )?I add API params with parameter (.*) as (.*
public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I add API params with parameter (.*) as (.*)$") public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); }
//step_function: public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I add API params with parameter (.*) as (.* ### response: //step_function: public void prepareParams(String file, String paramKey, String paramValue) throws IOException { if((file!=null) && (file.contains("data file"))) paramValue=commonPage.fetchDataFromDataProperties(paramValue); if(paramKey.equals("fromDate")) { LocalDate fromDate=LocalDate.now().minusMonths(1).withDayOfMonth(1); Date date=fromDate.toDate(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String fromdate= formatter.format(date); paramsMap.put(paramKey, fromdate); paramValue=fromdate; } else if(paramKey.equals("toDate")) { LocalDate toDate=LocalDate.now().withDayOfMonth(1).minusDays(1); Date date=toDate.toDate(); SimpleDateFormat df=new SimpleDateFormat("YYYY"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String todate= formatter.format(date); paramsMap.put(paramKey, todate); paramValue=todate; } else paramsMap.put(paramKey, paramValue); System.out.println("Param "+paramKey+" picked as "+paramValue); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
I prepare API headers( and pass authkey)?
public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^I prepare API headers( and pass authkey)?$") public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); }
//step_function: public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I prepare API headers( and pass authkey)? ### response: //step_function: public void prepareHeadersForAPIsAfterLogin(String passAuthkey) throws IOException { headersMap=new HashMap<String,String>(); if((passAuthkey!=null)&&(passAuthkey.contains("auth"))) headersMap.put("Authorization",authKey); headersMap.put("x-api-key",commonPage.fetchDataFromDataProperties("x-api-key")); headersMap.put("Accept", "application/json, text/plain, */*"); headersMap.put("Accept-Encoding","gzip, deflate, br"); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
APISteps.java
After fetching data from data file )?I set request specification with the (.*) API and (.*) for customer id (\\d+) with headers
public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("^(After fetching data from data file )?I set request specification with the (.*) API and (.*) for customer id (\\d+) with headers$") public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } }
//step_function: public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I set request specification with the (.*) API and (.*) for customer id (\\d+) with headers ### response: //step_function: public void add_API_Header(String file, String apiURL, String extension, String customerId) throws IOException { if((file!=null) && (file.contains("data file"))) { apiURL=apiURL+"APIURL"; apiURL=commonPage.fetchDataFromDataProperties(apiURL); } //apiURL=apiURL+"/"+commonPage.fetchDataFromDataProperties(extension); apiURL=apiURL+"/"+docId; int index=apiURL.indexOf("1006"); if(index>=0) apiURL=apiURL.replace("1006",customerId); RestAssured.baseURI=apiURL; RestAssured.useRelaxedHTTPSValidation(); httpRequest = RestAssured.given().headers(headersMap); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
BenefitScreenSteps.java
I agree to opt for the solar power in Benefit Onboarding screen
public void clickGetStarted() { benefitScreenPage.clickYesIAmInButton(); } }
public void clickYesIAmInButton() { waitFor(yesIAmInButton); clickOn(yesIAmInButton); waitABit(5000); }
@When("^I agree to opt for the solar power in Benefit Onboarding screen$") public void clickGetStarted() { benefitScreenPage.clickYesIAmInButton(); } }
//step_function: public void clickGetStarted() { benefitScreenPage.clickYesIAmInButton(); } } //page_function: public void clickYesIAmInButton() { waitFor(yesIAmInButton); clickOn(yesIAmInButton); waitABit(5000); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I agree to opt for the solar power in Benefit Onboarding screen ### response: //step_function: public void clickGetStarted() { benefitScreenPage.clickYesIAmInButton(); } } //page_function: public void clickYesIAmInButton() { waitFor(yesIAmInButton); clickOn(yesIAmInButton); waitABit(5000); }
CheckAvailabilityScreenSteps.java
After fetching data from data file )?I check availability in zip code (.*
public void enterZipcode(String file,String zipcode) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) zipcode=commonPage.fetchDataFromDataProperties(zipcode); checkAvailabilityScreenPage.enterZipcode(zipcode); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@And("^(After fetching data from data file )?I check availability in zip code (.*)$") public void enterZipcode(String file,String zipcode) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) zipcode=commonPage.fetchDataFromDataProperties(zipcode); checkAvailabilityScreenPage.enterZipcode(zipcode); }
//step_function: public void enterZipcode(String file,String zipcode) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) zipcode=commonPage.fetchDataFromDataProperties(zipcode); checkAvailabilityScreenPage.enterZipcode(zipcode); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I check availability in zip code (.* ### response: //step_function: public void enterZipcode(String file,String zipcode) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) zipcode=commonPage.fetchDataFromDataProperties(zipcode); checkAvailabilityScreenPage.enterZipcode(zipcode); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
CheckAvailabilityScreenSteps.java
After fetching data from data file )?I choose (.*) from Utility provider dropdown
public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); checkAvailabilityScreenPage.selectUtilityProvider(utilityProvider); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@And("^(After fetching data from data file )?I choose (.*) from Utility provider dropdown$") public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); checkAvailabilityScreenPage.selectUtilityProvider(utilityProvider); }
//step_function: public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); checkAvailabilityScreenPage.selectUtilityProvider(utilityProvider); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I choose (.*) from Utility provider dropdown ### response: //step_function: public void selectUtilityProvider(String file,String utilityProvider) throws FileNotFoundException, IOException { if((file!=null) && (file.contains("data file"))) utilityProvider=commonPage.fetchDataFromDataProperties(utilityProvider); checkAvailabilityScreenPage.selectUtilityProvider(utilityProvider); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
CheckAvailabilityScreenSteps.java
Utility provider dropdown does not appear
public void validateUltilityProviderNotPresent() { checkAvailabilityScreenPage.validateUltilityProviderNotPresent(); }
public void validateUltilityProviderNotPresent() { utilityProviderDropdown.shouldNotBeCurrentlyVisible(); }
@Then("^Utility provider dropdown does not appear$") public void validateUltilityProviderNotPresent() { checkAvailabilityScreenPage.validateUltilityProviderNotPresent(); }
//step_function: public void validateUltilityProviderNotPresent() { checkAvailabilityScreenPage.validateUltilityProviderNotPresent(); } //page_function: public void validateUltilityProviderNotPresent() { utilityProviderDropdown.shouldNotBeCurrentlyVisible(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: Utility provider dropdown does not appear ### response: //step_function: public void validateUltilityProviderNotPresent() { checkAvailabilityScreenPage.validateUltilityProviderNotPresent(); } //page_function: public void validateUltilityProviderNotPresent() { utilityProviderDropdown.shouldNotBeCurrentlyVisible(); }
CheckAvailabilityScreenSteps.java
I wait for Utility provider dropdown
public void waitForUtilityProviderDropdown() { checkAvailabilityScreenPage.waitForUtilityProviderDropdown(); } }
public void waitForUtilityProviderDropdown() { utilityProviderDropdown.waitUntilVisible(); }
@And("^I wait for Utility provider dropdown$") public void waitForUtilityProviderDropdown() { checkAvailabilityScreenPage.waitForUtilityProviderDropdown(); } }
//step_function: public void waitForUtilityProviderDropdown() { checkAvailabilityScreenPage.waitForUtilityProviderDropdown(); } } //page_function: public void waitForUtilityProviderDropdown() { utilityProviderDropdown.waitUntilVisible(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I wait for Utility provider dropdown ### response: //step_function: public void waitForUtilityProviderDropdown() { checkAvailabilityScreenPage.waitForUtilityProviderDropdown(); } } //page_function: public void waitForUtilityProviderDropdown() { utilityProviderDropdown.waitUntilVisible(); }
ExpandingFarmsScreenSteps.java
I see static (text|subtext) (.*) in Onboarding screen
public void validateStaticText(String textOrSubtext, String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); expandingFarmsScreenPage.validateStaticText(textOrSubtext,expectedStaticText); }
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"); }
@Then("^I see static (text|subtext) (.*) in Onboarding screen$") public void validateStaticText(String textOrSubtext, String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); expandingFarmsScreenPage.validateStaticText(textOrSubtext,expectedStaticText); }
//step_function: public void validateStaticText(String textOrSubtext, String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); expandingFarmsScreenPage.validateStaticText(textOrSubtext,expectedStaticText); } //page_function: 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"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I see static (text|subtext) (.*) in Onboarding screen ### response: //step_function: public void validateStaticText(String textOrSubtext, String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); expandingFarmsScreenPage.validateStaticText(textOrSubtext,expectedStaticText); } //page_function: 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"); }
ExpandingFarmsScreenSteps.java
After fetching data from data file )?I enter all the details for registering in Onboarding
public void enterRegistrationDetailsForOnboarding(String file, DataTable dataTable) throws Throwable { String email,mobNum; List<String> data = dataTable.asList(String.class); if((file!=null)&&(file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(data.get(2));; mobNum=commonPage.fetchDataFromDataProperties(data.get(3));; } else { email=data.get(2); mobNum=data.get(3); } expandingFarmsScreenPage.enterFirstName(data.get(0)); expandingFarmsScreenPage.enterLastName(data.get(1)); expandingFarmsScreenPage.enterEmail(email); expandingFarmsScreenPage.enterMobileNumber(mobNum); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I enter all the details for registering in Onboarding$") public void enterRegistrationDetailsForOnboarding(String file, DataTable dataTable) throws Throwable { String email,mobNum; List<String> data = dataTable.asList(String.class); if((file!=null)&&(file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(data.get(2));; mobNum=commonPage.fetchDataFromDataProperties(data.get(3));; } else { email=data.get(2); mobNum=data.get(3); } expandingFarmsScreenPage.enterFirstName(data.get(0)); expandingFarmsScreenPage.enterLastName(data.get(1)); expandingFarmsScreenPage.enterEmail(email); expandingFarmsScreenPage.enterMobileNumber(mobNum); }
//step_function: public void enterRegistrationDetailsForOnboarding(String file, DataTable dataTable) throws Throwable { String email,mobNum; List<String> data = dataTable.asList(String.class); if((file!=null)&&(file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(data.get(2));; mobNum=commonPage.fetchDataFromDataProperties(data.get(3));; } else { email=data.get(2); mobNum=data.get(3); } expandingFarmsScreenPage.enterFirstName(data.get(0)); expandingFarmsScreenPage.enterLastName(data.get(1)); expandingFarmsScreenPage.enterEmail(email); expandingFarmsScreenPage.enterMobileNumber(mobNum); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter all the details for registering in Onboarding ### response: //step_function: public void enterRegistrationDetailsForOnboarding(String file, DataTable dataTable) throws Throwable { String email,mobNum; List<String> data = dataTable.asList(String.class); if((file!=null)&&(file.contains("data file"))) { email=commonPage.fetchDataFromDataProperties(data.get(2));; mobNum=commonPage.fetchDataFromDataProperties(data.get(3));; } else { email=data.get(2); mobNum=data.get(3); } expandingFarmsScreenPage.enterFirstName(data.get(0)); expandingFarmsScreenPage.enterLastName(data.get(1)); expandingFarmsScreenPage.enterEmail(email); expandingFarmsScreenPage.enterMobileNumber(mobNum); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
ExpandingFarmsScreenSteps.java
I (dont )?see textfield Referral code in Onboarding screen
public void validateTextfieldReferralCode(String dontFlag) throws Exception { expandingFarmsScreenPage.validateTextfieldReferralCode(dontFlag); }
public void validateTextfieldReferralCode(String dontFlag) { if(dontFlag==null) referralCodeTextfield.shouldBePresent(); else if(dontFlag.contains("dont")) referralCodeTextfield.shouldNotBePresent(); }
@And("^I (dont )?see textfield Referral code in Onboarding screen$") public void validateTextfieldReferralCode(String dontFlag) throws Exception { expandingFarmsScreenPage.validateTextfieldReferralCode(dontFlag); }
//step_function: public void validateTextfieldReferralCode(String dontFlag) throws Exception { expandingFarmsScreenPage.validateTextfieldReferralCode(dontFlag); } //page_function: public void validateTextfieldReferralCode(String dontFlag) { if(dontFlag==null) referralCodeTextfield.shouldBePresent(); else if(dontFlag.contains("dont")) referralCodeTextfield.shouldNotBePresent(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I (dont )?see textfield Referral code in Onboarding screen ### response: //step_function: public void validateTextfieldReferralCode(String dontFlag) throws Exception { expandingFarmsScreenPage.validateTextfieldReferralCode(dontFlag); } //page_function: public void validateTextfieldReferralCode(String dontFlag) { if(dontFlag==null) referralCodeTextfield.shouldBePresent(); else if(dontFlag.contains("dont")) referralCodeTextfield.shouldNotBePresent(); }
ExpandingFarmsScreenSteps.java
After fetching data from data file )?I enter (.*) in Referral code textfield in Onboarding screen
public void enterValueInReferralCode(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); expandingFarmsScreenPage.enterReferralCode(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@And("^(After fetching data from data file )?I enter (.*) in Referral code textfield in Onboarding screen$") public void enterValueInReferralCode(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); expandingFarmsScreenPage.enterReferralCode(value); }
//step_function: public void enterValueInReferralCode(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); expandingFarmsScreenPage.enterReferralCode(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter (.*) in Referral code textfield in Onboarding screen ### response: //step_function: public void enterValueInReferralCode(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); expandingFarmsScreenPage.enterReferralCode(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
ExpandingFarmsScreenSteps.java
I get error message (.*) for referral code textfield
public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); expandingFarmsScreenPage.validateErrorMessage(expectedError); }
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"); }
@Then("^I get error message (.*) for referral code textfield$") public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); expandingFarmsScreenPage.validateErrorMessage(expectedError); }
//step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); expandingFarmsScreenPage.validateErrorMessage(expectedError); } //page_function: 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"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I get error message (.*) for referral code textfield ### response: //step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); expandingFarmsScreenPage.validateErrorMessage(expectedError); } //page_function: 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"); }
ExpandingFarmsScreenSteps.java
After fetching data from data file )?I see textfield Referral code prepopulated with (.*) in Onboarding screen
public void isReferralCodePrepopulatedWith(String file, String referralCode) throws Exception { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); expandingFarmsScreenPage.isReferralCodePrepopulatedWith(referralCode); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@And("^(After fetching data from data file )?I see textfield Referral code prepopulated with (.*) in Onboarding screen$") public void isReferralCodePrepopulatedWith(String file, String referralCode) throws Exception { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); expandingFarmsScreenPage.isReferralCodePrepopulatedWith(referralCode); }
//step_function: public void isReferralCodePrepopulatedWith(String file, String referralCode) throws Exception { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); expandingFarmsScreenPage.isReferralCodePrepopulatedWith(referralCode); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I see textfield Referral code prepopulated with (.*) in Onboarding screen ### response: //step_function: public void isReferralCodePrepopulatedWith(String file, String referralCode) throws Exception { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); expandingFarmsScreenPage.isReferralCodePrepopulatedWith(referralCode); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
ExpandingFarmsScreenSteps.java
I enter in Referral code textfield \([\]*)\ in Onboarding screen
public void enterSpecialCharInReferralCode(String value) throws Throwable { expandingFarmsScreenPage.enterSpecialCharInReferralCode(value); } }
public void enterSpecialCharInReferralCode(String value) { typeInto(referralCodeTextfield,value); }
@And("^I enter in Referral code textfield \"([^\"]*)\" in Onboarding screen$") public void enterSpecialCharInReferralCode(String value) throws Throwable { expandingFarmsScreenPage.enterSpecialCharInReferralCode(value); } }
//step_function: public void enterSpecialCharInReferralCode(String value) throws Throwable { expandingFarmsScreenPage.enterSpecialCharInReferralCode(value); } } //page_function: public void enterSpecialCharInReferralCode(String value) { typeInto(referralCodeTextfield,value); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter in Referral code textfield \([\]*)\ in Onboarding screen ### response: //step_function: public void enterSpecialCharInReferralCode(String value) throws Throwable { expandingFarmsScreenPage.enterSpecialCharInReferralCode(value); } } //page_function: public void enterSpecialCharInReferralCode(String value) { typeInto(referralCodeTextfield,value); }
LmiScreenSteps.java
After fetching data from data file )?I upload (.*) document for LMI document
public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); lmiScreenPage.uploadLmiDocument(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I upload (.*) document for LMI document$") public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); lmiScreenPage.uploadLmiDocument(value); }
//step_function: public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); lmiScreenPage.uploadLmiDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I upload (.*) document for LMI document ### response: //step_function: public void uploadLmiDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); lmiScreenPage.uploadLmiDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
LmiScreenSteps.java
I wait for message that Your Document is Uploaded
public void verifyDocumentIsUploaded() { lmiScreenPage.verifyDocumentIsUploaded(); } }
public void verifyDocumentIsUploaded() { waitFor(documentUploadedMsg); }
@Then("^I wait for message that Your Document is Uploaded$") public void verifyDocumentIsUploaded() { lmiScreenPage.verifyDocumentIsUploaded(); } }
//step_function: public void verifyDocumentIsUploaded() { lmiScreenPage.verifyDocumentIsUploaded(); } } //page_function: public void verifyDocumentIsUploaded() { waitFor(documentUploadedMsg); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I wait for message that Your Document is Uploaded ### response: //step_function: public void verifyDocumentIsUploaded() { lmiScreenPage.verifyDocumentIsUploaded(); } } //page_function: public void verifyDocumentIsUploaded() { waitFor(documentUploadedMsg); }
OnboardingFirstScreenSteps.java
I choose Join Community Solar
public void chooseGoGreen() { onboardingFirstScreenPage.goGreen(); }
public void goGreen() { waitFor(goGreenButton); clickOn(goGreenButton); }
@When("^I choose Join Community Solar$") public void chooseGoGreen() { onboardingFirstScreenPage.goGreen(); }
//step_function: public void chooseGoGreen() { onboardingFirstScreenPage.goGreen(); } //page_function: public void goGreen() { waitFor(goGreenButton); clickOn(goGreenButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I choose Join Community Solar ### response: //step_function: public void chooseGoGreen() { onboardingFirstScreenPage.goGreen(); } //page_function: public void goGreen() { waitFor(goGreenButton); clickOn(goGreenButton); }
OnboardingFirstScreenSteps.java
After fetching data from data file )?I am on Onboarding screen with (.*) referral code
public void onOnboardingScreenWithReferralCode(String file, String referralCode) throws Throwable { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); onboardingFirstScreenPage.openReferralLink(referralCode); } }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@Given("(After fetching data from data file )?I am on Onboarding screen with (.*) referral code$") public void onOnboardingScreenWithReferralCode(String file, String referralCode) throws Throwable { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); onboardingFirstScreenPage.openReferralLink(referralCode); } }
//step_function: public void onOnboardingScreenWithReferralCode(String file, String referralCode) throws Throwable { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); onboardingFirstScreenPage.openReferralLink(referralCode); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I am on Onboarding screen with (.*) referral code ### response: //step_function: public void onOnboardingScreenWithReferralCode(String file, String referralCode) throws Throwable { if((file!=null)&&(file.contains("data file"))) referralCode=commonPage.fetchDataFromDataProperties(referralCode); onboardingFirstScreenPage.openReferralLink(referralCode); } } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
OnboardingLastScreenSteps.java
I navigate to (.*) Onboarding screen
// public void validateHeadingThankYouForYourPatience(String heading) { // onboardingLastScreenPage.validateHeading(heading); // } }
public void validateHeading(String headingText) { // WebElementFacade welem=(WebElementFacade) getDriver().findElement(By.xpath(String.format(heading, headingText))); // waitFor(welem); // }
@Then("^I navigate to (.*) Onboarding screen$") // public void validateHeadingThankYouForYourPatience(String heading) { // onboardingLastScreenPage.validateHeading(heading); // } }
//step_function: // public void validateHeadingThankYouForYourPatience(String heading) { // onboardingLastScreenPage.validateHeading(heading); // } } //page_function: public void validateHeading(String headingText) { // WebElementFacade welem=(WebElementFacade) getDriver().findElement(By.xpath(String.format(heading, headingText))); // waitFor(welem); // }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I navigate to (.*) Onboarding screen ### response: //step_function: // public void validateHeadingThankYouForYourPatience(String heading) { // onboardingLastScreenPage.validateHeading(heading); // } } //page_function: public void validateHeading(String headingText) { // WebElementFacade welem=(WebElementFacade) getDriver().findElement(By.xpath(String.format(heading, headingText))); // waitFor(welem); // }
PaymentScreenSteps.java
I agree and click on Subscriber Agreement button on Payment screen
public void clickSubsciberAgreement() { paymentScreenPage.clickSubsciberAgreementButton(); }
public void clickSubsciberAgreementButton() { waitFor(subscriberAgreementButton); clickOn(subscriberAgreementButton); }
@And("^I agree and click on Subscriber Agreement button on Payment screen$") public void clickSubsciberAgreement() { paymentScreenPage.clickSubsciberAgreementButton(); }
//step_function: public void clickSubsciberAgreement() { paymentScreenPage.clickSubsciberAgreementButton(); } //page_function: public void clickSubsciberAgreementButton() { waitFor(subscriberAgreementButton); clickOn(subscriberAgreementButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I agree and click on Subscriber Agreement button on Payment screen ### response: //step_function: public void clickSubsciberAgreement() { paymentScreenPage.clickSubsciberAgreementButton(); } //page_function: public void clickSubsciberAgreementButton() { waitFor(subscriberAgreementButton); clickOn(subscriberAgreementButton); }
PaymentScreenSteps.java
I accept Hawaii Disclosure
public void acceptDisclosure() { paymentScreenPage.acceptHawaiiDisclosure(); } }
public void acceptHawaiiDisclosure() { waitFor(acceptHawaiiDisclosureButton); JavascriptExecutor js = (JavascriptExecutor) getDriver(); // getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='__PrivateStripeElement']//iframe[1]"))); // JavascriptExecutor js = (JavascriptExecutor) getDriver(); waitFor(5000); js.executeScript("window.scrollBy(0,550)", ""); clickOn(acceptHawaiiDisclosureButton); getDriver().switchTo().defaultContent(); }
@And("^I accept Hawaii Disclosure$") public void acceptDisclosure() { paymentScreenPage.acceptHawaiiDisclosure(); } }
//step_function: public void acceptDisclosure() { paymentScreenPage.acceptHawaiiDisclosure(); } } //page_function: public void acceptHawaiiDisclosure() { waitFor(acceptHawaiiDisclosureButton); JavascriptExecutor js = (JavascriptExecutor) getDriver(); // getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='__PrivateStripeElement']//iframe[1]"))); // JavascriptExecutor js = (JavascriptExecutor) getDriver(); waitFor(5000); js.executeScript("window.scrollBy(0,550)", ""); clickOn(acceptHawaiiDisclosureButton); getDriver().switchTo().defaultContent(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I accept Hawaii Disclosure ### response: //step_function: public void acceptDisclosure() { paymentScreenPage.acceptHawaiiDisclosure(); } } //page_function: public void acceptHawaiiDisclosure() { waitFor(acceptHawaiiDisclosureButton); JavascriptExecutor js = (JavascriptExecutor) getDriver(); // getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='__PrivateStripeElement']//iframe[1]"))); // JavascriptExecutor js = (JavascriptExecutor) getDriver(); waitFor(5000); js.executeScript("window.scrollBy(0,550)", ""); clickOn(acceptHawaiiDisclosureButton); getDriver().switchTo().defaultContent(); }
StripePaymentScreenSteps.java
I enter (card|US bank account) details for utility savings
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)); } }
public void enterCardDetails(String cardNumberValue, String expiryValue, String cvcValue, String dobValue) { getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='__PrivateStripeElement']//iframe[1]"))); waitFor(cardNumberTextField); typeInto(cardNumberTextField, cardNumberValue); typeInto(expiryTextField, expiryValue); typeInto(cvcTextField, cvcValue); getDriver().switchTo().defaultContent(); typeInto(dobTextField, dobValue); }
@When("^I enter (card|US bank account) details for utility savings$") 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)); } }
//step_function: 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)); } } //page_function: public void enterCardDetails(String cardNumberValue, String expiryValue, String cvcValue, String dobValue) { getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='__PrivateStripeElement']//iframe[1]"))); waitFor(cardNumberTextField); typeInto(cardNumberTextField, cardNumberValue); typeInto(expiryTextField, expiryValue); typeInto(cvcTextField, cvcValue); getDriver().switchTo().defaultContent(); typeInto(dobTextField, dobValue); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter (card|US bank account) details for utility savings ### response: //step_function: 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)); } } //page_function: public void enterCardDetails(String cardNumberValue, String expiryValue, String cvcValue, String dobValue) { getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='__PrivateStripeElement']//iframe[1]"))); waitFor(cardNumberTextField); typeInto(cardNumberTextField, cardNumberValue); typeInto(expiryTextField, expiryValue); typeInto(cvcTextField, cvcValue); getDriver().switchTo().defaultContent(); typeInto(dobTextField, dobValue); }
UtilityScreenSteps.java
After fetching data from data file )?I upload (.*) bill document
public void uploadBillDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); utilityScreenPage.uploadDocument(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I upload (.*) bill document$") public void uploadBillDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); utilityScreenPage.uploadDocument(value); }
//step_function: public void uploadBillDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); utilityScreenPage.uploadDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I upload (.*) bill document ### response: //step_function: public void uploadBillDocument(String file, String value) throws AWTException, IOException { if ((file != null) && (file.contains("data file"))) value = commonPage.fetchDataFromDataProperties(value); utilityScreenPage.uploadDocument(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
UtilityScreenSteps.java
I wait for message that Your Bill is Uploaded
public void verifyBillIsUploaded() { utilityScreenPage.verifyBillIsUploaded(); }
public void verifyBillIsUploaded() { waitFor(billUploadedMsg); }
@Then("^I wait for message that Your Bill is Uploaded$") public void verifyBillIsUploaded() { utilityScreenPage.verifyBillIsUploaded(); }
//step_function: public void verifyBillIsUploaded() { utilityScreenPage.verifyBillIsUploaded(); } //page_function: public void verifyBillIsUploaded() { waitFor(billUploadedMsg); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I wait for message that Your Bill is Uploaded ### response: //step_function: public void verifyBillIsUploaded() { utilityScreenPage.verifyBillIsUploaded(); } //page_function: public void verifyBillIsUploaded() { waitFor(billUploadedMsg); }
UtilityScreenSteps.java
I provide the Utility Details
public void provide_UtilityDetails() { utilityScreenPage.provideUtilityDetails(); } }
public void provideUtilityDetails() { waitABit(5000); clickOn(signinButton); getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='MuiDialogContent-root']//iframe"))); waitABit(5000); // typeInto(customerEmailTextfield,"incedo1@yopmail.com"); typeInto(uesrNameTextfield,"UAPI_TEST_residential"); typeInto(passwordTextfield,"TEST"); typeInto(digitalSignatureTextfield,"Siddharth"); waitABit(5000); waitFor(authorizeButton); clickOn(authorizeButton); waitABit(35000); getDriver().switchTo().defaultContent(); waitFor(iDontQualifyButton); }
@And("^I provide the Utility Details$") public void provide_UtilityDetails() { utilityScreenPage.provideUtilityDetails(); } }
//step_function: public void provide_UtilityDetails() { utilityScreenPage.provideUtilityDetails(); } } //page_function: public void provideUtilityDetails() { waitABit(5000); clickOn(signinButton); getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='MuiDialogContent-root']//iframe"))); waitABit(5000); // typeInto(customerEmailTextfield,"incedo1@yopmail.com"); typeInto(uesrNameTextfield,"UAPI_TEST_residential"); typeInto(passwordTextfield,"TEST"); typeInto(digitalSignatureTextfield,"Siddharth"); waitABit(5000); waitFor(authorizeButton); clickOn(authorizeButton); waitABit(35000); getDriver().switchTo().defaultContent(); waitFor(iDontQualifyButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I provide the Utility Details ### response: //step_function: public void provide_UtilityDetails() { utilityScreenPage.provideUtilityDetails(); } } //page_function: public void provideUtilityDetails() { waitABit(5000); clickOn(signinButton); getDriver().switchTo().frame(getDriver().findElement(By.xpath("//div[@class='MuiDialogContent-root']//iframe"))); waitABit(5000); // typeInto(customerEmailTextfield,"incedo1@yopmail.com"); typeInto(uesrNameTextfield,"UAPI_TEST_residential"); typeInto(passwordTextfield,"TEST"); typeInto(digitalSignatureTextfield,"Siddharth"); waitABit(5000); waitFor(authorizeButton); clickOn(authorizeButton); waitABit(35000); getDriver().switchTo().defaultContent(); waitFor(iDontQualifyButton); }
DashboardScreenSteps.java
I should be successful in creating a new account (.*
public void isSuccessfullySignedUp(String userName){ assert dashboardPage.isUserLoggedByName(userName); }
public boolean isUserLoggedByName(String expectedName){ return (hiUserName_lbl.getText()).contains(expectedName)?true:false; }
@Then("^I should be successful in creating a new account (.*)$") public void isSuccessfullySignedUp(String userName){ assert dashboardPage.isUserLoggedByName(userName); }
//step_function: public void isSuccessfullySignedUp(String userName){ assert dashboardPage.isUserLoggedByName(userName); } //page_function: public boolean isUserLoggedByName(String expectedName){ return (hiUserName_lbl.getText()).contains(expectedName)?true:false; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I should be successful in creating a new account (.* ### response: //step_function: public void isSuccessfullySignedUp(String userName){ assert dashboardPage.isUserLoggedByName(userName); } //page_function: public boolean isUserLoggedByName(String expectedName){ return (hiUserName_lbl.getText()).contains(expectedName)?true:false; }
DashboardScreenSteps.java
I should successfully land to dashboard
public void landDashboard(){ dashboardPage.landDashboard(); } }
public void landDashboard() { welcomeDashboard.shouldBeVisible(); }
@Then("^I should successfully land to dashboard$") public void landDashboard(){ dashboardPage.landDashboard(); } }
//step_function: public void landDashboard(){ dashboardPage.landDashboard(); } } //page_function: public void landDashboard() { welcomeDashboard.shouldBeVisible(); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I should successfully land to dashboard ### response: //step_function: public void landDashboard(){ dashboardPage.landDashboard(); } } //page_function: public void landDashboard() { welcomeDashboard.shouldBeVisible(); }
FetchLoginOTPviaEmailSteps.java
I enter the correct Email OTP in Login screen
public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } }
public String openNewTabAndSwitch() throws InterruptedException { WebDriver driver = getDriver(); //Keys.chord(Keys.CONTROL,"T"); enter(Keys.CONTROL+"t").into(enterEmail_txt); wait(5000); String newTabID = (String)(driver.getWindowHandles().stream().toArray())[1]; driver.switchTo().window(newTabID); return newTabID; }
@And("^I enter the correct Email OTP in Login screen$") public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } }
//step_function: public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } } //page_function: public String openNewTabAndSwitch() throws InterruptedException { WebDriver driver = getDriver(); //Keys.chord(Keys.CONTROL,"T"); enter(Keys.CONTROL+"t").into(enterEmail_txt); wait(5000); String newTabID = (String)(driver.getWindowHandles().stream().toArray())[1]; driver.switchTo().window(newTabID); return newTabID; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I enter the correct Email OTP in Login screen ### response: //step_function: public void fetchEmailOTPAndEnter() throws InterruptedException { String newID = loginSecondPageScreen_emailOTP.openNewTabAndSwitch(); //loginSecondPageScreen_emailOTP.enterEmail(); } } //page_function: public String openNewTabAndSwitch() throws InterruptedException { WebDriver driver = getDriver(); //Keys.chord(Keys.CONTROL,"T"); enter(Keys.CONTROL+"t").into(enterEmail_txt); wait(5000); String newTabID = (String)(driver.getWindowHandles().stream().toArray())[1]; driver.switchTo().window(newTabID); return newTabID; }
LoginFirstScreenSteps.java
After fetching data from data file )?I enter value (.*) in email or mobile textfield
public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I enter value (.*) in email or mobile textfield$") public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); }
//step_function: public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I enter value (.*) in email or mobile textfield ### response: //step_function: public void enterEmailOrMobile(String file, String value) throws Throwable { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.enterLoginEmailOrMobile(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
LoginFirstScreenSteps.java
I click Send me a Code button
public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); }
public void clickLoginSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); }
@And("^I click Send me a Code button$") public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); }
//step_function: public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); } //page_function: public void clickLoginSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I click Send me a Code button ### response: //step_function: public void sendMeACode() { loginFirstScreenPage.clickLoginSendMeACode(); } //page_function: public void clickLoginSendMeACode() { waitFor(sendMeACodeButton); clickOn(sendMeACodeButton); }
LoginFirstScreenSteps.java
I get error message (.*) for email or mobile textfield
public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); }
public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=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"); }
@Then("^I get error message (.*) for email or mobile textfield$") public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); }
//step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=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"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I get error message (.*) for email or mobile textfield ### response: //step_function: public void validateErrorForEmailOrMobileTextfield(String expectedError) throws Exception { expectedError=commonPage.fetchErrorMessageConstantsfromEnum(expectedError); loginFirstScreenPage.validateErrorMessage(expectedError); } //page_function: public String fetchErrorMessageConstantsfromEnum(String expectedError) throws Exception { switch(expectedError) { case "INVALID_MOBILE_ERROR": expectedError=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"); }
LoginFirstScreenSteps.java
After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield
public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); }
public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
@When("^(After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield$") public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); }
//step_function: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: After fetching data from data file )?I see prepopulated value (.*) in email or mobile textfield ### response: //step_function: public void validatePrepopulatedEmailOrMobileTextfield(String file, String value) throws FileNotFoundException, IOException { if((file!=null)&&(file.contains("data file"))) value=commonPage.fetchDataFromDataProperties(value); loginFirstScreenPage.validatePrepopulatedEmailOrMobileTextfield(value); } //page_function: public String fetchDataFromDataProperties(String key) throws FileNotFoundException, IOException { properties=new Properties(); properties.load(new FileInputStream(new File(".\\data.properties"))); String value=properties.getProperty(key); return value; }
LoginFirstScreenSteps.java
I (dont )?see default text (.*) in email or mobile textfield
public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); }
public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { Assert.assertEquals("true",emailOrMobileTextFieldLabel.getAttribute("data-shrink")); }
@When("^I (dont )?see default text (.*) in email or mobile textfield$") public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); }
//step_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); } //page_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { Assert.assertEquals("true",emailOrMobileTextFieldLabel.getAttribute("data-shrink")); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I (dont )?see default text (.*) in email or mobile textfield ### response: //step_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { loginFirstScreenPage.validateDefaultTextEmailOrMobileTextfield(dontFlag,value); } //page_function: public void validateDefaultTextEmailOrMobileTextfield(String dontFlag, String value) { if((dontFlag!=null)&&(dontFlag.contains("dont"))) { Assert.assertEquals("true",emailOrMobileTextFieldLabel.getAttribute("data-shrink")); }
LoginFirstScreenSteps.java
I see static text (.*) in Login screen
public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); }
public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_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"); }
@Then("^I see static text (.*) in Login screen$") public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); }
//step_function: public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); } //page_function: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_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"); }
As a Quality Assurance Manager, write step definition and page definition code using Java with Cucumber framework for the below given instruction. ### instruction: I see static text (.*) in Login screen ### response: //step_function: public void validateStaticText(String expectedStaticText) throws Exception { expectedStaticText=commonPage.fetchStaticTextConstantsfromEnum(expectedStaticText); loginFirstScreenPage.validateStaticText(expectedStaticText); } //page_function: public String fetchStaticTextConstantsfromEnum(String expectedStaticText) throws Exception { switch(expectedStaticText) { case "LOGIN_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"); }

Dataset Card for "java_cucumber_code_train"

More Information needed

Downloads last month
0
Edit dataset card