From 4a365aeeeae5e24b795aa4727b7d658c0ebcfd50 Mon Sep 17 00:00:00 2001 From: Sarwar Date: Fri, 20 Dec 2024 14:53:02 -0500 Subject: [PATCH 1/3] init commit --- src/main/java/com/nci/automation/web/TestProperties.java | 2 +- .../java/ITSM/ESR/playwright/features/ESRApproval.feature | 2 +- .../stepsImplementation/ESRTaskStepsImplementation.java | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/nci/automation/web/TestProperties.java b/src/main/java/com/nci/automation/web/TestProperties.java index 075e3a50c..6cc8c498f 100644 --- a/src/main/java/com/nci/automation/web/TestProperties.java +++ b/src/main/java/com/nci/automation/web/TestProperties.java @@ -4,7 +4,7 @@ public class TestProperties { public static String ENV = "test"; public static String BROWSER = "chrome"; - public static boolean HEADLESS = true; + public static boolean HEADLESS = false; public static int SET_SLOW_MO_TIME = 1000; /** diff --git a/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature b/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature index c0e76ce6a..ddf1e6445 100644 --- a/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature +++ b/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature @@ -45,7 +45,7 @@ Feature: ESR Approvals And the user is approved from the ESR Board approvers Then the user confirms the ESR Board Intake Approvals are completed - @ESR-702 @sarwarahmed1 @In-Progress @playwright + @ESR-702 @sarwarahmed1 @Progression @playwright Scenario: Test the Federal Lead Closeout Approval in an ESR-Q ticket Given a user logs into Native View on the NCI at your service page And navigates to create ESR diff --git a/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRTaskStepsImplementation.java b/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRTaskStepsImplementation.java index 01a32405a..982856196 100644 --- a/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRTaskStepsImplementation.java +++ b/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRTaskStepsImplementation.java @@ -172,9 +172,8 @@ public static void completeCloseoutPreparationCatalogTaskForESRQ() { Playwright_Common_Locators.iframeLocator().locator("(//div[@class='sc_variable_editor']/div/select)[4]").selectOption("Proceed to Implementation"); Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   OCIO Federal Lead to")).click(); Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   OCIO Federal Lead to")).fill("Jennifer Kwok"); - Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   Project Lead Assignment")).click(); - Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   Project Lead Assignment")).click(); - Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   Project Lead Assignment")).fill("CHARMS Technical Support"); + Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   Project Assignment Group")).click(); + Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("   Project Assignment Group")).fill("CHARMS Technical Support"); Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("Project Lead to implement Q-")).click(); Playwright_Common_Locators.iframeLocator().getByRole(AriaRole.COMBOBOX, new FrameLocator.GetByRoleOptions().setName("Project Lead to implement Q-")).fill("Larry Brem"); Playwright_Common_Locators.iframeLocator().getByLabel("Add a row for Technology").click(); From 27887b1d257bf859cb4bd3e8cacac48fbaad863b Mon Sep 17 00:00:00 2001 From: Sarwar Date: Fri, 20 Dec 2024 15:04:40 -0500 Subject: [PATCH 2/3] test case completed --- .../com/nci/automation/web/TestProperties.java | 2 +- .../ESR/playwright/features/ESRApproval.feature | 4 +++- .../ESR/playwright/steps/ESRApprovalSteps.java | 9 +++++++++ .../ESRApprovalStepsImplementation.java | 17 +++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nci/automation/web/TestProperties.java b/src/main/java/com/nci/automation/web/TestProperties.java index 6cc8c498f..075e3a50c 100644 --- a/src/main/java/com/nci/automation/web/TestProperties.java +++ b/src/main/java/com/nci/automation/web/TestProperties.java @@ -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; /** diff --git a/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature b/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature index ddf1e6445..f65053514 100644 --- a/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature +++ b/src/test/java/ITSM/ESR/playwright/features/ESRApproval.feature @@ -45,7 +45,7 @@ Feature: ESR Approvals And the user is approved from the ESR Board approvers Then the user confirms the ESR Board Intake Approvals are completed - @ESR-702 @sarwarahmed1 @Progression @playwright + @ESR-702 @sarwarahmed1 @Regression @playwright Scenario: Test the Federal Lead Closeout Approval in an ESR-Q ticket Given a user logs into Native View on the NCI at your service page And navigates to create ESR @@ -57,6 +57,8 @@ Feature: ESR Approvals And the user is approved from the ESR Board approvers And the Engineering Project Execution catalog task is completed And the Closeout Preparation catalog task for ESR-Q is completed + And the user is approved from a federal lead for closeout approval + Then the user confirms the Federal Lead Closeout Approval is completed @ESR-703 @sarwarahmed1 @Regression @playwright Scenario: Test the Operational POC Approval catalog task in an ESR-I ticket diff --git a/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java b/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java index f5746c030..aadb34028 100644 --- a/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java +++ b/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java @@ -35,4 +35,13 @@ public void the_user_is_approved_from_the_operational_poc() { public void the_user_confirms_the_operational_poc_approval_is_completed() { ESRApprovalStepsImplementation.confirmOperationalPOCApprovalIsCompleted(); } + + @And("the user is approved from a federal lead for closeout approval") + public void the_user_is_approved_from_a_federal_lead_for_closeout_approval() { + ESRApprovalStepsImplementation.federalLeadCloseoutApproval(); + } + @Then("the user confirms the Federal Lead Closeout Approval is completed") + public void the_user_confirms_the_federal_lead_closeout_approval_is_completed() { + ESRApprovalStepsImplementation.confirmFederalLeadCloseoutApprovalIsCompleted(); + } } \ No newline at end of file diff --git a/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRApprovalStepsImplementation.java b/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRApprovalStepsImplementation.java index 0a1b0236e..7c12e3122 100644 --- a/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRApprovalStepsImplementation.java +++ b/src/test/java/ITSM/ESR/playwright/stepsImplementation/ESRApprovalStepsImplementation.java @@ -68,4 +68,21 @@ public static void operationalPOCApproval() { public static void confirmOperationalPOCApprovalIsCompleted() { assertThat(Playwright_Common_Locators.iframeLocator().locator("//select[@aria-label='Stage']")).containsText("Federal Lead Closeout Approval"); } + + /** + * This method completes the Federal Lead Closeout approval + */ + public static void federalLeadCloseoutApproval() { + Playwright_Common_Locators.iframeLocator().locator("#tabs2_list").getByText("Approvers (10)").click(); + Playwright_Common_Locators.iframeLocator().getByLabel("Requested - Open record:").click(); + Playwright_Common_Locators.iframeLocator().locator("(//select[@aria-required='false'])[1]").selectOption("approved"); + Playwright_Common_Locators.iframeLocator().locator("#sysverb_update").click(); + } + + /** + * This method confirms that the Federal Lead Closeout Approval is completed + */ + public static void confirmFederalLeadCloseoutApprovalIsCompleted() { + assertThat(Playwright_Common_Locators.iframeLocator().locator("//select[@aria-label='Stage']")).containsText("ESR Board Closeout Review"); + } } \ No newline at end of file From e4e4fb03fa3eb7fbfc9c62b62b63e26b475b5575 Mon Sep 17 00:00:00 2001 From: Sarwar Date: Fri, 20 Dec 2024 15:05:49 -0500 Subject: [PATCH 3/3] edits --- src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java b/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java index aadb34028..5cad4985c 100644 --- a/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java +++ b/src/test/java/ITSM/ESR/playwright/steps/ESRApprovalSteps.java @@ -40,6 +40,7 @@ public void the_user_confirms_the_operational_poc_approval_is_completed() { public void the_user_is_approved_from_a_federal_lead_for_closeout_approval() { ESRApprovalStepsImplementation.federalLeadCloseoutApproval(); } + @Then("the user confirms the Federal Lead Closeout Approval is completed") public void the_user_confirms_the_federal_lead_closeout_approval_is_completed() { ESRApprovalStepsImplementation.confirmFederalLeadCloseoutApprovalIsCompleted();