Skip to content

Commit

Permalink
Merge pull request #335 from CBIIT/Nesarh2
Browse files Browse the repository at this point in the history
eGrants - Add & Remove & Delete label for supplement grant year
  • Loading branch information
Mariachaudhry authored Dec 2, 2024
2 parents 1931567 + 2dafa51 commit a746833
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,40 @@ Given User is logged in the application and is on the landing page
And uploads a file
Then verifies the success message "Done! New document has been created"

@MoveSupplementApplication @nesarh2 @selenium @Regression
@MoveSupplementApplication @nesarh2 @selenium @In-Progress
Scenario: Test moving a supplement application
And searches for grant "CA125123"
And expands all grant years
And selects grant year 18 from list of Years
And clicks on Supplement sandbox on the grant header
#And clicks on Supplement sandbox on the grant header
And selects the Application File from the list
And selects Pay in Parent from Process Type dropdown
Then clicks on Move to Parent button to move the application
Then clicks on Move to Parent button to move the application

@EGRANTS-374 @AddingLabelSupplementYear @nesarh2 @selenium @Regression
Scenario: Test adding a label to a supplement year
And searches for grant "CA125123"
And expands all grant years
And selects grant year 17S1 from list of Years
And clicks on Add Request Name button
And provides "Automated" as the label
And clicks on Save Request Name button
Then verifies the added label

@EGRANTS-374 @EditLabelSupplementYear @nesarh2 @selenium @Regression
Scenario: Test editing a label to a supplement year
And searches for grant "CA125123"
And expands all grant years
And selects grant year 17S1 from list of Years
And clicks on Edit Edit Request Name button
And provides new "Edited LBL" as the label
And clicks on Save Request Name button
Then verifies the edited label

@EGRANTS-374 @DeleteLabelSupplementYear @nesarh2 @selenium @Regression
Scenario: Test deleting a label to a supplement year
And searches for grant "CA125123"
And expands all grant years
And selects grant year 17S1 from list of Years
And clicks on Edit Edit Request Name button
Then clicks on Delete button to delete the label
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,48 @@ public class EgrantsSearchAndFileManagementScenariosPage {
@FindBy(css = "//button[@title='Click here to pay with Parent Grant by parent appl [alt + shift + M]']")
public WebElement moveToParentButton;

/**
* Expanded - Grant year 17S1
*/
@FindBy(css = "div[id='appls_all_687129'] a[title='View All Documents for 3P30CA125123-17S1']")
public WebElement grantYear17S1;

/**
* Add Request Name Button
*/
@FindBy(xpath = "//div/button[contains(text(), 'Add Request Name')]")
public WebElement addRequestNameButton;

/**
* Request Name Text Box
*/
@FindBy(css = "input[id='newGrantYearName10831223']")
public WebElement requestNameTextBox;

/**
* Request Name Save Button
*/
@FindBy(css = "div[id='renameModalId10831223'] div[class='modal-body'] div button:nth-child(1)")
public WebElement requestNameSaveButton;

/**
* Request Name Delete Button
*/
@FindBy(css = "button[id='deleteGrantYearName10831223']")
public WebElement requestNameDeleteButton;

/**
* Edit Request Name Button
*/
@FindBy(xpath = "//div/button[contains(text(), 'Edit Request Name')]")
public WebElement editRequestNameButton;

/**
* Label Text
*/
@FindBy(css = "div[id='yearName10831223']")
public WebElement labelText;

/**
* Constructor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import appsCommon.PageInitializers.PageInitializer;
import com.nci.automation.utils.CucumberLogUtils;
import com.nci.automation.web.CommonUtils;
import com.nci.automation.web.WebDriverUtils;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
Expand Down Expand Up @@ -495,6 +496,93 @@ public void selects_pay_in_parent_from_process_type_dropdown() {
@Then("clicks on Move to Parent button to move the application")
public void clicks_on_move_to_parent_button_to_move_the_application() {
CommonUtils.clickOnElement(egrantsSearchandFileManagementScenariosPage.moveToParentButton);
Egrants_CommonUtils.waitForAlertAndAccept(WebDriverUtils.webDriver);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to click on Year 17S1 from the list of Years
*/
@And("selects grant year 17S1 from list of Years")
public void selects_grant_year_17s1_from_list_of_years() {
CommonUtils.clickOnElement(egrantsSearchandFileManagementScenariosPage.grantYear17S1);
CommonUtils.sleep(900);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to click on the Add Request Name button
*/
@And("clicks on Add Request Name button")
public void clicks_on_add_request_name_button() {
CommonUtils.clickOnElement(egrantsSearchandFileManagementScenariosPage.addRequestNameButton);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to provide a label for the request name
* @param automated
*/
@And("provides {string} as the label")
public void provides_as_the_label(String automated) {
CommonUtils.sendKeys(egrantsSearchandFileManagementScenariosPage.requestNameTextBox, automated);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to click on Save Request Name button
*/
@And("clicks on Save Request Name button")
public void clicks_on_save_request_name_button() {
CommonUtils.clickOnElement(egrantsSearchandFileManagementScenariosPage.requestNameSaveButton);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to verify the added label
*/
@Then("verifies the added label")
public void verifies_the_added_label() {
String addedLabel = CommonUtils.getText(egrantsSearchandFileManagementScenariosPage.labelText);
softAssert.assertTrue(egrantsSearchandFileManagementScenariosPage.labelText.getText().contains(addedLabel), "*** REQUEST NAME TEXT DOES NOT MATCH ***");
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to click on Edit Request Name button
*/
@And("clicks on Edit Edit Request Name button")
public void clicks_on_edit_edit_request_name_button() {
CommonUtils.clickOnElement(egrantsSearchandFileManagementScenariosPage.editRequestNameButton);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to provide a new label for the request name
* @param newLabel
*/
@And("provides new {string} as the label")
public void provides_new_as_the_label(String newLabel) {
CommonUtils.sendKeys(egrantsSearchandFileManagementScenariosPage.requestNameTextBox, newLabel);
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to click on Save Request Name button
*/
@Then("verifies the edited label")
public void verifies_the_edited_label() {
String editedLabel = CommonUtils.getText(egrantsSearchandFileManagementScenariosPage.labelText);
softAssert.assertTrue(egrantsSearchandFileManagementScenariosPage.labelText.getText().contains(editedLabel), "*** REQUEST NAME TEXT DOES NOT MATCH ***");
CucumberLogUtils.logScreenshot();
}

/**
* This method is used to click on Delete button to delete the label
*/
@Then("clicks on Delete button to delete the label")
public void clicks_on_delete_button_to_delete_the_label() {
CommonUtils.clickOnElement(egrantsSearchandFileManagementScenariosPage.requestNameDeleteButton);
CucumberLogUtils.logScreenshot();
}
}

0 comments on commit a746833

Please sign in to comment.