-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #351 from CBIIT/Nesarh2
OASYS - Edit contract information and assignment
- Loading branch information
Showing
8 changed files
with
279 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/test/java/CUSTOM_BUSINESS/Oasys/Features/Contracts.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Feature: Contract Flow | ||
|
||
Background: common steps | ||
Given User is logged in the application and navigated to Contract Administration | ||
|
||
@ContractInformation @NESARH2 @Regression @playwright | ||
Scenario: Edit contract information | ||
When User clicks on Contracts | ||
And user selects "IT Commodities and Solutions" from the list of contracts | ||
And user clicks on Edit Contract Information button | ||
And user changes the Severability to Severable | ||
And User selects Yes from the IT related dropdown | ||
And User selects Open Market for the Procurement Mechanism | ||
And User selects No for Will funding need to be added for expected activities within the next three months? | ||
And User selects No for Does the COR advise continued performance? | ||
And User selects Stop Work for What notice will be sent in the event of a shutdown? | ||
Then User clicks on Save button to confirm the changes | ||
|
||
@EditContractAssignments @NESARH2 @Regression @playwright | ||
Scenario: Edit contract assignments | ||
When User clicks on Contracts | ||
And user selects "IT Commodities and Solutions" from the list of contracts | ||
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 | ||
Then User will click on SAVE button |
14 changes: 14 additions & 0 deletions
14
src/test/java/CUSTOM_BUSINESS/Oasys/Pages/I_Trust_Page.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package CUSTOM_BUSINESS.Oasys.Pages; | ||
|
||
public class I_Trust_Page { | ||
|
||
/** | ||
* USERNAME TEXT BOX | ||
*/ | ||
public static String usernameTextBox = "#USER"; | ||
|
||
/** | ||
* PASSWORD TEXT BOX | ||
*/ | ||
public static String passwordTextBox = "#PASSWORD"; | ||
} |
178 changes: 178 additions & 0 deletions
178
src/test/java/CUSTOM_BUSINESS/Oasys/Steps/Contracts.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
package CUSTOM_BUSINESS.Oasys.Steps; | ||
|
||
import APPS_COMMON.PlaywrightUtils.Playwright_Common_Utils; | ||
import CUSTOM_BUSINESS.Oasys.StepsImplementation.Oasys_Steps_Implementation; | ||
import static com.nci.automation.web.PlaywrightUtils.page; | ||
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; | ||
|
||
public class Contracts { | ||
|
||
/** | ||
* This method is logging in the application and navigating to Contract Administration | ||
*/ | ||
@Given("User is logged in the application and navigated to Contract Administration") | ||
public void user_is_logged_in_the_application_and_navigated_to_contract_administration() { | ||
Oasys_Steps_Implementation.user_is_logged_in_oasys(); | ||
page.getByText("Contract Administrationkeyboard_arrow_down").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is navigating to Contracts page | ||
*/ | ||
@When("User clicks on Contracts") | ||
public void user_clicks_on_contracts() { | ||
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Contract").setExact(true)).click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is selecting a contract from the list of contracts | ||
* @param ITcommodities | ||
*/ | ||
@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); | ||
} | ||
|
||
/** | ||
* This method is clicking 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); | ||
} | ||
|
||
/** | ||
* This method is changing 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=//span[@class='mat-option-text'][normalize-space()='Severable']").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is selecting 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(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is selecting 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(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is selecting No for Will funding need to be added for expected activities within the next three months? | ||
*/ | ||
@When("User selects No for Will funding need to be added for expected activities within the next three months?") | ||
public void user_selects_No_for_will_funding_need_to_be_added_for_expected_activities_within_the_next_three_months() { | ||
page.locator("xpath=//div/mat-select[@ng-reflect-placeholder='Will funding need to be added ']").click(); | ||
page.locator("xpath=//mat-option/span[contains(text(),'No')]").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is selecting 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(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is selecting Stop Work for What notice will be sent in the event of a shutdown? | ||
*/ | ||
@When("User selects Stop Work for What notice will be sent in the event of a shutdown?") | ||
public void user_selects_for_what_notice_will_be_sent_in_the_event_of_a_shutdown() { | ||
page.locator("xpath=//div/mat-select[@ng-reflect-placeholder='What notice will be sent in th']").click(); | ||
page.locator("xpath=//span[@class='mat-option-text'][normalize-space()='Stop Work']").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 clicking on Contract Assignment | ||
*/ | ||
@When("User clicks on Assignments") | ||
public void user_clicks_on_assignments() { | ||
Playwright_Common_Utils.scrollIntoView("xpath=//mat-expansion-panel-header/span/mat-panel-title[contains(text(),'Assignments')]"); | ||
page.locator("xpath=//mat-expansion-panel-header/span/mat-panel-title[contains(text(),'Assignments')]").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is clicking on Edit button | ||
*/ | ||
@When("User clicks on Edit button") | ||
public void user_clicks_on_edit_button() { | ||
page.locator("xpath=(//div/div/button/span[contains(text(), 'Edit')])[4]").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is clicking on Add Invoice Support Staff | ||
*/ | ||
@When("User clicks on ADD INVOICE Support Staff") | ||
public void user_clicks_on_add_invoice_support_staff() { | ||
page.locator("xpath=//div/input[@ng-reflect-placeholder='Add Invoice Support Staff']").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is typing Test COR in Invoice Support Staff field | ||
* @param TestCor | ||
*/ | ||
@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); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is clicking on Test COR | ||
*/ | ||
@When("User clicks on Test COR") | ||
public void user_clicks_on_test_cor() { | ||
page.locator("//span[contains(text(),'Test COR')]").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
|
||
/** | ||
* This method is clicking on Save button | ||
*/ | ||
@Then("User will click on SAVE button") | ||
public void user_will_click_on_save_button() { | ||
page.locator("xpath=//span[contains(text(),'Save')]").click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/java/CUSTOM_BUSINESS/Oasys/StepsImplementation/Oasys_Steps_Implementation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package CUSTOM_BUSINESS.Oasys.StepsImplementation; | ||
|
||
import CUSTOM_BUSINESS.Oasys.Pages.I_Trust_Page; | ||
import com.microsoft.playwright.Page; | ||
import com.microsoft.playwright.options.AriaRole; | ||
import com.nci.automation.utils.CucumberLogUtils; | ||
import com.nci.automation.utils.EncryptionUtils; | ||
import static com.nci.automation.web.PlaywrightUtils.page; | ||
import static com.nci.automation.web.TestProperties.*; | ||
|
||
public class Oasys_Steps_Implementation { | ||
|
||
/** | ||
* User is logged into OASYS | ||
*/ | ||
public static void user_is_logged_in_oasys() { | ||
page.navigate(getOasysUrl()); | ||
page.locator(I_Trust_Page.usernameTextBox).fill(I_TRUST_USERNAME); | ||
page.locator(I_Trust_Page.passwordTextBox).fill(EncryptionUtils.decrypt(I_TRUST_PASSWORD)); | ||
page.locator(I_Trust_Page.passwordTextBox).press("Enter"); | ||
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("ACCEPT")).click(); | ||
CucumberLogUtils.playwrightScreenshot(page); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/java/CUSTOM_BUSINESS/Oasys/runners/RunOasysRegressionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package CUSTOM_BUSINESS.Oasys.runners; | ||
|
||
import io.cucumber.testng.AbstractTestNGCucumberTests; | ||
import io.cucumber.testng.CucumberOptions; | ||
|
||
@CucumberOptions(plugin = {"html:target/Oasys-regression-reports/Oasys-regression-report.html", "json:target/cucumber.json", | ||
"rerun:target/failed.txt", | ||
"pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"} | ||
, features = "src/test/java/CUSTOM_BUSINESS/Oasys/features" | ||
, glue = {"CUSTOM_BUSINESS.Oasys.Steps", "Hooks"} | ||
, tags = "@Regression" | ||
, dryRun = false | ||
) | ||
public class RunOasysRegressionTest extends AbstractTestNGCucumberTests{ | ||
} |