Skip to content

Commit

Permalink
Merge pull request #386 from CBIIT/chaudhryma
Browse files Browse the repository at this point in the history
All regression update for Platform Business Apps -Chaudhryma
  • Loading branch information
Mariachaudhry authored Jan 31, 2025
2 parents 5900083 + f4df752 commit 3c7b33a
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 0

- name: Run specific runner class
run: mvn -B -q -Dtest="PLATFORM_BUSINESS.CCR_ELECTRONIC_APPROVAL.Runners.Run_CCREAPPROV_Regression_Test" test
run: mvn -B -q -Dtest="PLATFORM_BUSINESS.CCR_ELECTRONIC_APPROVAL.runners.Run_CCREAPPROV_Regression_Test" test
continue-on-error: true

- name: Generate timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public static void following_options_are_available_in_the_subcategory_field_when
*
*/
public static void deleteTheRecord() {
CommonUtils.sleep(2000);
CommonUtils.waitForVisibility(CTRPCTRO_NV_Page.ctrpCTRONVCaseRecordDeleteButton);
CommonUtils.waitForClickability(CTRPCTRO_NV_Page.ctrpCTRONVCaseRecordDeleteButton);
CommonUtils.clickOnElement(CTRPCTRO_NV_Page.ctrpCTRONVCaseRecordDeleteButton);
CommonUtils.waitForVisibility(CTRPCTRO_NV_Page.ctrpCTRONVCaseRecordPopUpDeleteButton);
CommonUtils.clickOnElement(CTRPCTRO_NV_Page.ctrpCTRONVCaseRecordPopUpDeleteButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static void aEtrackingUserOpensAnAssetRecord() {
CommonUtils.sendKeys(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordExpirationDateTextBox, EtrackAssetsRecords_NativeView_Constants.ETRACKING_ASSETS_NEW_RECORD_EXPIRATION_DATE_TEXT_BOX);
CommonUtils.sendKeys(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordAssetInformationTextBox, EtrackAssetsRecords_NativeView_Constants.ETRACKING_ASSETS_NEW_RECORD_ASSET_INFORMATION_TEXT_BOX);
CommonUtils.selectDropDownValue(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordStatusDropDown, EtrackAssetsRecords_NativeView_Constants.ETRACKING_ASSETS_NEW_RECORD_STATUS_DROP_DOWN);
CommonUtils.waitForClickability(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordSubmitButton);
etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordSubmitButton.click();
CommonUtils.waitForVisibility(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsAllRecordSearchDropDown);
CommonUtils.selectDropDownValue(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsAllRecordSearchDropDown, EtrackAssetsRecords_NativeView_Constants.ETRACKING_NATIVE_VIEW_ASSETS_ALL_RECORD_SEARCH_DROP_DOWN);
Expand Down Expand Up @@ -128,7 +129,9 @@ public static void theUserIsAbleToEnterAtLeastOneThousandCharacters() {
"--VERIFY THE ASSET INFORMATION TEXT BOX CHARACTERS COUNT--" );
JavascriptUtils.drawBlueBorder(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordAssetInformationTextBox);
CucumberLogUtils.logScreenshot();
CommonUtils.waitForClickability(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordStatusDropDown);
CommonUtils.selectDropDownValue(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordStatusDropDown, EtrackAssetsRecords_NativeView_Constants.ETRACKING_ASSETS_NEW_RECORD_STATUS_DROP_DOWN);
CommonUtils.waitForClickability(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordSubmitButton);
etrackAssetsRecords_NativeViewPage.nVEtrackAssetsNewRecordSubmitButton.click();
CommonUtils.waitForVisibility(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsAllRecordSearchDropDown);
CommonUtils.selectDropDownValue(etrackAssetsRecords_NativeViewPage.nVEtrackAssetsAllRecordSearchDropDown, EtrackAssetsRecords_NativeView_Constants.ETRACKING_NATIVE_VIEW_ASSETS_ALL_RECORD_SEARCH_DROP_DOWN);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Feature: Top Accomplishments Submission

@NERDSNOW-759 @chaudhryma @Regression @playwright
@NERDSNOW-759 @NERDSNOW-801 @chaudhryma @Regression @playwright
Scenario: Test Create a 'Top Accomplishments' Record
Given any user is on NERD
When they access the 'NERD' Catalog
Then they can create a record called "Top Accomplishments"
And add attachments via the record itself
And 'Category' Field Auto Populated with the following value "Top Accomplishment"
And 'Category' Field Auto Populated with the following value "Top Accomplishments"
And 'Rank' field is mandatory drop-down with the following options "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Not Top 10"
And 'Fiscal Year' field is mandatory dropdown with the following options for Previous year "2023", and Current year "2024"
And 'Title' field is mandatory short text field
And 'DOC' field is mandatory drop down with the applicable DOCs, None (selected by default), "CBIIT", "CCCT", "CCG", "CCR", "CCT", "CGH", "CRCHD", "CRS", "CSSI", "DCB", "DCCPS", "DCEG", "DCP", "DCTD", "Frederick", "OCC", "OHAM","SBIR", "TTC"
And the rank field clears out and all the 'Rank' options are reset to select again when the Fiscal Year and Doc field is changed
And 'Description' field is mandatory open HTML text field with subtext of "(3 - 4 sentences max) – please define acronyms." when hover over the Description field
And 'Research Type/Other Programs' field is mandatory drop-down, None (selected by default), "Basic", "Cancer Control", "Epidemiological", "Health Communication Programs", "Population Science", "Research Workforce Recruitment, Training, and Retention Program", "Science Education and Literacy Programs", "Translational-Post Clinical", "Translational-Pre Clinical", "Other"
And subtext of "Please select the most applicable" when hover over the "Research Type/Other Programs" field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void field_auto_populated_with_the_following_value(String category, Strin
public void field_is_mandatory_drop_down_with_the_following_options(String rank, String one, String two, String three, String four, String five, String six, String seven, String eight, String nine, String ten, String notTopTen) {

CucumberLogUtils.scenario.log("---- SELECTS EACH RANK OPTION AND VERIFY THE SELECTED OPTION ----");
assertThat(page.frameLocator("iframe[name='gsft_main']").locator("[id='label\\.u_kb_template_top_accomplishments\\.x_26385_crs_kd_rank']")).containsText("Rank");
assertThat(page.frameLocator("iframe[name='gsft_main']").locator("[id='label\\.u_kb_template_top_accomplishments\\.x_26385_crs_kd_rank']")).containsText(rank);
assertThat(page.frameLocator("iframe[name='gsft_main']").getByText("Rank")).isVisible();
page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank").selectOption(one);
assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank")).hasValue(one);
Expand All @@ -139,7 +139,7 @@ public void field_is_mandatory_drop_down_with_the_following_options(String rank,
page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank").selectOption(ten);
assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank")).hasValue(ten);
page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank").selectOption(notTopTen);
assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank")).hasValue(notTopTen);
assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank")).containsText(notTopTen);
CucumberLogUtils.playwrightScreenshot(page);
}

Expand Down Expand Up @@ -180,6 +180,8 @@ public void field_is_mandatory_short_text_field(String title) {
/**
* Verifies that a DOC field is a mandatory drop down with the applicable DOCs.
* The default selected option is "-- None --".
* This method selects each DOC option and verifies the selected option.
* Then, it selects the Rank option again since it resets after fiscal year and DOC selection and verifies the selected option.
*
* @param doc The value for the DOC field.
* @param cbiit The value for the CBIIT option.
Expand Down Expand Up @@ -251,6 +253,17 @@ public void field_is_mandatory_drop_down_with_the_applicable_do_cs_none_selected
CucumberLogUtils.playwrightScreenshot(page);
}

@Then("the rank field clears out and all the {string} options are reset to select again when the Fiscal Year and Doc field is changed")
public void the_rank_field_clears_out_and_all_the_options_are_reset_to_select_again_when_the_fiscal_year_and_doc_field_is_changed(String rank) {

CucumberLogUtils.scenario.log("---- SELECTS THE RANK OPTION AGAIN SINCE IT RESETS AFTER FISCAL YEAR AND DOC SELECTION AND VERIFY THE SELECTED OPTION ----");
assertThat(page.frameLocator("iframe[name='gsft_main']").locator("[id='label\\.u_kb_template_top_accomplishments\\.x_26385_crs_kd_rank']")).containsText(rank);
assertThat(page.frameLocator("iframe[name='gsft_main']").getByText("Rank")).isVisible();
page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank").selectOption("Not Top 10");
assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Rank")).containsText("Not Top 10");
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* Verifies that the 'Description' field is mandatory open HTML text field with subtext when hovering over the Description field.
*
Expand Down Expand Up @@ -717,5 +730,14 @@ public void is_an_optional_field_that_gets_populated_with_the_email_of_the_user_
boolean emailPresent = page.frameLocator("iframe[name='gsft_main']").locator("//textarea[@id='sys_readonly.u_kb_template_top_accomplishments.x_26385_crs_kd_point_of_contact_email']").isVisible();
Assert.assertTrue("Expected email is not present on the page", emailPresent);
CucumberLogUtils.playwrightScreenshot(page);

CucumberLogUtils.scenario.log("---- DELETES THE RECORD SO RANK OPTION CAN BE AVAILABLE FOR NEXT RUN ----");
assertThat(page.locator("iframe[name=\"gsft_main\"]").contentFrame().locator("#sysverb_delete")).isVisible();
assertThat(page.locator("iframe[name=\"gsft_main\"]").contentFrame().locator("#sysverb_delete")).containsText("Delete");
page.locator("iframe[name=\"gsft_main\"]").contentFrame().locator("#sysverb_delete").click();
assertThat(page.locator("iframe[name=\"gsft_main\"]").contentFrame().getByLabel("Confirmation Help").getByRole(AriaRole.BUTTON, new Locator.GetByRoleOptions().setName("Delete"))).isVisible();
assertThat(page.locator("iframe[name=\"gsft_main\"]").contentFrame().locator("#ok_button")).containsText("Delete");
page.locator("iframe[name=\"gsft_main\"]").contentFrame().getByLabel("Confirmation Help").getByRole(AriaRole.BUTTON, new Locator.GetByRoleOptions().setName("Delete")).click();
CucumberLogUtils.playwrightScreenshot(page);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ public static void verifyingArticleVersionNumber(String versionNumber) {
webDriver.navigate().refresh();
nerdCrsKnowledgeDatabaseSubmissionsPage.crsKnowledgeManagementSystemHomePageHOMEButton.click();
nerdCrsKnowledgeDatabaseSubmissionsPage.crsKnowledgeManagementSystemHomePageNERDButton.click();
CommonUtils.sleep(7000);
CommonUtils.sleep(55000); //Required to load NERD records
CommonUtils.waitForVisibility( nerdCrsKnowledgeDatabaseSubmissionsPage.collaborationsList);
JavascriptUtils.clickByJS(nerdCrsKnowledgeDatabaseSubmissionsPage.collaborationsList);
CommonUtils.sleep(1000);
Expand All @@ -754,6 +754,7 @@ public static void verifyingIncrementedArticleVersionNumber(String versionNumber
webDriver.navigate().refresh();
nerdCrsKnowledgeDatabaseSubmissionsPage.crsKnowledgeManagementSystemHomePageHOMEButton.click();
nerdCrsKnowledgeDatabaseSubmissionsPage.crsKnowledgeManagementSystemHomePageNERDButton.click();
CommonUtils.sleep(55000); //Required to load NERD records
CommonUtils.waitForVisibility( nerdCrsKnowledgeDatabaseSubmissionsPage.collaborationsList);
JavascriptUtils.clickByJS(nerdCrsKnowledgeDatabaseSubmissionsPage.collaborationsList);
CommonUtils.sleep(2000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public void a_onboarding_request_submitted_for_a_new_hire_contractor() {
page.locator("#s2id_sp_formfield_equipment_shipped a").click();
page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName("No").setExact(true)).click();
CucumberLogUtils.playwrightScreenshot(page);

CucumberLogUtils.scenario.log("---- CBIIT ONBOARD FORM SUBMITS ----");
page.locator("//button[@class='btn btn-primary ng-binding ng-scope']").isVisible();
page.locator("//button[@class='btn btn-primary ng-binding ng-scope']").click();
Expand Down Expand Up @@ -255,6 +254,7 @@ public void i_should_have_access_to_view_the_submitted_onboarding_request_for_th
CucumberLogUtils.scenario.log("---- VERIFYING THAT I AS A SUPERVISOR IS ABLE TO ACCESS THE ONBOARDING REQUEST IN NATIVE VIEW ----");
assertThat(onBoardingNVPage.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Umit Topaloglu: available"))).isVisible();
assertThat(onBoardingNVPage.frameLocator("iframe[name='gsft_main']").getByLabel("Number", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(ticketNumber);
onBoardingNVPage.frameLocator("iframe[name='gsft_main']").locator("[id='sc_req_item\\.form_header']").isVisible();
assertThat(onBoardingNVPage.frameLocator("iframe[name='gsft_main']").locator("[id='sc_req_item\\.form_header']")).containsText(ticketNumber);
assertThat(onBoardingNVPage.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.TEXTBOX, new FrameLocator.GetByRoleOptions().setName("Read only - cannot be modifiedOpened by"))).hasValue("Umit Topaloglu");
CucumberLogUtils.playwrightScreenshot(onBoardingNVPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,13 @@ public void field_should_become_required(String hardwareReturnTicketNumbers) {
page.locator("//button[contains(@class,'btn btn-primary ng-binding ng-scope')]").click();
assertThat(page.locator(OFFBOARD_Page.cbiit_ErrorLocator)).containsText(CBIIT_OFFBOARD_FORM_Constants.CBIIT_REQUIRED_FIELDS_ARE_INCOMPLETE_TEXT);
CucumberLogUtils.playwrightScreenshot(page);
assertThat(page.locator("#hardware_ticket_number")).containsText("Hardware Return Ticket Number(s)");
page.getByRole(AriaRole.COMBOBOX, new Page.GetByRoleOptions().setName("Required Hardware Return")).click();
page.getByText("NCI-RITM0472474").click();
assertThat(page.locator("//span[normalize-space()='Hardware Return Ticket Number(s)']").getByText(CBIIT_OFFBOARD_FORM_Constants.CBIIT_OFFBOARDING_HARDWARE_RETURN_TICKET_NUMBER_TEXT)).isVisible();
CucumberLogUtils.playwrightScreenshot(page);
assertThat(page.locator("//span[normalize-space()='Hardware Return Ticket Number(s)']")).containsText("Hardware Return Ticket Number(s)");
page.locator("//input[@id='s2id_autogen11']").click();
page.locator("//input[@id='s2id_autogen11']").fill("NCI-RITM0500032");
page.locator("//div[@class='select2-result-cell'][normalize-space()='NCI-RITM0500032']").click();
CucumberLogUtils.playwrightScreenshot(page);
assertThat(page.locator("#additional_info")).containsText("Additional Information");
page.getByLabel("Additional Information", new Page.GetByLabelOptions().setExact(true)).fill("test");
page.locator("//button[contains(@class,'btn btn-primary ng-binding ng-scope')]").scrollIntoViewIfNeeded();
Expand Down
Loading

0 comments on commit 3c7b33a

Please sign in to comment.