Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into muzipovay2
  • Loading branch information
Muzipova committed Jan 24, 2025
2 parents b6414a5 + 10740ca commit ca957fc
Show file tree
Hide file tree
Showing 17 changed files with 342 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Feature: These are the scenarios for the Home page on the JPSurv Application
Then User clicks on every presentation of nav item
Then Verify user is able to hide the configuration panel

@Smoke @satya @playwright @Regression @NCIATWP-8065 @NCIATWP-1696
@Smoke @satya @playwright @Regression @NCIATWP-8065 @NCIATWP-1696 @NCIATWP-8152
Scenario: Verify user clicks on the submit button to calculate cohert and model specifications
Given User navigates to JPSurv home page
Then User uploads file in the homepage
Expand All @@ -143,8 +143,11 @@ Feature: These are the scenarios for the Home page on the JPSurv Application
Then User clicks on the NHL checkbox
Then User checks the relax proportionality and selects the cutpoint "5"
Then User clicks on the submit button to calculate cohert and model specifications
Then User changes the Cutpoint to "2"
Then User changes the Cutpoint to "6"
Then Validate that result page contains plots
Then User changes the Cutpoint to optimal
Then Validate that result page contains plots
Then Validate BIC text is been displayed after calculation

@Smoke @satya @playwright @Regression @NCIATWP-8065 @NCIATWP-1696
Scenario: Verify user clicks on the submit button to calculate cohert and model specifications
Expand Down Expand Up @@ -207,7 +210,7 @@ Feature: These are the scenarios for the Home page on the JPSurv Application
Then User clicks on the NCI link and verify it
Then User clicks on the USA gov link and verify it

@Smoke @satya @playwright @Regression @NCIATWP-8065
@Smoke @satya @playwright @Regression @NCIATWP-8065 @NCIATWP-4627
Scenario: Verify user is able to click on the footer links under policies
Given User navigates to JPSurv home page
Then User clicks on the accessibility link and verify it
Expand Down Expand Up @@ -236,9 +239,38 @@ Feature: These are the scenarios for the Home page on the JPSurv Application
Then User calculates cohert and model specifications with No Options
Then Validate Conditional Survival Calculation button is available after calculation.

@Smoke @satya @playwright @Regression @NCIATWP-7668 @NCIATWP-7660
@Smoke @satya @playwright @Regression @NCIATWP-7668 @NCIATWP-7660 @NCIATWP-4322 @NCIATWP-7672
Scenario: Verify cut point is already selected and cut point text ia also visible
Given User navigates to JPSurv home page
Then User uploads files and adds other data with relax proportionality
Then Validate that cut point is already selected with optimum value
Then Validate that cut point text is visible
Then Validate that cut point text is visible
And User clicks on the Advanced options and changes the entry to "8"
Then User clicks on the reset advanced options and validates entry is not "8"

@Smoke @satya @playwright @Regression @NCIATWP-4376
Scenario: Verify whether add annotation is clickable or not
Given User navigates to JPSurv home page
Then User calculates cohert and model specifications with Conditional Survival Model Using Truncated Data
And Verify add annotation button is visible and clickable
Then Click on the Add Annotation button

@Smoke @satya @playwright @Regression @NCIATWP-1727
Scenario: Verify result page contains plots after calculations
Given User navigates to JPSurv home page
Then User uploads file in the homepage
Then User selects start year of diagnosis
Then User selects end year of diagnosis
Then User selects interval of maximum years of diagnosis
Then User selects only CML checkbox only
Then User clicks on the submit button to calculate cohert and model specifications
And User clicks on the model estimates
Then Validates the model estimates contains mentioned texts

@Smoke @satya @playwright @Regression @NCIATWP-6706 @NCIATWP-7764
Scenario: Verify result page contains plots after calculations
Given User navigates to JPSurv home page
And User add specifications with NHL and Relax proportionality checkboxes
Then Validate Relax Proportionality text is visible
Then User clicks on the submit button to calculate cohert and model specifications
Then Validate the title of all the columns of the model table after calculation
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class JPSurvHomePagePlaywright {
/***
* NON HODGKIN LYMPHOMA LOCATOR
*/
public static String nhlLocator = "//select[@name='yearEnd']";
public static String nhlLocator = "//input[@id='Non-Hodgkin Lymphoma']";

/***
* CONDITIONAL SURVIVAL CALCULATION LOCATOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.testng.Assert;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.regex.Pattern;
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
import static org.testng.Assert.assertFalse;
Expand Down Expand Up @@ -257,6 +258,9 @@ public static void validateCutpointAlreadySelected() {
Assert.assertEquals("5", selectedValue, "The 'cutpoint' dropdown should have value '5' selected.");
}

/**
* VALIDATE SPECIFIED TEXT ON THE CALCULATION PAGE
*/
public static void validateSpecifiedText() {
String actualText = PlaywrightUtils.page.locator("//label[normalize-space()='Cut Point']").innerText();
String expectedString = "Cut Point";
Expand All @@ -265,4 +269,44 @@ public static void validateSpecifiedText() {
String expectedString1 = "The cut-point is the time after diagnosis that splits data into two groups. Cluster 1 includes years 1 to the cut-point. Separate JPSurv models are applied to each cluster.";
Assert.assertEquals(expectedString1, actualText1.trim());
}

/**
* CHECK ADD ANNOTATION BUTTON IS CLICKABLE AND VISIBLE
*/
public static void checkAddAnnotationButton() {
assertThat(PlaywrightUtils.page.locator("//*[@data-testid='MainPanel']//div[@role='tabpanel']//div//button[contains(text(),'+ Add Annotation')]").first()).isVisible();
assertThat(PlaywrightUtils.page.locator("//*[@data-testid='MainPanel']//div[@role='tabpanel']//div//button[contains(text(),'+ Add Annotation')]").first()).isEnabled();
}

/**
* ADDS SPECIFICATIONS WITH NHL AND RELAX PROPORTIONALITY CHECKBOXES
*/
public static void addSpecificationWithNHLAndRelaxProportionality(){
uploadFile();
PlaywrightUtils.page.locator(JPSurvHomePagePlaywright.startYear).selectOption("5");
PlaywrightUtils.page.locator(JPSurvHomePagePlaywright.endYear).selectOption("15");
PlaywrightUtils.page.locator(JPSurvHomePagePlaywright.nhlLocator).click();
PlaywrightUtils.page.locator("//input[@id='useRelaxModel']").click();
CommonUtils.sleep(1000);
}

/**
* VALIDATING OF COLUMN TITLES OF THE MODEL TABLE
*/
public static void columnTitleOfModelTable() {
ArrayList<String> arr = new ArrayList<>();
for (int i = 1; i <= 7; i++) {
String xpath = "//span[contains(text(),'Select Model')]//parent::th//following::th[" + i + "]";
Locator element = PlaywrightUtils.page.locator(xpath);
arr.add(element.textContent());
}
System.out.println(arr);
Assert.assertTrue(arr.contains("Model"));
Assert.assertTrue(arr.contains("Number of Joinpoints"));
Assert.assertTrue(arr.contains("Location"));
Assert.assertTrue(arr.contains("Bayesian Information Criterion (BIC)"));
Assert.assertTrue(arr.contains("Akaike Information Criterion (AIC)"));
Assert.assertTrue(arr.contains("Log Likelihood"));
Assert.assertTrue(arr.contains("Converged"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Given User is logged in the application and is on the landing page
And selects the current date
And clicks on Locate File and Upload tab
And uploads a file
Then verifies the success message "Done! New document has been created"
Then verifies the success message "Done! Funding document has been uploaded"

@MoveSupplementApplication @nesarh2 @selenium @In-Progress
Scenario: Test moving a supplement application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public class EgrantsSearchAndFileManagementScenariosPage {
/**
* Replace Button
*/
@FindBy (xpath = "//tbody/tr[1]/td[5]/a[1]/img[1]")
@FindBy (xpath = "(//a[@title='Replace Document'])[1]")
public WebElement replaceButton;

/**
Expand Down
31 changes: 28 additions & 3 deletions src/test/java/CUSTOM_BUSINESS/OASYS/Features/Contracts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Scenario: Edit contract assignments
And User clicks on Assignments
And User clicks on Edit button
And User clicks on ADD INVOICE Support Staff
And User types "Test COR" in Invoice Support Staff field
And User clicks on Test COR
And User types "Test AO" in Invoice Support Staff field
And User clicks on Test AO
Then User will click on SAVE button

@CreateContractMessage @NESARH2 @Regression @playwright
Expand Down Expand Up @@ -121,4 +121,29 @@ Scenario: Using search filters to narrow down search results
And User selects "RUSSELL John" from the Staff Assignment dropdown on the contract page
And User selects Show inactive contracts
And User clicks on SEARCH button to search for defined contracts
Then User will verify if "Dell EMC Isilon Hardware and Software Support and Maintenance" is listed in the search results
Then User will verify if "Dell EMC Isilon Hardware and Software Support and Maintenance" is listed in the search results

@ContractSliderDetails @NESARH2 @Regression @playwright
Scenario: Verify a contract details on the slider matches the main contract page
When User clicks on Contracts
And User clicks on the eye icon for IT Commodities and Solutions
And User verifies the project title
And User verifies the REFPIID-PIID
And User verifies the CO assigned on the contract
And User verifies the CS assigned on the contract
And User verifies the COR assigned on the contract
Then User closes the slider

@ExportContractSearchResults @NESARH2 @Regression @playwright
Scenario: Export search results
When User clicks on Contracts
And User selects Show inactive contracts
And User types "IT Commodities" in the Contract Title field
And User clicks on SEARCH button to search for defined contracts
Then User will click on EXPORT SEARCH RESULT button

@TestCORUserAccessLevel @NESARH2 @Regression @playwright
Scenario: Verify that Test COR can not access All Contracts
When a user with Test COR logs in the application
And User navigates to Contracts
Then User will verify that Test COR can not access All Contracts
122 changes: 115 additions & 7 deletions src/test/java/CUSTOM_BUSINESS/OASYS/Steps/Contracts.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,23 @@ public void user_clicks_on_add_invoice_support_staff() {

/**
* This method is typing Test COR in Invoice Support Staff field
* @param TestCor
* @param TestAO
*/
@When("User types {string} in Invoice Support Staff field")
public void user_types_in_invoice_support_staff_field(String TestCor) {
page.locator("xpath=//div/input[@ng-reflect-placeholder='Add Invoice Support Staff']").fill(TestCor);
public void user_types_in_invoice_support_staff_field(String TestAO) {
if (page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName("Test AO")).isVisible()) {
page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName("Test AO")).locator("mat-icon").click();
}
page.locator("xpath=//div/input[@ng-reflect-placeholder='Add Invoice Support Staff']").fill(TestAO);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is clicking on Test COR
* This method is clicking on Test AO
*/
@When("User clicks on Test COR")
public void user_clicks_on_test_cor() {
page.locator("//span[contains(text(),'Test COR')]").click();
@When("User clicks on Test AO")
public void user_clicks_on_test_AO() {
page.locator("//span[contains(text(),'Test AO')]").click();
CucumberLogUtils.playwrightScreenshot(page);
}

Expand Down Expand Up @@ -771,4 +774,109 @@ public void user_will_verify_if_is_listed_in_the_search_results(String ExpectedC
assertThat(page.locator("mat-row")).containsText(ExpectedContractTile);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is clicking on the eye icon for IT Commodities and Solutions
*/
@And("User clicks on the eye icon for IT Commodities and Solutions")
public void user_clicks_on_the_eye_icon_for_it_commodities_and_solutions() {
page.getByRole(AriaRole.ROW, new Page.GetByRoleOptions().setName("IT Commodities and Solutions HHSN316201500067W Other SWORD & SHIELD ENTERPRISE")).getByRole(AriaRole.BUTTON).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is verifying the project title
*/
@And("User verifies the project title")
public void user_verifies_the_project_title() {
assertThat(page.locator("contractsoverview-contract-details-drawer")).containsText(OASYS_Constants.PROJ_TITLE_IT);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is verifying the contract number
*/
@And("User verifies the REFPIID-PIID")
public void user_verifies_the_refpiid_piid() {
assertThat(page.locator("contractsoverview-contract-details-drawer")).containsText(OASYS_Constants.REFPIID_PIID);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is verifying the assigned CO
*/
@And("User verifies the CO assigned on the contract")
public void user_verifies_the_co_assigned_on_the_contract() {
assertThat(page.locator("contractsoverview-contract-details-drawer")).containsText(OASYS_Constants.ASSIGNED_CO);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is verifying the assigned CS
*/
@And("User verifies the CS assigned on the contract")
public void user_verifies_the_cs_assigned_on_the_contract() {
assertThat(page.locator("contractsoverview-contract-details-drawer")).containsText(OASYS_Constants.ASSIGNED_CS);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is verifying the assigned COR
*/
@And("User verifies the COR assigned on the contract")
public void user_verifies_the_cor_assigned_on_the_contract() {
assertThat(page.locator("contractsoverview-contract-details-drawer")).containsText(OASYS_Constants.ASSIGNED_COR);
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is closing the contract slider
*/
@Then("User closes the slider")
public void user_closes_the_slider() {
page.locator("button").filter(new Locator.FilterOptions().setHasText("close")).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is clicking on Export Search Result button
*/
@Then("User will click on EXPORT SEARCH RESULT button")
public void user_will_click_on_export_search_result_button() {
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Export Search Result")).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is signing in the application as TEST COR
*/
@When("a user with Test COR logs in the application")
public void a_user_with_test_cor_logs_in_the_application() {
page.navigate(OASYS_Constants.OASYS_SIDE_LOGIN);
page.getByLabel("UserName").click();
page.getByLabel("UserName").fill(OASYS_Constants.OASYS_TEST_USERNAME);
page.getByLabel("Password").click();
page.getByLabel("Password").fill(OASYS_Constants.OASYS_TEST_PASSWORD);
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Login")).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is navigating to Contracts
*/
@And("User navigates to Contracts")
public void user_navigates_to_contracts() {
page.getByText("Contract Administrationkeyboard_arrow_down").click();
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Contract")).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is verifying that the Test COR can not access All Contracts
*/
@Then("User will verify that Test COR can not access All Contracts")
public void user_will_verify_that_test_cor_can_not_access_all_contracts() {
assertThat(page.locator("div").filter(new Locator.FilterOptions().setHasText(Pattern.compile("^All Contracts$"))).nth(2)).isHidden();
CucumberLogUtils.playwrightScreenshot(page);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ public class OASYS_Constants {
public static final String PROJECT_TITLE = "TEST CONTRACT IMPORT";
public static final String CONTRACT_HEADER = "HHSTESTN01500067W";
public static final String VENDOR = "SWORD & SHIELD ENTERPRISE";
public static final String PROJ_TITLE_IT = "Project Title: IT Commodities and Solutions";
public static final String REFPIID_PIID = "REFPIID/PIID: HHSN316201500067W";
public static final String ASSIGNED_CO = "CO: CO, Test";
public static final String ASSIGNED_CS = "CS: CS1, Test";
public static final String ASSIGNED_COR = "COR: COR, Test";
public static final String OASYS_SIDE_LOGIN = "https://oasys-qa.cancer.gov/#/login";
public static final String OASYS_TEST_USERNAME = "COR";
public static final String OASYS_TEST_PASSWORD = "a";
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Feature: NCCR flow
And User confirms that the text of "Confidentiality" section is correct
When User clicks Go to the NCCR Platform hyperlink
Then User can confirm that it redirects them to Data Platform page
And User can see pagination for All Data Requests tab
And User can see Data Requests Awaiting My Review tab
And User can see Data Requests Awaiting My Review tab search text field
And User can see pagination for Data Requests Awaiting My Review tab
Expand All @@ -20,4 +21,3 @@ Feature: NCCR flow
When User clicks Show Filter icon
Then User can see Load Filter, Save Filter, Add Sort, and New Criteria buttons
And User can close filter
And User can see pagination for All Data Requests tab
2 changes: 1 addition & 1 deletion src/test/java/PLATFORM_BUSINESS/NCCR/pages/NCCRPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class NCCRPage {
public WebElement rowsPaginationDataRequestsAwaitingMyReviewTab;

/**Rows pagination*/
@FindBy(xpath = "(//div [@class='btn-toolbar m-r pull-left'])[2]")
@FindBy(xpath = "//div[contains(text(),'Rows')]")
public WebElement rowsPaginationAllDataRequestTab;

/**Show filter button*/
Expand Down
Loading

0 comments on commit ca957fc

Please sign in to comment.