Skip to content

Commit

Permalink
Edit Contract information & Assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nesar committed Dec 17, 2024
1 parent dc57e7c commit aa5a7a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/nci/automation/web/TestProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class TestProperties {

public static String ENV = "test";
public static String BROWSER = "chrome";
public static boolean HEADLESS = false;
public static boolean HEADLESS = true;
public static int SET_SLOW_MO_TIME = 1000;

/**
Expand Down
33 changes: 16 additions & 17 deletions src/test/java/CUSTOM_BUSINESS/Oasys/Steps/Contracts.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.microsoft.playwright.*;
import com.microsoft.playwright.options.*;
import com.nci.automation.utils.CucumberLogUtils;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
Expand Down Expand Up @@ -35,7 +36,7 @@ public void user_clicks_on_contracts() {
* This method is selecting a contract from the list of contracts
* @param ITcommodities
*/
@When("user selects {string} from the list of contracts")
@And("user selects {string} from the list of contracts")
public void user_selects_from_the_list_of_contracts(String ITcommodities) {
page.getByRole(AriaRole.ROW, new Page.GetByRoleOptions().setName("IT Commodities and Solutions HHSN316201500067W Other SWORD & SHIELD ENTERPRISE")).locator("div").first().click();
CucumberLogUtils.playwrightScreenshot(page);
Expand All @@ -44,7 +45,7 @@ public void user_selects_from_the_list_of_contracts(String ITcommodities) {
/**
* This method is clicking on Edit Contract Information button
*/
@When("user clicks on Edit Contract Information button")
@And("user clicks on Edit Contract Information button")
public void user_clicks_on_edit_contract_information_button() {
page.getByRole(AriaRole.REGION, new Page.GetByRoleOptions().setName("Contract Information")).getByRole(AriaRole.BUTTON).click();
CucumberLogUtils.playwrightScreenshot(page);
Expand All @@ -53,27 +54,17 @@ public void user_clicks_on_edit_contract_information_button() {
/**
* This method is changing the Severability to Severable
*/
@When("user changes the Severability to Severable")
@And("user changes the Severability to Severable")
public void user_changes_the_severability_to_severable() {
page.locator("xpath=//div/mat-select[@ng-reflect-placeholder='Severability']").click();
//page.locator("xpath=/html[1]/body[1]/div[1]/div[4]/div[1]/mat-dialog-container[1]/edit-contract-details-modal[1]/div[1]/div[1]/compass-form[1]/div[1]/div[37]/ng-component[1]/mat-form-field[1]/div[1]/div[1]/div[1]/mat-select[1]/div[1]/div[2]/div[1]").click();
page.locator("xpath=//span[@class='mat-option-text'][normalize-space()='Severable']").click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is saving the changes made to the contract
*/
@Then("User clicks on Save button to confirm the changes")
public void user_clicks_on_save_button_to_confirm_the_changes() {
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Save")).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is selecting Yes from the IT related dropdown
*/
@When("User selects Yes from the IT related dropdown")
@And("User selects Yes from the IT related dropdown")
public void user_selects_from_the_it_related_dropdown() {
page.locator("xpath=//div/mat-select[@ng-reflect-placeholder='IT Related *']").click();
page.locator("xpath=//mat-option/span[contains(text(),'Yes')]").click();
Expand All @@ -83,7 +74,7 @@ public void user_selects_from_the_it_related_dropdown() {
/**
* This method is selecting Open Market for the Procurement Mechanism
*/
@When("User selects Open Market for the Procurement Mechanism")
@And("User selects Open Market for the Procurement Mechanism")
public void user_selects_for_the_procurement_mechanism() {
page.locator("xpath=//div/mat-select[@ng-reflect-placeholder='Procurment Mechanism *']").click();
page.locator("xpath=//mat-option/span[contains(text(),'Open Market')]").click();
Expand All @@ -103,7 +94,7 @@ public void user_selects_No_for_will_funding_need_to_be_added_for_expected_activ
/**
* This method is selecting No for Does the COR advise continued performance?
*/
@When("User selects No for Does the COR advise continued performance?")
@And("User selects No for Does the COR advise continued performance?")
public void user_selects_for_does_the_cor_advise_continued_performance() {
page.locator("xpath=//div/mat-select[@ng-reflect-placeholder='Does the COR Advise Continued ']").click();
page.locator("xpath=//mat-option/span[contains(text(),'No')]").click();
Expand All @@ -120,6 +111,15 @@ public void user_selects_for_what_notice_will_be_sent_in_the_event_of_a_shutdown
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is saving the changes made to the contract
*/
@Then("User clicks on Save button to confirm the changes")
public void user_clicks_on_save_button_to_confirm_the_changes() {
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Save")).click();
CucumberLogUtils.playwrightScreenshot(page);
}

/**
* This method is clicking on Contract Assignment
*/
Expand Down Expand Up @@ -175,5 +175,4 @@ public void user_will_click_on_save_button() {
page.locator("xpath=//span[contains(text(),'Save')]").click();
CucumberLogUtils.playwrightScreenshot(page);
}

}

0 comments on commit aa5a7a6

Please sign in to comment.