From 6092317a610d1428ce82a05c229e959231fd9bcd Mon Sep 17 00:00:00 2001 From: mariachaudhry Date: Fri, 15 Nov 2024 00:42:34 -0500 Subject: [PATCH 1/2] OCPL and Travel Request updates and test cases automated --- .../Features/OCPL_Training_Request.feature | 0 .../Runners/Run_OCPL_PW_Progression_Test.java | 8 +- .../Runners/Run_OCPL_PW_Regression_Test.java | 8 +- .../Steps/OCPL_Training_Request_Steps.java | 2 +- .../Travel_Request_Portal_Form.feature | 26 +- .../Travel_Request_Portal_Form_StepImpl.java | 13 +- .../Steps/Travel_Request_NV_Steps.java | 66 +++-- .../Travel_Request_Portal_Form_Steps.java | 253 +++++++++++++++++- 8 files changed, 325 insertions(+), 51 deletions(-) rename src/test/java/ServiceNow/PlatformBusinessApps/{SNOWPROJ => OCPL_Training}/Features/OCPL_Training_Request.feature (100%) rename src/test/java/ServiceNow/PlatformBusinessApps/{SNOWPROJ => OCPL_Training}/Runners/Run_OCPL_PW_Progression_Test.java (61%) rename src/test/java/ServiceNow/PlatformBusinessApps/{SNOWPROJ => OCPL_Training}/Runners/Run_OCPL_PW_Regression_Test.java (61%) rename src/test/java/ServiceNow/PlatformBusinessApps/{SNOWPROJ => OCPL_Training}/Steps/OCPL_Training_Request_Steps.java (99%) diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Features/OCPL_Training_Request.feature b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Features/OCPL_Training_Request.feature similarity index 100% rename from src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Features/OCPL_Training_Request.feature rename to src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Features/OCPL_Training_Request.feature diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Runners/Run_OCPL_PW_Progression_Test.java b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Runners/Run_OCPL_PW_Progression_Test.java similarity index 61% rename from src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Runners/Run_OCPL_PW_Progression_Test.java rename to src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Runners/Run_OCPL_PW_Progression_Test.java index 4e4a8b8f8..d796281b7 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Runners/Run_OCPL_PW_Progression_Test.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Runners/Run_OCPL_PW_Progression_Test.java @@ -1,13 +1,13 @@ -package ServiceNow.PlatformBusinessApps.SNOWPROJ.Runners; +package ServiceNow.PlatformBusinessApps.OCPL_Training.Runners; import io.cucumber.testng.AbstractTestNGCucumberTests; import io.cucumber.testng.CucumberOptions; -@CucumberOptions(plugin = {"html:target/html-reports/cucumber-default-report.html", +@CucumberOptions(plugin = {"html:target/OCPL-Training-Progression-reports/OCPL-Training-Progression-report.html", "json:target/cucumber.json", "rerun:target/failed.txt", "pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"} - , features = "src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Features" - , glue = {"ServiceNow.PlatformBusinessApps.SNOWPROJ.Steps", "Hooks"} + , features = "src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Traning/Features" + , glue = {"ServiceNow.PlatformBusinessApps.OCPL_Traning.Steps", "Hooks"} , tags = "@Progression" , dryRun = false ) diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Runners/Run_OCPL_PW_Regression_Test.java b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Runners/Run_OCPL_PW_Regression_Test.java similarity index 61% rename from src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Runners/Run_OCPL_PW_Regression_Test.java rename to src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Runners/Run_OCPL_PW_Regression_Test.java index d71fd17c9..c21450945 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Runners/Run_OCPL_PW_Regression_Test.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Runners/Run_OCPL_PW_Regression_Test.java @@ -1,13 +1,13 @@ -package ServiceNow.PlatformBusinessApps.SNOWPROJ.Runners; +package ServiceNow.PlatformBusinessApps.OCPL_Training.Runners; import io.cucumber.testng.AbstractTestNGCucumberTests; import io.cucumber.testng.CucumberOptions; -@CucumberOptions(plugin = {"html:target/html-reports/cucumber-default-report.html", +@CucumberOptions(plugin = {"html:target/OCPL-Training-Regression-reports/OCPL-Training-Regression-report.html", "json:target/cucumber.json", "rerun:target/failed.txt", "pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"} - , features = "src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Features" - , glue = {"ServiceNow.PlatformBusinessApps.SNOWPROJ.Steps", "Hooks"} + , features = "src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Traning/Features" + , glue = {"ServiceNow.PlatformBusinessApps.OCPL_Traning.Steps", "Hooks"} , tags = "@Regression" , dryRun = false ) diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Steps/OCPL_Training_Request_Steps.java b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java similarity index 99% rename from src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Steps/OCPL_Training_Request_Steps.java rename to src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java index 583f119a0..7f258a390 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOWPROJ/Steps/OCPL_Training_Request_Steps.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java @@ -1,4 +1,4 @@ -package ServiceNow.PlatformBusinessApps.SNOWPROJ.Steps; +package ServiceNow.PlatformBusinessApps.OCPL_Training.Steps; import appsCommon.PlaywrightUtils.Playwright_ServiceNow_Common_Methods; import com.microsoft.playwright.FrameLocator; diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_Portal_Form.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_Portal_Form.feature index d1c0b7cc9..d46b88074 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_Portal_Form.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_Portal_Form.feature @@ -11,7 +11,7 @@ Feature: SNOWTRAVEL Portal Form Scenarios @SNOWTRAVEL-121 @SNOWTRAVEL-130 @Chaudhryma @Smoke @Regression @playwright Scenario: Test Travel Start Date and Travel End Date Field Additions - Given I am an authenticated DOC CGH Travel Request User + Given I am an authenticated DOC CGH Travel Request User "Dimetria Branch" When I navigate to the Trip Information section of the form, Then I should see the required "Travel Start Date" field to enter date And also see the required "Travel End Date" field to enter date @@ -20,7 +20,7 @@ Feature: SNOWTRAVEL Portal Form Scenarios @SNOWTRAVEL-125 @Chaudhryma @Smoke @Regression @playwright Scenario: Test 1: CGH Field Enhancements on Travel Request Form - Given I am an authenticated DOC CGH Travel Request User + Given I am an authenticated DOC CGH Travel Request User "Dimetria Branch" When I am on the "Travel Planning System" form Then I verify the first four questions on the form under "Travel Questions" section And the first question "Do you have a defined role at the meeting/conference or intended for professional development?" is optional @@ -30,19 +30,33 @@ Feature: SNOWTRAVEL Portal Form Scenarios @SNOWTRAVEL-125 @Chaudhryma @Smoke @Regression @playwright Scenario: Test 2: CGH Field Enhancements on Travel Request Form - Given I am an authenticated DOC CGH Travel Request User + Given I am an authenticated DOC CGH Travel Request User "Dimetria Branch" When I am on the "Travel Planning System" form Then I will not see the following help text language under the field "Destination Type" under the "Event" section:"Local needs to be submitted 2 weeks before event date." @SNOWTRAVEL-125 @Chaudhryma @Regression @playwright Scenario: Test 3: CGH Field Enhancements on Travel Request Form - Given I am an authenticated DOC CGH Travel Request User + Given I am an authenticated DOC CGH Travel Request User "Dimetria Branch" When I am on the "Travel Planning System" form Then I will not see the Header on the form "Travel Cash Advance", And the following fields "Cash (Direct Deposit) Advance Requested" and "Reason for Cash Advance" under Travel Cash Advance section will be removed @SNOWTRAVEL-121 @Chaudhryma @Smoke @Regression @playwright Scenario: Test 2: Travel Request Form invisibility to non-CGH users - Given I am not a CGH user + Given I am not a CGH user "Warren Kibbe" When I log in to the NCI at Your Service Portal, - Then I should not see the Travel Planning System in the catalog item. \ No newline at end of file + Then I should not see the Travel Planning System in the catalog item. + + @SNOWTRAVEL-272 @Chaudhryma @Regression @playwright + Scenario: Test Update "Event Type" Field to be Required + Given I am a CGH User "Ann Chao" who is Completing a Travel Planning Request form, + When I navigate to the field "Event Type", + Then I will see that the field is now required, + And I will not be able to submit the form without completing this field. + + @SNOWTRAVEL-182 @Chaudhryma @Regression @playwright + Scenario: Test 1: For CGH Make the "URL of Registration Site" field required if "Registration Fees?" is YES + Given I am a CGH User "Ann Chao" + And I am Completing a Travel Planning Request form, + When "Yes" is selected for the "Registration Fees?" field, + Then the "URL of Registration Site" field will be required. \ No newline at end of file diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java index 4f3d62fa5..3ca731a94 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java @@ -85,6 +85,17 @@ public static void i_navigate_to_the_trip_information_section_of_the_form() { page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); page.getByLabel("Show Calendar for Event End").click(); page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + + CucumberLogUtils.scenario.log("---- EVENT TYPE IS NOW A REQUIRED FIELD ----"); + page.locator("#sp_grp_checkbox_event_type_label").scrollIntoViewIfNeeded(); + assertThat(page.locator("#sp_grp_checkbox_event_type_label")).containsText("Event Type"); + assertThat(page.getByRole(AriaRole.GROUP, new Page.GetByRoleOptions().setName("Mandatory Event Type")).getByLabel("Mandatory")).isVisible(); + page.getByLabel("Event", new Page.GetByLabelOptions().setExact(true)).getByText("Event Type").click(); + page.locator("#advisory_board").isVisible(); + page.getByText("Advisory Board").click(); + + CucumberLogUtils.scenario.log("---- REGISTRATION FEE -- A REQUIRED FIELD ----"); + page.locator("#registration_fees").scrollIntoViewIfNeeded(); assertThat(page.locator("#registration_fees")).containsText(Travel_Request_Portal_Form_Constants.REGISTRATION_FEES_FIELD_TEXT); CommonUtils.sleep(2000); page.getByRole(AriaRole.GROUP, new Page.GetByRoleOptions().setName("Registration Fee").setExact(true)).locator("a").click(); @@ -158,7 +169,7 @@ public static void the_field_will_map_to_the_travel_start_date_field_in_the_vari page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Travel Requests")).click(); CucumberLogUtils.playwrightScreenshot(page); - //click on the most top record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE MOST TOP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("(//*[@class='list_decoration_cell col-small col-center ']//a)[1]").hover(); page.frameLocator("iframe[name=\"gsft_main\"]").locator("(//*[@class='list_decoration_cell col-small col-center ']//a)[1]").click(); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java index 267851b8a..29525a414 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java @@ -35,14 +35,16 @@ public void that_i_am_logged_into_service_now_native_view() { */ @When("I search for Group under System Security") public void i_search_for_group_under_system_security() { - //Search the System Security in Filter navigation Native View + + CucumberLogUtils.scenario.log("---- SEARCH THE SYSTEM SECURITY IN FILTER NAVIGATION NATIVE VIEW ----"); page.getByPlaceholder("Filter").click(); page.getByPlaceholder("Filter").fill("System Security"); page.getByPlaceholder("Filter").press("Enter"); assertThat(page.getByPlaceholder("Filter")).isVisible(); assertThat(page.getByPlaceholder("Filter")).hasValue("System Security"); CucumberLogUtils.playwrightScreenshot(page); - //Look for the Groups under "Users and Groups" and click on Groups + + CucumberLogUtils.scenario.log("---- LOOK FOR THE GROUPS UNDER \"USERS AND GROUPS\" AND CLICK ON GROUPS ----"); assertThat(page.locator("li").filter(new Locator.FilterOptions().setHasText("Users and GroupsUsersEdit"))).isVisible(); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Groups").setExact(true)).click(); CucumberLogUtils.playwrightScreenshot(page); @@ -55,7 +57,8 @@ public void i_search_for_group_under_system_security() { */ @When("I search for {string} group Name") public void i_search_for_group_name(String nciCGHTravelRequestBranchDirectors) { - //Search for the "NCI CGH - Travel Request Branch Directors" group and open the group record + + CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"NCI CGH - TRAVEL REQUEST BRANCH DIRECTORS\" GROUP AND OPEN THE GROUP RECORD ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); @@ -66,7 +69,7 @@ public void i_search_for_group_name(String nciCGHTravelRequestBranchDirectors) { assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestBranchDirectors); CucumberLogUtils.playwrightScreenshot(page); - //click on the group record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE MOST TOP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Branch Directors']").click(); CucumberLogUtils.playwrightScreenshot(page); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); @@ -83,7 +86,8 @@ public void i_search_for_group_name(String nciCGHTravelRequestBranchDirectors) { */ @When("I verify the associated users {string}, {string} and {string} are listed under the Group Members tab") public void i_verify_the_associated_users_and_are_listed_under_the_group_members_tab(String dimetriaBranch, String kalinaDuncan, String markParascandola) { - //clicks on Group members Tab on the bottom of the page and verify group members + + CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Branch Directors"); @@ -101,7 +105,8 @@ public void i_verify_the_associated_users_and_are_listed_under_the_group_members */ @When("I go back to Groups and search for {string} group Name") public void i_go_back_to_groups_and_search_for_group_name(String nciCGHTravelRequestTravelPlanners) { - //Go back to Groups page and search for the "NCI CGH - Travel Request Travel Planners" group and open the group record + + CucumberLogUtils.scenario.log("---- GO BACK TO GROUPS PAGE AND SEARCH FOR THE \"NCI CGH - TRAVEL REQUEST TRAVEL PLANNERS\" GROUP AND OPEN THE GROUP RECORD ----"); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Back").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); @@ -113,7 +118,7 @@ public void i_go_back_to_groups_and_search_for_group_name(String nciCGHTravelReq assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestTravelPlanners); CucumberLogUtils.playwrightScreenshot(page); - //click on the record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE MOST TOP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Travel Planners']").click(); CucumberLogUtils.playwrightScreenshot(page); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); @@ -133,7 +138,8 @@ public void i_go_back_to_groups_and_search_for_group_name(String nciCGHTravelReq */ @When("I verify that the associated users {string}, {string}, {string} , {string}, {string} and {string} are listed under the Group Members tab") public void i_verify_that_the_associated_users_and_are_listed_under_the_group_members_tab(String brianDavis, String dimetriaBranch, String jenniferBridges, String karenGrady, String ravenCoit, String susanGiuliani) { - //clicks on Group members Tab on the bottom of the page and verify group members + + CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)")).isVisible(); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (6)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Travel Planners"); @@ -154,7 +160,8 @@ public void i_verify_that_the_associated_users_and_are_listed_under_the_group_me */ @When("I go back again and search for {string} group Name") public void i_go_back_again_and_search_for_group_name(String nciCGHTravelRequestProxyUsers) { - //Go back to Groups page and search for the "NCI CGH - Travel Request Proxy users" group and open the group record + + CucumberLogUtils.scenario.log("---- GO BACK TO GROUPS PAGE AND SEARCH FOR THE \"NCI CGH - TRAVEL REQUEST PROXY USERS\" GROUP AND OPEN THE GROUP RECORD ----"); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Back").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); @@ -166,7 +173,7 @@ public void i_go_back_again_and_search_for_group_name(String nciCGHTravelRequest assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestProxyUsers); CucumberLogUtils.playwrightScreenshot(page); - //click on the record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Proxy users']").click(); CucumberLogUtils.playwrightScreenshot(page); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); @@ -183,7 +190,8 @@ public void i_go_back_again_and_search_for_group_name(String nciCGHTravelRequest */ @Then("I verify that the associated users {string}, {string} and {string} should be listed under the Group Members tab") public void i_verify_that_the_associated_users_and_should_be_listed_under_the_group_members_tab(String dimetriaBranch, String kalinaDuncan, String markParascandola) { - //clicks on Group members Tab on the bottom of the page and verify group members + + CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Proxy users"); @@ -200,7 +208,8 @@ public void i_verify_that_the_associated_users_and_should_be_listed_under_the_gr */ @When("I search for {string} Group under System Security") public void i_search_for_group_under_system_security(String nciCGHTravelManagers) { - //Search the System Security in Filter navigation Native View + + CucumberLogUtils.scenario.log("---- SEARCH THE SYSTEM SECURITY IN FILTER NAVIGATION NATIVE VIEW ----"); page.getByPlaceholder("Filter").click(); page.getByPlaceholder("Filter").fill("System Security"); page.getByPlaceholder("Filter").press("Enter"); @@ -208,12 +217,12 @@ public void i_search_for_group_under_system_security(String nciCGHTravelManagers assertThat(page.getByPlaceholder("Filter")).hasValue("System Security"); CucumberLogUtils.playwrightScreenshot(page); - //Look for the Groups under "Users and Groups" and click on Groups + CucumberLogUtils.scenario.log("---- LOOK FOR THE GROUPS UNDER \"USERS AND GROUPS\" AND CLICK ON GROUPS ----"); assertThat(page.locator("li").filter(new Locator.FilterOptions().setHasText("Users and GroupsUsersEdit"))).isVisible(); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Groups").setExact(true)).click(); CucumberLogUtils.playwrightScreenshot(page); - //Search for the "NCI CGH - Travel Manager" group and open the group record + CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"NCI CGH - TRAVEL MANAGER\" GROUP AND OPEN THE GROUP RECORD ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); @@ -224,7 +233,7 @@ public void i_search_for_group_under_system_security(String nciCGHTravelManagers assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelManagers); CucumberLogUtils.playwrightScreenshot(page); - //click on the group record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE GROUP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Managers']").click(); CucumberLogUtils.playwrightScreenshot(page); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); @@ -239,7 +248,8 @@ public void i_search_for_group_under_system_security(String nciCGHTravelManagers */ @Then("I verify that {string} should be listed under the Group Member tab") public void i_verify_that_should_be_listed_under_the_group_member_tab(String dimetriaBranch) { - //clicks on Group members Tab on the bottom of the page and verify group members + + CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (1)")).isVisible(); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (1)").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (1)Show").locator("b")).containsText("Group = NCI CGH - Travel Managers"); @@ -254,7 +264,8 @@ public void i_verify_that_should_be_listed_under_the_group_member_tab(String dim */ @When("I search for the {string} Groups under System Security") public void i_search_for_the_groups_under_system_security(String nciCGHTravelRequestBranchDirectors) { - //Search the System Security in Filter navigation Native View + + CucumberLogUtils.scenario.log("---- SEARCH THE SYSTEM SECURITY IN FILTER NAVIGATION NATIVE VIEW ----"); page.getByPlaceholder("Filter").click(); page.getByPlaceholder("Filter").fill("System Security"); page.getByPlaceholder("Filter").press("Enter"); @@ -262,12 +273,12 @@ public void i_search_for_the_groups_under_system_security(String nciCGHTravelReq assertThat(page.getByPlaceholder("Filter")).hasValue("System Security"); CucumberLogUtils.playwrightScreenshot(page); - //Look for the Groups under "Users and Groups" and click on Groups + CucumberLogUtils.scenario.log("---- LOOK FOR THE GROUPS UNDER \"USERS AND GROUPS\" AND CLICK ON GROUPS ----"); assertThat(page.locator("li").filter(new Locator.FilterOptions().setHasText("Users and GroupsUsersEdit"))).isVisible(); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Groups").setExact(true)).click(); CucumberLogUtils.playwrightScreenshot(page); - //Search for the ""NCI CGH - Travel Request Branch Directors" group and open the group record + CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"\"NCI CGH - TRAVEL REQUEST BRANCH DIRECTORS\" GROUP AND OPEN THE GROUP RECORD ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); @@ -278,7 +289,7 @@ public void i_search_for_the_groups_under_system_security(String nciCGHTravelReq assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestBranchDirectors); CucumberLogUtils.playwrightScreenshot(page); - //click on the group record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE GROUP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Branch Directors']").click(); CucumberLogUtils.playwrightScreenshot(page); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); @@ -293,7 +304,8 @@ public void i_search_for_the_groups_under_system_security(String nciCGHTravelReq */ @Then("I will see user {string} added to the CGH Branch Director Assignment Group.") public void i_will_see_user_added_to_the_cgh_branch_director_assignment_group(String dimetriaBranch) { - //clicks on Group members Tab on the bottom of the page and verify that Dimetria Branch is also added to the group + + CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY THAT DIMETRIA BRANCH IS ALSO ADDED TO THE GROUP ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Branch Directors"); @@ -308,7 +320,8 @@ public void i_will_see_user_added_to_the_cgh_branch_director_assignment_group(St */ @When("I search for {string} Groups under System Security:") public void i_search_for_groups_under_system_security(String nciCGHTravelRequestTravelPlanners) { - //Search the System Security in Filter navigation Native View + + CucumberLogUtils.scenario.log("---- SEARCH THE SYSTEM SECURITY IN FILTER NAVIGATION NATIVE VIEW ----"); page.getByPlaceholder("Filter").click(); page.getByPlaceholder("Filter").fill("System Security"); page.getByPlaceholder("Filter").press("Enter"); @@ -316,12 +329,12 @@ public void i_search_for_groups_under_system_security(String nciCGHTravelRequest assertThat(page.getByPlaceholder("Filter")).hasValue("System Security"); CucumberLogUtils.playwrightScreenshot(page); - //Look for the Groups under "Users and Groups" and click on Groups + CucumberLogUtils.scenario.log("---- LOOK FOR THE GROUPS UNDER \"USERS AND GROUPS\" AND CLICK ON GROUPS ----"); assertThat(page.locator("li").filter(new Locator.FilterOptions().setHasText("Users and GroupsUsersEdit"))).isVisible(); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Groups").setExact(true)).click(); CucumberLogUtils.playwrightScreenshot(page); - //Search for the ""NCI CGH - Travel Request Travel Planners" group and open the group record + CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"\"NCI CGH - TRAVEL REQUEST BRANCH DIRECTORS\" GROUP AND OPEN THE GROUP RECORD ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); @@ -332,7 +345,7 @@ public void i_search_for_groups_under_system_security(String nciCGHTravelRequest assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestTravelPlanners); CucumberLogUtils.playwrightScreenshot(page); - //click on the group record and click on open record button + CucumberLogUtils.scenario.log("---- CLICK ON THE GROUP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Travel Planners']").click(); CucumberLogUtils.playwrightScreenshot(page); page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); @@ -347,7 +360,8 @@ public void i_search_for_groups_under_system_security(String nciCGHTravelRequest */ @Then("I will see user {string} added to the CGH Travel Planners Assignment Group.") public void i_will_see_user_added_to_the_cgh_travel_planners_assignment_group(String karenGrady) { - //clicks on Group members Tab on the bottom of the page and verify that Karen Grady is also added to the group + + CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY THAT KAREN GRADY IS ALSO ADDED TO THE GROUP ----"); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)")).isVisible(); page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)").click(); assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (6)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Travel Planners"); diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_Portal_Form_Steps.java b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_Portal_Form_Steps.java index 5c7a21143..1bb0f320c 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_Portal_Form_Steps.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_Portal_Form_Steps.java @@ -1,5 +1,6 @@ package ServiceNow.PlatformBusinessApps.SNOW_TRAVEL.playwright.Steps; +import ServiceNow.PlatformBusinessApps.SNOW_TRAVEL.playwright.Constants.Travel_Request_Portal_Form_Constants; import ServiceNow.PlatformBusinessApps.SNOW_TRAVEL.playwright.StepImpl.Travel_Request_Portal_Form_StepImpl; import appsCommon.PlaywrightUtils.Playwright_ServiceNow_Common_Methods; import com.microsoft.playwright.Locator; @@ -11,6 +12,7 @@ import io.cucumber.java.en.Given; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; +import java.util.regex.Pattern; import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat; import static com.nci.automation.web.PlaywrightUtils.page; @@ -41,9 +43,9 @@ public void i_will_see_the_current_form_updated_to(String travelRequest, String Travel_Request_Portal_Form_StepImpl.i_will_see_the_current_form_updated_to(travelRequest, travelPlanningSystem); } - @Given("I am an authenticated DOC CGH Travel Request User") - public void i_am_an_authenticated_doc_cgh_travel_request_user() { - Playwright_ServiceNow_Common_Methods.side_Door_Test_Account_Login_Impersonate("Dimetria Branch"); + @Given("I am an authenticated DOC CGH Travel Request User {string}") + public void i_am_an_authenticated_doc_cgh_travel_request_user(String cghUserDimetria) { + Playwright_ServiceNow_Common_Methods.side_Door_Test_Account_Login_Impersonate(cghUserDimetria); } @When("I navigate to the Trip Information section of the form,") @@ -121,9 +123,9 @@ public void the_following_fields_and_under_travel_cash_advance_section_will_be_r * * The method impersonates a non-CGH user by logging in with a test account using the Playwright_ServiceNow_Common_Methods class. */ - @Given("I am not a CGH user") - public void i_am_not_a_cgh_user() { - Playwright_ServiceNow_Common_Methods.side_Door_Test_Account_Login_Impersonate("Warren Kibbe"); + @Given("I am not a CGH user {string}") + public void i_am_not_a_cgh_user(String nonCGHUser) { + Playwright_ServiceNow_Common_Methods.side_Door_Test_Account_Login_Impersonate(nonCGHUser); } /** @@ -147,14 +149,247 @@ public void i_should_not_see_the_travel_planning_system_in_the_catalog_item() { page.locator("//a[@class='level-2-link ng-binding dropdown-toggle dropdown'][normalize-space()='CBIIT Business Services']").isHidden(); CucumberLogUtils.playwrightScreenshot(page); - //Travel Planning System Request do not exist in the catalogue item for non-CGH user + CucumberLogUtils.scenario.log("---- TRAVEL PLANNING SYSTEM REQUEST DO NOT EXIST IN THE CATALOGUE ITEM FOR NON-CGH USER ----"); assertThat(page.getByRole(AriaRole.MAIN).locator("a").filter(new Locator.FilterOptions().setHasText("Travel Planning System"))).isHidden(); CucumberLogUtils.playwrightScreenshot(page); - //inserted the Travel Planning System URL for Non-CGH user and verified that user do not have access to Travel Planning System Request + CucumberLogUtils.scenario.log("---- INSERTED THE TRAVEL PLANNING SYSTEM URL FOR NON-CGH USER AND VERIFIED THAT USER DO NOT HAVE ACCESS TO TRAVEL PLANNING SYSTEM REQUEST ----"); page.navigate("https://service-test.nci.nih.gov/ncisp?id=nci_sc_cat_item&sys_id=b246963e1b2a7d50344042e2b24bcb64"); assertThat(page.getByRole(AriaRole.MAIN)).containsText("You are either not authorized to view this content or the record is not valid."); CucumberLogUtils.playwrightScreenshot(page); - CommonUtils.sleep(6000); + } + + /** + * Completes a travel planning request form as a CGH User. + */ + @Given("I am a CGH User {string} who is Completing a Travel Planning Request form,") + public void i_am_a_cgh_user_who_is_completing_a_travel_planning_request_form(String cghUserAnn) { + Playwright_ServiceNow_Common_Methods.side_Door_Test_Account_Login_Impersonate(cghUserAnn); + page.navigate(Travel_Request_Portal_Form_Constants.TRAVEL_PLANNING_SYSTEM_PORTAL_FORM_URL); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- TRAVELER ACCOMODATIONs -- A REQUIRED FIELD ----"); + page.waitForSelector("#traveler_accomodations"); + assertThat(page.locator("#traveler_accomodations")).containsText(Travel_Request_Portal_Form_Constants.TRAVELER_ACCOMODATIONS_FIELD_TEXT); + page.locator("#s2id_sp_formfield_traveler_accomodations a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName(Travel_Request_Portal_Form_Constants.REQUESTING_BUSINESS_CLASS_SELECTED_DROP_DOWN_OPTION)).click(); + + CucumberLogUtils.scenario.log("---- DESTINATION TYPE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#sp_grp_checkbox_destination_type")).containsText(Travel_Request_Portal_Form_Constants.DESTINATION_TYPE_FIELD_TEXT); + page.getByText("Local", new Page.GetByTextOptions().setExact(true)).click(); + + CucumberLogUtils.scenario.log("---- IS THIS MEETING/EVENT HYBRID? -- A REQUIRED FIELD ----"); + assertThat(page.locator("#is_event_hybrid")).containsText(Travel_Request_Portal_Form_Constants.IS_THIS_MEETING_OR_EVENT_HYBRID_FIELD_TEXT); + page.getByLabel("Event", new Page.GetByLabelOptions().setExact(true)).locator("a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName("Yes")).click(); + + CucumberLogUtils.scenario.log("---- NAME OF EVENT -- A REQUIRED FIELD ----"); + assertThat(page.locator("#event_name")).containsText(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_TEXT); + page.getByLabel(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_TEXT).click(); + page.getByLabel(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_TEXT).fill(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_ENTERED_VALUE); + + CucumberLogUtils.scenario.log("---- EVENT START DATE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#event_start_date")).containsText(Travel_Request_Portal_Form_Constants.EVENT_START_DATE_FIELD_TEXT); + page.getByLabel("Show Calendar for Event Start").click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + + CucumberLogUtils.scenario.log("---- EVENT END DATE -- A REQUIRED FIELD ----"); + page.getByLabel("Show Calendar for Event End").click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + } + + /** + * Navigates to the EVENT TYPE field on the page. + * + * @param eventType The type of event to navigate to + */ + @When("I navigate to the field {string},") + public void i_navigate_to_the_field(String eventType) { + + CucumberLogUtils.scenario.log("---- EVENT TYPE -- A REQUIRED FIELD ----"); + page.locator("#sp_grp_checkbox_event_type_label").scrollIntoViewIfNeeded(); + assertThat(page.locator("#sp_grp_checkbox_event_type_label")).containsText(eventType); + } + + @Then("I will see that the field is now required,") + public void i_will_see_that_the_field_is_now_required() { + + CucumberLogUtils.scenario.log("---- EVENT TYPE IS NOW A REQUIRED FIELD -LEAVE IT UNCHECK FOR THIS TEST CASE ----"); + assertThat(page.getByRole(AriaRole.GROUP, new Page.GetByRoleOptions().setName("Mandatory Event Type")).getByLabel("Mandatory")).isVisible(); + page.getByLabel("Event", new Page.GetByLabelOptions().setExact(true)).getByText("Event Type").click(); + } + + /** + * This method ensures that the form cannot be submitted without completing a Event Type field. + */ + @Then("I will not be able to submit the form without completing this field.") + public void i_will_not_be_able_to_submit_the_form_without_completing_this_field() { + + CucumberLogUtils.scenario.log("---- REGISTRATION FEE -- A REQUIRED FIELD ----"); + page.locator("#registration_fees").scrollIntoViewIfNeeded(); + assertThat(page.locator("#registration_fees")).containsText(Travel_Request_Portal_Form_Constants.REGISTRATION_FEES_FIELD_TEXT); + CommonUtils.sleep(2000); + page.getByRole(AriaRole.GROUP, new Page.GetByRoleOptions().setName("Registration Fee").setExact(true)).locator("a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName("No").setExact(true)).click(); + CucumberLogUtils.playwrightScreenshot(page); + page.locator("#trip_information").scrollIntoViewIfNeeded(); + assertThat(page.locator("#trip_information")).containsText(Travel_Request_Portal_Form_Constants.TRIP_INFORMATION_HEADER_TEXT); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- TRAVEL START DATE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#travel_start_date").getByLabel("Required")).isVisible(); + page.locator("#travel_start_date").getByText("Travel Start Date").click(); + assertThat(page.locator("#travel_start_date")).containsText("Travel Start Date"); + page.getByLabel("Show Calendar for Travel Start Date").click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- TRAVEL END DATE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#travel_end_date").getByLabel("Required")).isVisible(); + assertThat(page.locator("#travel_end_date")).containsText("Travel End Date"); + page.getByLabel("Show Calendar for Travel End").click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + + CucumberLogUtils.scenario.log("---- SELECT THE TRANSPORTATION MODE -- A REQUIRED FIELD ----"); + page.locator("span").filter(new Locator.FilterOptions().setHasText(Pattern.compile("^Select the Transportation Mode$"))).scrollIntoViewIfNeeded(); + assertThat(page.locator("#select_the_transportation_mode")).containsText(Travel_Request_Portal_Form_Constants.SELECT_THE_TRANSPORTATION_MODE_TEXT); + page.getByLabel("Travel Expenses").locator("a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName(Travel_Request_Portal_Form_Constants.SELECT_THE_TRANSPORTATION_MODE_DROP_DOWN_SELECTED_AIR)).click(); + page.getByLabel(Travel_Request_Portal_Form_Constants.ENTER_THE_ESTIMATED_COST_FIELD_TEXT).click(); + page.getByLabel(Travel_Request_Portal_Form_Constants.ENTER_THE_ESTIMATED_COST_FIELD_TEXT).fill(Travel_Request_Portal_Form_Constants.ENTER_THE_ESTIMATED_COST_FIELD_VALUE_ENTERED); + page.getByText("Transportation Mode & Estimated CostSelect the Transportation Mode Air Select").click(); + assertThat(page.getByLabel("Read only - Sum of All Costs")).containsText(Travel_Request_Portal_Form_Constants.SUM_OF_ALL_COSTS_ENTERED_FIELD_TEXT); + page.waitForSelector("#total_costs div"); + page.locator("#total_costs div").filter(new Locator.FilterOptions().setHasText(Travel_Request_Portal_Form_Constants.TOTAL_COSTS_FIELD_TEXT)).isVisible(); + page.locator("#total_costs div").filter(new Locator.FilterOptions().setHasText(Travel_Request_Portal_Form_Constants.TOTAL_COSTS_FIELD_TEXT)).click(); + assertThat(page.getByLabel("Sum of All Costs Entered", new Page.GetByLabelOptions().setExact(true))).hasValue("$100.00"); + page.locator("//span[normalize-space()='Comments']").scrollIntoViewIfNeeded(); + assertThat(page.getByText("Comments")).isVisible(); + page.getByLabel("Comments").click(); + page.getByLabel("Comments").fill("Test Comments"); + + CucumberLogUtils.scenario.log("---- SUBMIT BUTTON ----"); + page.locator("//button[contains(@class,'btn btn-primary ng-binding ng-scope')]").isVisible(); + page.locator("//button[contains(@class,'btn btn-primary ng-binding ng-scope')]").click(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- A REQUIRED FIELD 'EVENT TYPE 'IS NOT COMPLETED TO SUBMIT THE FORM ----"); + page.getByText("Please provide a value for these needed fields: Event Type").click(); + assertThat(page.locator("#catItemTop")).containsText("Please provide a value for these needed fields: Event Type"); + assertThat(page.getByText("Event Type").nth(2)).isVisible(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- VERIFY THAT ERROR IS OCCURED AND THE REQUEST FORM IS NOT SUBMITTED ----"); + page.locator("#uiNotificationContainer").scrollIntoViewIfNeeded(); + assertThat(page.locator("#uiNotificationContainer")).containsText("Error Some fields are incomplete: Event Type"); + assertThat(page.getByText("Error Some fields are")).isVisible(); + CucumberLogUtils.playwrightScreenshot(page); + } + + /** + * Sets up the test scenario for a CGH User. + * + * @param cghUserAnn The identifier for the CGH User. + */ + @Given("I am a CGH User {string}") + public void i_am_a_cgh_user(String cghUserAnn) { + Playwright_ServiceNow_Common_Methods.side_Door_Test_Account_Login_Impersonate(cghUserAnn); + } + + /** + * Navigates to the travel planning request form URL and fill the form by required fields + */ + @Given("I am Completing a Travel Planning Request form,") + public void i_am_completing_a_travel_planning_request_form() { + page.navigate(Travel_Request_Portal_Form_Constants.TRAVEL_PLANNING_SYSTEM_PORTAL_FORM_URL); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- TRAVELER ACCOMODATIONS -- A REQUIRED FIELD ----"); + page.waitForSelector("#traveler_accomodations"); + assertThat(page.locator("#traveler_accomodations")).containsText(Travel_Request_Portal_Form_Constants.TRAVELER_ACCOMODATIONS_FIELD_TEXT); + page.locator("#s2id_sp_formfield_traveler_accomodations a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName(Travel_Request_Portal_Form_Constants.REQUESTING_BUSINESS_CLASS_SELECTED_DROP_DOWN_OPTION)).click(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- DESTINATION TYPE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#sp_grp_checkbox_destination_type")).containsText(Travel_Request_Portal_Form_Constants.DESTINATION_TYPE_FIELD_TEXT); + page.getByText("Local", new Page.GetByTextOptions().setExact(true)).click(); + + CucumberLogUtils.scenario.log("---- IS THIS MEETING/EVENT HYBRID? -- A REQUIRED FIELD ----"); + assertThat(page.locator("#is_event_hybrid")).containsText(Travel_Request_Portal_Form_Constants.IS_THIS_MEETING_OR_EVENT_HYBRID_FIELD_TEXT); + page.getByLabel("Event", new Page.GetByLabelOptions().setExact(true)).locator("a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName("Yes")).click(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- NAME OF EVENT -- A REQUIRED FIELD ----"); + assertThat(page.locator("#event_name")).containsText(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_TEXT); + page.getByLabel(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_TEXT).click(); + page.getByLabel(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_TEXT).fill(Travel_Request_Portal_Form_Constants.NAME_OF_EVENT_FIELD_ENTERED_VALUE); + + CucumberLogUtils.scenario.log("---- EVENT START DATE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#event_start_date")).containsText(Travel_Request_Portal_Form_Constants.EVENT_START_DATE_FIELD_TEXT); + page.getByLabel("Show Calendar for Event Start").click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + + CucumberLogUtils.scenario.log("---- EVENT END DATE -- A REQUIRED FIELD ----"); + page.getByLabel("Show Calendar for Event End").click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("OK").setExact(true)).click(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- EVENT TYPE -- A REQUIRED FIELD ----"); + page.locator("#sp_grp_checkbox_event_type_label").scrollIntoViewIfNeeded(); + assertThat(page.locator("#sp_grp_checkbox_event_type_label")).containsText("Event Type"); + assertThat(page.getByRole(AriaRole.GROUP, new Page.GetByRoleOptions().setName("Mandatory Event Type")).getByLabel("Mandatory")).isVisible(); + page.getByLabel("Event", new Page.GetByLabelOptions().setExact(true)).getByText("Event Type").click(); + page.locator("#advisory_board").isVisible(); + page.getByText("Advisory Board").click(); + CucumberLogUtils.playwrightScreenshot(page); + } + + /** + * Verify and select '' Yes' for the 'Registration Fees?' field on the page. + * + * @param yes The value to be selected for the field + * @param RegistrationFeeField The field identifier to be interacted with + */ + @When("{string} is selected for the {string} field,") + public void is_selected_for_the_field(String yes, String RegistrationFeeField) { + + CucumberLogUtils.scenario.log("---- REGISTRATION FEES? -- A REQUIRED FIELD ----"); + page.locator("#registration_fees").scrollIntoViewIfNeeded(); + assertThat(page.locator("#registration_fees")).containsText(RegistrationFeeField); + page.getByRole(AriaRole.GROUP, new Page.GetByRoleOptions().setName("Registration Fee").setExact(true)).locator("a").click(); + page.getByRole(AriaRole.OPTION, new Page.GetByRoleOptions().setName(yes)).click(); + CucumberLogUtils.playwrightScreenshot(page); + + CucumberLogUtils.scenario.log("---- TYPE OF REGISTRATION RATE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#type_of_registration_rate")).containsText("Type of Registration Rate"); + page.getByText("Early Bird").click(); + + CucumberLogUtils.scenario.log("---- REGISTRATION FEE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#registration_fee")).containsText("Registration Fee"); + page.getByRole(AriaRole.TEXTBOX, new Page.GetByRoleOptions().setName("Registration Fee").setExact(true)).click(); + page.getByRole(AriaRole.TEXTBOX, new Page.GetByRoleOptions().setName("Registration Fee").setExact(true)).fill("12"); + + CucumberLogUtils.scenario.log("---- REGISTRATION FEE DUE DATE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#registration_fee_due_date")).containsText("Registration Fee Due Date"); + page.getByLabel("Registration Fee Due Date", new Page.GetByLabelOptions().setExact(true)).click(); + page.getByLabel("Registration Fee Due Date", new Page.GetByLabelOptions().setExact(true)).fill("12/01/2024"); + page.getByLabel("Registration Fee Due Date", new Page.GetByLabelOptions().setExact(true)).press("Enter"); + CucumberLogUtils.playwrightScreenshot(page); + } + + /** + * The 'URL of Registration Site' field will be required when 'Yes' is selected for Registration Fees field. + * + * @param urlOfRegistrationSite The URL of the registration site to be checked as required + */ + @Then("the {string} field will be required.") + public void the_field_will_be_required(String urlOfRegistrationSite) { + + CucumberLogUtils.scenario.log("---- URL OF REGISTRATION SITE -- A REQUIRED FIELD ----"); + assertThat(page.locator("#url_of_registration_site")).containsText(urlOfRegistrationSite); + assertThat(page.locator("#url_of_registration_site").getByLabel("Required")).isVisible(); + CucumberLogUtils.playwrightScreenshot(page); } } \ No newline at end of file From e33bd73679d22557f241fcbdc3f126ac6be638b1 Mon Sep 17 00:00:00 2001 From: mariachaudhry Date: Fri, 15 Nov 2024 11:35:39 -0500 Subject: [PATCH 2/2] .. --- .../Steps/OCPL_Training_Request_Steps.java | 26 +-- .../Features/Travel_Request_NV.feature | 2 +- .../StepImpl/Travel_Request_NV_StepImpl.java | 4 +- .../Travel_Request_Portal_Form_StepImpl.java | 20 +- .../Steps/Travel_Request_NV_Steps.java | 190 +++++++++--------- 5 files changed, 121 insertions(+), 121 deletions(-) diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java index 7f258a390..5ef9af18a 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/OCPL_Training/Steps/OCPL_Training_Request_Steps.java @@ -180,18 +180,18 @@ public void verify_the_response_in_the_body_of_email_in_the_system_log_emails(St page.getByPlaceholder("Filter").press("Enter"); assertThat(page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Emails"))).isVisible(); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Emails")).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search a specific field of").selectOption("subject"); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(ocplTrainingRequest); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Emails.").locator("tbody")).containsText(ocplTrainingRequest); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("(//a[@aria-label='Preview record: OCPL Training Request'])[1]").click(); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[normalize-space()='Open Record']").isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[normalize-space()='Open Record']").click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Preview Email")).scrollIntoViewIfNeeded(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Preview Email"))).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("(//a[normalize-space()='Preview Email'])").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").frameLocator("iframe[title=\"Preview Email\"]").getByRole(AriaRole.PARAGRAPH)).containsText("Are you requesting Compensatory Time for Travel (CTT) during this training? = Yes"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").frameLocator("iframe[title=\"Preview Email\"]").getByRole(AriaRole.PARAGRAPH)).containsText("Are you requesting Comp Time (CT) during this training? = No"); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search a specific field of").selectOption("subject"); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(ocplTrainingRequest); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Emails.").locator("tbody")).containsText(ocplTrainingRequest); + page.frameLocator("iframe[name='gsft_main']").locator("(//a[@aria-label='Preview record: OCPL Training Request'])[1]").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[normalize-space()='Open Record']").isVisible(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[normalize-space()='Open Record']").click(); + page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Preview Email")).scrollIntoViewIfNeeded(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Preview Email"))).isVisible(); + page.frameLocator("iframe[name='gsft_main']").locator("(//a[normalize-space()='Preview Email'])").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").frameLocator("iframe[title=\"Preview Email\"]").getByRole(AriaRole.PARAGRAPH)).containsText("Are you requesting Compensatory Time for Travel (CTT) during this training? = Yes"); + assertThat(page.frameLocator("iframe[name='gsft_main']").frameLocator("iframe[title=\"Preview Email\"]").getByRole(AriaRole.PARAGRAPH)).containsText("Are you requesting Comp Time (CT) during this training? = No"); } } \ No newline at end of file diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_NV.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_NV.feature index effe9eb3b..24c9f4f4d 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_NV.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Features/Travel_Request_NV.feature @@ -3,7 +3,7 @@ Feature: SNOWTRAVEL Native View Form Scenarios @SNOWTRAVEL-124 @Chaudhryma @Smoke @Regression @playwright Scenario: Test Create Travel Request Application Module - Given I am an authenticated DOC CGH Travel Request User + Given I am an authenticated DOC CGH Travel Request User "Dimetria Branch" When I search "Travel Planning System", in the filter navigator, Then I will see Modules created for the "Travel Requests", "Assigned to Me", "Assigned to My Group",and "My Approvals" underneath Travel Planning System Application diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_NV_StepImpl.java b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_NV_StepImpl.java index 3d1af5c86..da8c5bb62 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_NV_StepImpl.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_NV_StepImpl.java @@ -49,8 +49,8 @@ public static void i_will_see_modules_created_for_the_and_underneath_application assertThat(page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName(myApprovals))).isVisible(); assertThat(page.getByRole(AriaRole.LIST)).containsText(myApprovals); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName(myApprovals)).click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName(Travel_Request_NV_Contants.NV_MY_APPROVAL_MODULE_APPROVALS_TEXT))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText(Travel_Request_NV_Contants.NV_MY_APPROVAL_MODULE_APPROVALS_TEXT); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName(Travel_Request_NV_Contants.NV_MY_APPROVAL_MODULE_APPROVALS_TEXT))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText(Travel_Request_NV_Contants.NV_MY_APPROVAL_MODULE_APPROVALS_TEXT); CucumberLogUtils.playwrightScreenshot(page); } } \ No newline at end of file diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java index 3ca731a94..d7f821d07 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/StepImpl/Travel_Request_Portal_Form_StepImpl.java @@ -170,15 +170,15 @@ public static void the_field_will_map_to_the_travel_start_date_field_in_the_vari CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE MOST TOP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("(//*[@class='list_decoration_cell col-small col-center ']//a)[1]").hover(); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("(//*[@class='list_decoration_cell col-small col-center ']//a)[1]").click(); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("(//*[@class='list_decoration_cell col-small col-center ']//a)[1]").hover(); + page.frameLocator("iframe[name='gsft_main']").locator("(//*[@class='list_decoration_cell col-small col-center ']//a)[1]").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("#tabs2_section").getByText(Travel_Request_Portal_Form_Constants.VARIABLES_TAB).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//span[@aria-label='Trip Information']").scrollIntoViewIfNeeded(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Trip Information", new FrameLocator.GetByLabelOptions().setExact(true))).containsText(Travel_Request_Portal_Form_Constants.TRIP_INFORMATION_HEADER_TEXT); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING, new FrameLocator.GetByRoleOptions().setName(travelStartDate))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Variables form section")).containsText(travelStartDate); + page.frameLocator("iframe[name='gsft_main']").locator("#tabs2_section").getByText(Travel_Request_Portal_Form_Constants.VARIABLES_TAB).click(); + page.frameLocator("iframe[name='gsft_main']").locator("//span[@aria-label='Trip Information']").scrollIntoViewIfNeeded(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Trip Information", new FrameLocator.GetByLabelOptions().setExact(true))).containsText(Travel_Request_Portal_Form_Constants.TRIP_INFORMATION_HEADER_TEXT); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING, new FrameLocator.GetByRoleOptions().setName(travelStartDate))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Variables form section")).containsText(travelStartDate); CucumberLogUtils.playwrightScreenshot(page); } @@ -188,8 +188,8 @@ public static void the_field_will_map_to_the_travel_start_date_field_in_the_vari * @param travelEndDate the value entered for the travel end date */ public static void the_field_will_map_to_the_travel_end_date_in_the_variables_section_of_the_ritm_in_nv(String travelEndDate) { - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING, new FrameLocator.GetByRoleOptions().setName(travelEndDate))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Variables form section")).containsText(travelEndDate); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING, new FrameLocator.GetByRoleOptions().setName(travelEndDate))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Variables form section")).containsText(travelEndDate); CucumberLogUtils.playwrightScreenshot(page); } diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java index 29525a414..73946b802 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SNOW_TRAVEL/playwright/Steps/Travel_Request_NV_Steps.java @@ -59,21 +59,21 @@ public void i_search_for_group_under_system_security() { public void i_search_for_group_name(String nciCGHTravelRequestBranchDirectors) { CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"NCI CGH - TRAVEL REQUEST BRANCH DIRECTORS\" GROUP AND OPEN THE GROUP RECORD ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestBranchDirectors); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestBranchDirectors); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestBranchDirectors); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestBranchDirectors); CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE MOST TOP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Branch Directors']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Branch Directors']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestBranchDirectors); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestBranchDirectors); CucumberLogUtils.playwrightScreenshot(page); } @@ -88,12 +88,12 @@ public void i_search_for_group_name(String nciCGHTravelRequestBranchDirectors) { public void i_verify_the_associated_users_and_are_listed_under_the_group_members_tab(String dimetriaBranch, String kalinaDuncan, String markParascandola) { CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Branch Directors"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(kalinaDuncan); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(markParascandola); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Branch Directors"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(kalinaDuncan); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(markParascandola); CucumberLogUtils.playwrightScreenshot(page); } @@ -107,22 +107,22 @@ public void i_verify_the_associated_users_and_are_listed_under_the_group_members public void i_go_back_to_groups_and_search_for_group_name(String nciCGHTravelRequestTravelPlanners) { CucumberLogUtils.scenario.log("---- GO BACK TO GROUPS PAGE AND SEARCH FOR THE \"NCI CGH - TRAVEL REQUEST TRAVEL PLANNERS\" GROUP AND OPEN THE GROUP RECORD ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Back").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Back").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestTravelPlanners); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestTravelPlanners); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestTravelPlanners); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestTravelPlanners); CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE MOST TOP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Travel Planners']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Travel Planners']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestTravelPlanners); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestTravelPlanners); CucumberLogUtils.playwrightScreenshot(page); } @@ -140,15 +140,15 @@ public void i_go_back_to_groups_and_search_for_group_name(String nciCGHTravelReq public void i_verify_that_the_associated_users_and_are_listed_under_the_group_members_tab(String brianDavis, String dimetriaBranch, String jenniferBridges, String karenGrady, String ravenCoit, String susanGiuliani) { CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)")).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (6)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Travel Planners"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(brianDavis); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(jenniferBridges); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(karenGrady); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(ravenCoit); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(susanGiuliani); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (6)")).isVisible(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (6)").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members (6)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Travel Planners"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(brianDavis); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(jenniferBridges); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(karenGrady); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(ravenCoit); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(susanGiuliani); CucumberLogUtils.playwrightScreenshot(page); } @@ -162,22 +162,22 @@ public void i_verify_that_the_associated_users_and_are_listed_under_the_group_me public void i_go_back_again_and_search_for_group_name(String nciCGHTravelRequestProxyUsers) { CucumberLogUtils.scenario.log("---- GO BACK TO GROUPS PAGE AND SEARCH FOR THE \"NCI CGH - TRAVEL REQUEST PROXY USERS\" GROUP AND OPEN THE GROUP RECORD ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Back").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Back").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestProxyUsers); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestProxyUsers); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestProxyUsers); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestProxyUsers); CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Proxy users']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Proxy users']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestProxyUsers); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestProxyUsers); CucumberLogUtils.playwrightScreenshot(page); } @@ -192,12 +192,12 @@ public void i_go_back_again_and_search_for_group_name(String nciCGHTravelRequest public void i_verify_that_the_associated_users_and_should_be_listed_under_the_group_members_tab(String dimetriaBranch, String kalinaDuncan, String markParascandola) { CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Proxy users"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(kalinaDuncan); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(markParascandola); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Proxy users"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(kalinaDuncan); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(markParascandola); CucumberLogUtils.playwrightScreenshot(page); } @@ -223,21 +223,21 @@ public void i_search_for_group_under_system_security(String nciCGHTravelManagers CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"NCI CGH - TRAVEL MANAGER\" GROUP AND OPEN THE GROUP RECORD ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelManagers); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelManagers); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelManagers); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelManagers); CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE GROUP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Managers']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[@aria-label='Preview record: NCI CGH - Travel Managers']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelManagers); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelManagers); CucumberLogUtils.playwrightScreenshot(page); } @@ -250,10 +250,10 @@ public void i_search_for_group_under_system_security(String nciCGHTravelManagers public void i_verify_that_should_be_listed_under_the_group_member_tab(String dimetriaBranch) { CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY GROUP MEMBERS ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (1)")).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (1)").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (1)Show").locator("b")).containsText("Group = NCI CGH - Travel Managers"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (1)")).isVisible(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (1)").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members (1)Show").locator("b")).containsText("Group = NCI CGH - Travel Managers"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); CucumberLogUtils.playwrightScreenshot(page); } @@ -279,21 +279,21 @@ public void i_search_for_the_groups_under_system_security(String nciCGHTravelReq CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"\"NCI CGH - TRAVEL REQUEST BRANCH DIRECTORS\" GROUP AND OPEN THE GROUP RECORD ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestBranchDirectors); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestBranchDirectors); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestBranchDirectors); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestBranchDirectors); CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE GROUP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Branch Directors']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Branch Directors']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestBranchDirectors); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestBranchDirectors); CucumberLogUtils.playwrightScreenshot(page); } @@ -306,10 +306,10 @@ public void i_search_for_the_groups_under_system_security(String nciCGHTravelReq public void i_will_see_user_added_to_the_cgh_branch_director_assignment_group(String dimetriaBranch) { CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY THAT DIMETRIA BRANCH IS ALSO ADDED TO THE GROUP ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Branch Directors"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (3)")).isVisible(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (3)").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members (3)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Branch Directors"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(dimetriaBranch); CucumberLogUtils.playwrightScreenshot(page); } @@ -335,21 +335,21 @@ public void i_search_for_groups_under_system_security(String nciCGHTravelRequest CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- SEARCH FOR THE \"\"NCI CGH - TRAVEL REQUEST BRANCH DIRECTORS\" GROUP AND OPEN THE GROUP RECORD ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByRole(AriaRole.HEADING)).containsText("Groups"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Groups"))).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByRole(AriaRole.HEADING)).containsText("Groups"); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestTravelPlanners); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).isVisible(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestTravelPlanners); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).click(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).fill(nciCGHTravelRequestTravelPlanners); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Search", new FrameLocator.GetByLabelOptions().setExact(true)).press("Enter"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).isVisible(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Open record: NCI CGH - Travel")).containsText(nciCGHTravelRequestTravelPlanners); CucumberLogUtils.playwrightScreenshot(page); CucumberLogUtils.scenario.log("---- CLICK ON THE GROUP RECORD AND CLICK ON OPEN RECORD BUTTON ----"); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Travel Planners']").click(); + page.frameLocator("iframe[name='gsft_main']").locator("//a[@aria-label='Preview record: NCI CGH - Travel Request Travel Planners']").click(); CucumberLogUtils.playwrightScreenshot(page); - page.frameLocator("iframe[name=\"gsft_main\"]").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestTravelPlanners); + page.frameLocator("iframe[name='gsft_main']").locator("//*[@class='btn btn-sm btn-default pop-over-button pull-right']").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Name", new FrameLocator.GetByLabelOptions().setExact(true))).hasValue(nciCGHTravelRequestTravelPlanners); CucumberLogUtils.playwrightScreenshot(page); } @@ -362,10 +362,10 @@ public void i_search_for_groups_under_system_security(String nciCGHTravelRequest public void i_will_see_user_added_to_the_cgh_travel_planners_assignment_group(String karenGrady) { CucumberLogUtils.scenario.log("---- CLICKS ON GROUP MEMBERS TAB ON THE BOTTOM OF THE PAGE AND VERIFY THAT KAREN GRADY IS ALSO ADDED TO THE GROUP ----"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)")).isVisible(); - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Section Tab Lists").getByText("Group Members (6)").click(); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members (6)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Travel Planners"); - assertThat(page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Group Members.").locator("tbody")).containsText(karenGrady); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (6)")).isVisible(); + page.frameLocator("iframe[name='gsft_main']").getByLabel("Section Tab Lists").getByText("Group Members (6)").click(); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members (6)Show").locator("b")).containsText("Group = NCI CGH - Travel Request Travel Planners"); + assertThat(page.frameLocator("iframe[name='gsft_main']").getByLabel("Group Members.").locator("tbody")).containsText(karenGrady); CucumberLogUtils.playwrightScreenshot(page); } } \ No newline at end of file