diff --git a/pom.xml b/pom.xml index 9981b0bb4..19ad7f5eb 100644 --- a/pom.xml +++ b/pom.xml @@ -233,7 +233,7 @@ com.microsoft.playwright playwright - 1.43.0 + 1.46.0 diff --git a/src/main/resources/conf/env/sandbox.xml b/src/main/resources/conf/env/sandbox.xml index 6780af388..b461ca4bc 100644 --- a/src/main/resources/conf/env/sandbox.xml +++ b/src/main/resources/conf/env/sandbox.xml @@ -235,5 +235,47 @@ + + + https://service-sandbox.nci.nih.gov/side_door.do + + + regular + + + + + + + + + + + + + + + + + https://service-sandbox.nci.nih.gov/nih-ssj.do + + + + regular + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/PlaywrightTests/steps/Example.java b/src/test/java/PlaywrightTests/steps/Example.java deleted file mode 100644 index 68fd6d4dc..000000000 --- a/src/test/java/PlaywrightTests/steps/Example.java +++ /dev/null @@ -1,33 +0,0 @@ -package PlaywrightTests.steps; - -import com.microsoft.playwright.*; -import com.microsoft.playwright.options.*; -import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat; -import java.util.*; - -public class Example { - public static void main(String[] args) { - try (Playwright playwright = Playwright.create()) { - Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions() - .setHeadless(false)); - BrowserContext context = browser.newContext(new Browser.NewContextOptions() - .setViewportSize(1512, 772)); - Page page = context.newPage(); - page.navigate("https://service-test.nci.nih.gov/side_door.do"); - page.getByLabel("User name").click(); - page.getByLabel("User name").fill("CBIITTestAccount"); - page.getByLabel("Password", new Page.GetByLabelOptions().setExact(true)).click(); - page.getByLabel("Password", new Page.GetByLabelOptions().setExact(true)).fill("curlbylawdighalvekinlarswould"); - page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Log in")).click(); - page.navigate("https://service-test.nci.nih.gov/now/nav/ui/classic/params/target/%24pa_dashboard.do"); - assertThat(page.getByLabel("StartNow Implementation", new Page.GetByLabelOptions().setExact(true))).containsText("StartNow Implementation"); - assertThat(page.getByLabel("All menu", new Page.GetByLabelOptions().setExact(true))).containsText("StartNow Homepage"); - page.getByPlaceholder("Filter").click(); - page.getByPlaceholder("Filter").fill("CHARMS"); - page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Dashboard")).click(); - Page page1 = page.waitForPopup(() -> { - page.frameLocator("iframe[name=\"gsft_main\"]").getByLabel("Eligibility Review Needed, Total number of records is:").click(); - }); - } - } -} \ No newline at end of file diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/Applicant Profile.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/Applicant Profile.feature index 5838d68a5..893d5b15c 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/Applicant Profile.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/Applicant Profile.feature @@ -1,7 +1,7 @@ Feature: Applicant Profile Scenarios Description: This Feature file contains Applicant Profile Scenarios - @SSJ-32 @SSJ-33 @SSJ-36 @SSJ-92 @SSJ-98 @JUAREZDS @Regression @playwright + @SSJ-32 @SSJ-33 @SSJ-36 @SSJ-92 @SSJ-98 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario Outline: Verifying the Save application functionality Given a test account "" is reset before executing a test When User is on SSJ Landing page and user is "Maria Chaudhry" - PW @@ -43,7 +43,7 @@ Feature: Applicant Profile Scenarios | SSJTest | Marianna | Mollick | mollickja@nih.gov | 7018211343 | 2123323454 | Masters | Yes | 11 Kolls | 6 | Sausalito | CA | USA | 97712 | | SSJTest | Elena | Andrew | andrewkl@nih.gov | 8233212333 | 2202122234 | Bachelors | Yes | 11 Bells | 39 | Sacramento | CA | USA | 95512 | - @SSJ-32 @SSJ-33 @SSJ-36 @SSJ-92 @SSJ-98 @SSJ-712 @JUAREZDS @Regression @playwright + @SSJ-32 @SSJ-33 @SSJ-36 @SSJ-92 @SSJ-98 @SSJ-712 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario Outline: Verifying the Save application functionality Given a test account "" is reset before executing a test When User is on SSJ Landing page and user is "Maria Chaudhry" - PW @@ -86,23 +86,7 @@ Feature: Applicant Profile Scenarios | firstName | middleName | lastName | email | phone | businessPhone | highestEducation | US Citizenship | address | aptNumber | city | state | country | zip | | SSJTest | Michelle | Pololi | mario@gmail.com | 2018212343 | 2023323454 | Masters | Yes | 7 Mills | 12378 | Reston | VA | USA | 20453 | - @alenan @SSJ-712 @Bug_Open @JUAREZDS @In_Progress @playwright @Smoke - Scenario: Edit Demographics of Profile - Given a test account "SSJTest" is reset before executing a test - When User is on SSJ Landing page and user is "Maria Chaudhry" - PW - When User is on Profile tab - PW - And User clicks Edit for Demographics section - PW - And User chooses to share demographic details - PW - And User edits sex choice - PW - And User edits ethnicity choice - PW - And User edits race choice - PW - And User edits disability choice - PW - And User saves the updated section - PW - And User clicks Edit for Demographics section - PW - And User chooses not to share demographic details - PW - Then User saves the updated section - PW - - @US_APPTRACK-342 @TC_APPTRACK-385 @JUAREZDS @Regression @playwright + @US_APPTRACK-342 @TC_APPTRACK-385 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario Outline: Verifying applicant is able to see "Your Applications" tab and page content after applying to a Vacancy # Given an Okta user "" is on the SSJ home page and logs in - PLEASE LEAVE THIS HERE! NEED TO CONNECT WITH OKTA TEAM When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW @@ -121,7 +105,7 @@ Feature: Applicant Profile Scenarios And clicks "Save" And clicks Save for Mandatory Statements And selects "David Rampulla" for Committee Member with chair role - And selects "Jay Kurani" for Committee Member with Executive Secretary role + And selects "Jason Levine" for Committee Member with Executive Secretary role And clicks "Save" And clicks Save for Email Templates Then user is able to see the Review and Finalize section with the vacancy information submitted @@ -141,7 +125,7 @@ Feature: Applicant Profile Scenarios And verifies Personnel Action Tracking Solution (PATS) Initiator is "Holly Gemar-Griffith" And verifies Mandatory Statements "Equal Opportunity Employment", "Standards of Conduct/Financial Disclosure", "Foreign Education", and "Reasonable Accomodation" are displayed And verifies Committee Member "David Rampulla" is displayed with role "Chair" - And verifies Committee Member "Jay Kurani" is displayed with role "Executive Secretary (non-voting)" + And verifies Committee Member "Jason Levine" is displayed with role "Executive Secretary (non-voting)" And verifies Email Templates "Application saved", "Application submitted confirmation", "Applicant Reference Request", "Applicant Reference Received", "Applicant Reference Received - Applicant" And clicks "Save and Finalize" And clicks "OK" @@ -212,8 +196,8 @@ Feature: Applicant Profile Scenarios And user verifies basic information "", "", "", "", "", "", "", and "" And user verifies address information "
", "", "", "", "" And user verifies demographics information "Yes", "Male", "Hispanic or Latino", "American Indian or Alaska Native, Asian, Black or African-American, Native Hawaiian or other Pacific Islander, White", and "None of the conditions listed above apply to me." - And user verifies references one information "", "", "", "", "", "", "", "" - And user verifies references two information "", "", "", "", "", "", "", "" + And user verifies references one information "", "", "", "", "", "", "" + And user verifies references two information "", "", "", "", "", "", "" And if either a Cover Letter, Qualification Statement, Curriculum Vitae (CV), or Vision Statement (or all) were uploaded then documents are displayed in the Application Documents section And clicks "Submit Application" And clicks "Ok" @@ -229,12 +213,12 @@ Feature: Applicant Profile Scenarios | SSJTest | Michelle | Pololi | mario@gmail.com | 2018212343 | 2023323454 | Masters | Yes | 7 Mills | 12378 | Reston | VA | USA | 20453 | Fred | Trout | Laste | referenceOne@test.com | 7036875816 | Supervisor/Manager | PROJECT MANAGER | TESTING ORGANIZATION FIELD FOR REFERENCE ONE | John | Steven | Vakhutko | referenceTwo@test.com | 7036875816 | Co-worker | TEST AUTOMATION LEAD | TESTING ORGANIZATION FIELD FOR REFERENCE TWO | - @US_APPTRACK-342 @TC_APPTRACK-385 @JUAREZDS @Regression @playwright + @US_APPTRACK-342 @TC_APPTRACK-385 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario: Verifying applicant does not see "Your Applications" tab if applicant has not applied to a Vacancy Given a user who has not applied to a Vacancy before is on the SSJ home page Then Your Applications tab should NOT be displayed - @TC_APPTRACK-145 @JUAREZDS @Regression @playwright + @TC_APPTRACK-145 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario: Verifying Vacancy details When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW And clicks on "Vacancy Dashboard" - PW @@ -252,7 +236,7 @@ Feature: Applicant Profile Scenarios And clicks "Save" And clicks Save for Mandatory Statements And selects "David Rampulla" for Committee Member with chair role - And selects "Jay Kurani" for Committee Member with Executive Secretary role + And selects "Jason Levine" for Committee Member with Executive Secretary role And clicks "Save" And clicks Save for Email Templates Then user is able to see the Review and Finalize section with the vacancy information submitted @@ -287,7 +271,7 @@ Would you like to log in now or go back to the home page? And clicks "Log in" and is redirected to the Okta Login Portal And verifies that the PIV CAC card button text is "Sign in with PIV / CAC card" - @TC_APPTRACK-128 @JUAREZDS @Regression @playwright + @TC_APPTRACK-128 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario Outline: Verification of the Save application functionality Given a test account "SSJTest" is reset before executing a test And a test vacancy "DIEGO TEST" is reset before creating a vacancy @@ -307,7 +291,7 @@ Would you like to log in now or go back to the home page? And clicks "Save" And clicks Save for Mandatory Statements And selects "David Rampulla" for Committee Member with chair role - And selects "Jay Kurani" for Committee Member with Executive Secretary role + And selects "Jason Levine" for Committee Member with Executive Secretary role And clicks "Save" And clicks Save for Email Templates And user is able to see the Review and Finalize section with the vacancy information submitted @@ -355,7 +339,7 @@ Would you like to log in now or go back to the home page? | firstName | middleName | lastName | email | phone | businessPhone | highestEducation | address | aptNumber | city | state | country | zip | | SSJTest | Michelle | Pololi | mario@gmail.com | 2018212343 | 2023323454 | Masters | 7 Mills | 12378 | Reston | VA | USA | 20453 | - @TC_APPTRACK-360 @JUAREZDS @Regression @playwright + @TC_APPTRACK-360 @JUAREZDS @Regression @playwright @SNOW_UPDATED Scenario Outline: Verification of the Save application functionality Given a test account "SSJTest" is reset before executing a test And User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW @@ -374,7 +358,7 @@ Would you like to log in now or go back to the home page? And clicks "Save" And clicks Save for Mandatory Statements And selects "David Rampulla" for Committee Member with chair role - And selects "Jay Kurani" for Committee Member with Executive Secretary role + And selects "Jason Levine" for Committee Member with Executive Secretary role And clicks "Save" And clicks Save for Email Templates And user is able to see the Review and Finalize section with the vacancy information submitted diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/OWM_Vacancy_Manager.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/OWM_Vacancy_Manager.feature index 203da3ac4..46241d58d 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/OWM_Vacancy_Manager.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Features/OWM_Vacancy_Manager.feature @@ -1,7 +1,7 @@ Feature: OWM Vacancy Manager Scenarios Description: This Feature file contains OWM Vacancy Manager Scenarios - @SSJ-7 @SSJ-8 @juarezds @Regression @playwright @Smoke + @SSJ-7 @SSJ-8 @juarezds @Regression @playwright @Smoke @SNOW_UPDATED Scenario: Verification of Basic Vacancy Information section while creating an NCI Vacancy When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW And User navigates to tab "Vacancy Dashboard" - PW @@ -46,7 +46,7 @@ Feature: OWM Vacancy Manager Scenarios And User clicks "Save" button to save the Basic Vacancy Information And User confirms that User is on "Mandatory Statements" section - @SSJ-69 @juarezds @Regression @playwright @Smoke + @SSJ-69 @juarezds @Regression @playwright @Smoke @SNOW_UPDATED Scenario: Verification of Mandatory Statements section while creating an NCI Vacancy When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW And User navigates to tab "Vacancy Dashboard" - PW @@ -78,7 +78,7 @@ Feature: OWM Vacancy Manager Scenarios And User clicks button "Save" - PW Then User confirms that User is on "Vacancy Committee" section - @SSJ-185 @SSJ-306 @juarezds @Regression @playwright + @SSJ-185 @SSJ-306 @juarezds @Regression @playwright @SNOW_UPDATED Scenario: Verification of Vacancy Committee section while creating an NCI Vacancy Positive Flow When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW And User navigates to tab "Vacancy Dashboard" - PW @@ -113,7 +113,7 @@ Feature: OWM Vacancy Manager Scenarios And User clicks button "Save" - PW Then User is directed to "Email Templates" section - @SSJ-11 @Regression @playwright @carberalf + @SSJ-11 @Regression @playwright @carberalf @SNOW_UPDATED Scenario: Verification of Vacancy Committee section while creating an NCI Vacancy Negative Flow When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW And User navigates to tab "Vacancy Dashboard" - PW diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Pages/User_Table_Page.java b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Pages/User_Table_Page.java index 656612c7e..d4c490a70 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Pages/User_Table_Page.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Pages/User_Table_Page.java @@ -24,6 +24,6 @@ public static String dynamicUserLocator(String userName){ /** * USERS DROPDOWN */ - public static String usersDropDown = "//select[@aria-label='Search a specific field of the Users list']"; + public static String usersDropDown = "//select[@aria-label='Search a specific field of the Users list, 9 items']"; } diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Steps/ApplicantProfileSteps.java b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Steps/ApplicantProfileSteps.java index b16683a52..750b6d807 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Steps/ApplicantProfileSteps.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Steps/ApplicantProfileSteps.java @@ -302,9 +302,9 @@ public void user_verifies_demographics_information_and(String sharingDemographic ApplicantProfileStepsImpl.user_verifies_demographics_information_and(sharingDemographicsText, sexText, ethnicityText, raceText, disabilityText); } - @Then("user verifies references one information {string}, {string}, {string}, {string}, {string}, {string}, {string}, {string}") - public void user_verifies_references_information(String firstNameText, String middleNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { - ApplicantProfileStepsImpl.user_verifies_references_information(firstNameText, middleNameText, lastNameText, emailText, phoneNumberText, relationshipText, titleText, organizationText); + @Then("user verifies references one information {string}, {string}, {string}, {string}, {string}, {string}, {string}") + public void user_verifies_references_information(String firstNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { + ApplicantProfileStepsImpl.user_verifies_references_information(firstNameText, lastNameText, emailText, phoneNumberText, relationshipText, titleText, organizationText); } @Then("if reference two is required then user enters Reference Two first name {string}") @@ -347,9 +347,9 @@ public void enters_reference_two_organization_name(String organizationTextBox) { ApplicantProfileStepsImpl.enters_reference_two_organization_name(organizationTextBox); } - @Then("user verifies references two information {string}, {string}, {string}, {string}, {string}, {string}, {string}, {string}") - public void user_verifies_references_two_information(String firstNameText, String middleNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { - ApplicantProfileStepsImpl.user_verifies_references_two_information(firstNameText, middleNameText, lastNameText, emailText, phoneNumberText, relationshipText, titleText, organizationText); + @Then("user verifies references two information {string}, {string}, {string}, {string}, {string}, {string}, {string}") + public void user_verifies_references_two_information(String firstNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { + ApplicantProfileStepsImpl.user_verifies_references_two_information(firstNameText, lastNameText, emailText, phoneNumberText, relationshipText, titleText, organizationText); } @Then("if either a Cover Letter, Qualification Statement, Curriculum Vitae \\(CV), or Vision Statement \\(or all) were uploaded then documents are displayed in the Application Documents section") diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/StepsImplementation/ApplicantProfileStepsImpl.java b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/StepsImplementation/ApplicantProfileStepsImpl.java index 3cafe6adf..2780b77b2 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/StepsImplementation/ApplicantProfileStepsImpl.java +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/StepsImplementation/ApplicantProfileStepsImpl.java @@ -15,6 +15,7 @@ import com.nci.automation.utils.CucumberLogUtils; import com.nci.automation.utils.MiscUtils; import com.nci.automation.web.CommonUtils; +import com.nci.automation.web.ConfUtils; import com.nci.automation.web.EnvUtils; import com.nci.automation.web.PlaywrightUtils; import org.testng.Assert; @@ -347,8 +348,10 @@ public static void selects_for_organizational_code_drop_down(String option) { * @param text The text value of the element to be clicked. */ public static void clicks(String text) { + page.waitForSelector(Playwright_Common_Locators.dynamicTextLocator(text)); Playwright_Common_Utils.scrollIntoView(Playwright_Common_Locators.dynamicTextLocator(text)); page.locator(Playwright_Common_Locators.dynamicTextLocator(text)).click(); + MiscUtils.sleep(2000); CucumberLogUtils.playwrightScreenshot(page); } @@ -1306,7 +1309,6 @@ public static void user_verifies_demographics_information_and(String sharingDemo * Verifies the references information provided by the user. * * @param firstNameText The first name of the user. - * @param middleNameText The middle name of the user. * @param lastNameText The last name of the user. * @param emailText The email address of the user. * @param phoneNumberText The phone number of the user. @@ -1314,10 +1316,10 @@ public static void user_verifies_demographics_information_and(String sharingDemo * @param titleText The title of the user. * @param organizationText The organization of the user. */ - public static void user_verifies_references_information(String firstNameText, String middleNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { + public static void user_verifies_references_information(String firstNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { Playwright_Common_Utils.scrollIntoView("(//tbody/tr/td)[7]"); ArrayList expectedValues = new ArrayList<>(); - expectedValues.add(firstNameText + " " + middleNameText + " " + lastNameText); + expectedValues.add(firstNameText + " " + lastNameText); expectedValues.add(emailText); expectedValues.add(phoneNumberText); expectedValues.add(relationshipText); @@ -1335,7 +1337,6 @@ public static void user_verifies_references_information(String firstNameText, St * Verifies that the user's references contain the expected information. * * @param firstNameText The first name of the user's reference. - * @param middleNameText The middle name of the user's reference. * @param lastNameText The last name of the user's reference. * @param emailText The email of the user's reference. * @param phoneNumberText The phone number of the user's reference. @@ -1343,9 +1344,9 @@ public static void user_verifies_references_information(String firstNameText, St * @param titleText The title of the user's reference. * @param organizationText The organization of the user's reference. */ - public static void user_verifies_references_two_information(String firstNameText, String middleNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { + public static void user_verifies_references_two_information(String firstNameText, String lastNameText, String emailText, String phoneNumberText, String relationshipText, String titleText, String organizationText) { ArrayList expectedValues = new ArrayList<>(); - expectedValues.add(firstNameText + " " + middleNameText + " " + lastNameText); + expectedValues.add(firstNameText + " " + lastNameText); expectedValues.add(emailText); expectedValues.add(phoneNumberText); expectedValues.add(relationshipText); @@ -1680,11 +1681,16 @@ public static void verifies_that_the_button_text_is(String expectedCreateAnAccou * @param logInButton the locator of the login button element to click */ public static void clicks_and_is_redirected_to_the_login_portal(String logInButton) { - page.locator("//span[normalize-space()='Log in']").click(); + page.locator("//span[normalize-space()='"+logInButton+"']").click(); + MiscUtils.sleep(4000); List pages = page.context().pages(); newPage = pages.get(pages.size() - 1); - Hooks.softAssert.assertEquals(newPage.url(), "https://iam-stage.cancer.gov/app/servicenow_ud/exk13dplx1oy5d1pZ0h8/sso/saml?RelayState=https://specializedscientificjobs-test.nih.gov/nih-ssj.do#/"); - CucumberLogUtils.playwrightScreenshot(page); + if (ConfUtils.getProperty("env").equals("test")){ + Hooks.softAssert.assertEquals(newPage.url(), "https://iam-stage.cancer.gov/app/servicenow_ud/exk13dplx1oy5d1pZ0h8/sso/saml?RelayState=https://specializedscientificjobs-test.nih.gov/nih-ssj.do#/"); + } else if (ConfUtils.getProperty("env").equals("sandbox")) { + Hooks.softAssert.assertEquals(newPage.url(), "https://iam-stage.cancer.gov/app/servicenow_ud/exk13dplx1oy5d1pZ0h8/sso/saml?RelayState=https://specializedscientificjobs-sandbox.nih.gov/nih-ssj.do#/"); + } + } /** @@ -1693,9 +1699,14 @@ public static void clicks_and_is_redirected_to_the_login_portal(String logInButt * @param pivCacCardButtonText the expected text of the PIV/CAC card button */ public static void verifies_that_the_piv_cac_card_button_text_is(String pivCacCardButtonText) { - newPage.waitForSelector("(//a[@class='piv-button link-button'])[1]"); - CucumberLogUtils.playwrightScreenshot(newPage); - Hooks.softAssert.assertEquals(newPage.locator("(//a[@class='piv-button link-button'])[1]").innerText(), pivCacCardButtonText); + Page[] popup = {null}; + page.context().onPage(p -> popup[0] = p); + page.click("text=Log in"); + while (popup[0] == null) { + MiscUtils.sleep(2000); + } + String text = popup[0].textContent("#form19"); + assert text.contains(pivCacCardButtonText); } /** diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Applicant Flow.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Applicant Flow.feature index 951f6bb80..3baf8cd8f 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Applicant Flow.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Applicant Flow.feature @@ -1,47 +1,8 @@ Feature: Applicant Flow Scenarios - Background: common steps - Given User is on SSJ Landing page and user is "Okta Verified Applicant" - - @Regression @Nekrashevich @APPTRACK-758 @selenium @Smoke - Scenario Outline: Edit Basic Information of Profile - And User is on Profile tab - And User clicks Edit for Basic Information section - And User inputs "" into first name field - And User inputs "" into middle name field - And User inputs "" into last name field - And User inputs "" into email field - And User inputs "" into phone field - And User inputs "" into business phone field - And User picks highest degree option as "Masters" - And User confirms being a US Citizen - And User inputs "
" into address field - And User inputs "" into appNumber field - And User inputs "" into city field - And User inputs "" into state field - And User inputs "" into country field - And User inputs "" into zip field - And User saves the updated section - Examples: - | firstName | middleName | lastName | email | phone | businessPhone | address | appNumber | city | state | country | zip | - | Mario | Michelle | Pololi | mario@gmail.com | 2018212343 | 2023323454 | 7 Mills | 12378 | Reston | VA | USA | 20453 | - - @Regression @Nekrashevich @APPTRACK-712 @selenium @Smoke - Scenario: Edit Demographics of Profile - When User is on Profile tab - And User clicks Edit for Demographics section - And User chooses to share demographic details - And User edits sex choice - And User edits ethnicity choice - And User edits race choice - And User edits disability choice - And User saves the updated section - And User clicks Edit for Demographics section - And User chooses not to share demographic details - Then User saves the updated section - - @Regression @Nekrashevich @SSJ-948 @selenium @Smoke + @Regression @Nekrashevich @SSJ-948 @selenium @Smoke @SNOW_UPDATED Scenario: Applicant view of SSJ Landing page + Given User is on SSJ Landing page and user is "Okta Verified Applicant" And User can see SSJ landing page title "Specialized Scientific Jobs" And User can navigate via hyperlink to learn more about NIH And User can see "Open Vacancies" header @@ -50,8 +11,9 @@ Feature: Applicant Flow Scenarios | column1 | column2 | column3 | | Vacancy Title | Institute | Application Period | - @Regression @Nekrashevich @selenium @Smoke + @Regression @Nekrashevich @selenium @Smoke @SNOW_UPDATED Scenario: Vacancy Details View for an Applicant + Given User is on SSJ Landing page and user is "Okta Verified Applicant" And User is on SSJ landing page When User clicks to apply for a live vacancy And User verifies that a vacancy title is displayed @@ -66,8 +28,9 @@ Feature: Applicant Flow Scenarios And User can verify the description of "FOREIGN EDUCATION" statement Then User can verify the description of "REASONABLE ACCOMODATION" statement - @Regression @Nekrashevich @selenium @Smoke + @Regression @Nekrashevich @selenium @Smoke @SNOW_UPDATED Scenario: Your Applications tab + Given User is on SSJ Landing page and user is "Okta Verified Applicant" When User is on Your Applications tab And User can verify "Your Applications" page title Then User can see the following columns displayed on Your Applications page diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/DEPRECATED TESTS.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/DEPRECATED TESTS.feature index 75f818132..cbaaff632 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/DEPRECATED TESTS.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/DEPRECATED TESTS.feature @@ -67,4 +67,65 @@ Feature: DEPRECATED TESTS And User can verify the description of "EQUAL OPPORTUNITY EMPLOYMENT" statement And User can verify the description of "STANDARDS OF CONDUCT/FINANCIAL DISCLOSURE" statement And User can verify the description of "FOREIGN EDUCATION" statement - Then User can verify the description of "REASONABLE ACCOMODATION" statement \ No newline at end of file + Then User can verify the description of "REASONABLE ACCOMODATION" statement + + @SSJ-298 + Scenario: Okta error registration + And User clicks on Login Dropdown + And User clicks "Not Registered" option + Then User is redirected to Okta registration page + And User enters all the registration details + Then User can verify that Okta account was not created + +#these selenium tests already being covered by playwright tests + @SSJ-712 + Scenario: Edit Demographics of Profile + Given a test account "SSJTest" is reset before executing a test + When User is on SSJ Landing page and user is "Maria Chaudhry" - PW + When User is on Profile tab - PW + And User clicks Edit for Demographics section - PW + And User chooses to share demographic details - PW + And User edits sex choice - PW + And User edits ethnicity choice - PW + And User edits race choice - PW + And User edits disability choice - PW + And User saves the updated section - PW + And User clicks Edit for Demographics section - PW + And User chooses not to share demographic details - PW + Then User saves the updated section - PW + + @APPTRACK-712 + Scenario: Edit Demographics of Profile + When User is on Profile tab + And User clicks Edit for Demographics section + And User chooses to share demographic details + And User edits sex choice + And User edits ethnicity choice + And User edits race choice + And User edits disability choice + And User saves the updated section + And User clicks Edit for Demographics section + And User chooses not to share demographic details + Then User saves the updated section + + @APPTRACK-758 + Scenario Outline: Edit Basic Information of Profile + And User is on Profile tab + And User inputs "" into first name field + And User inputs "" into middle name field + And User inputs "" into last name field + And User inputs "" into email field + And User inputs "" into phone field + And User inputs "" into business phone field + And User picks highest degree option as "Masters" + And User confirms being a US Citizen + And User inputs "
" into address field + And User inputs "" into appNumber field + And User inputs "" into city field + And User inputs "" into state field + And User inputs "" into country field + And User inputs "" into zip field + And User saves the updated section + Examples: + | firstName | middleName | lastName | email | phone | businessPhone | address | appNumber | city | state | country | zip | + | Mario | Michelle | Pololi | mario@gmail.com | 2018212343 | 2023323454 | 7 Mills | 12378 | Reston | VA | USA | 20453 | diff --git a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Unauthenticated Applicant.feature b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Unauthenticated Applicant.feature index 6dbf51bd6..a5c14c4b8 100644 --- a/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Unauthenticated Applicant.feature +++ b/src/test/java/ServiceNow/PlatformBusinessApps/SSJ/selenium/Features/Unauthenticated Applicant.feature @@ -3,33 +3,25 @@ Feature: Unauthenticated applicant Scenarios Background: common steps Given User is on SSJ home page and user is Unauthenticated Applicant - @Regression @Nekrashevich @SSJ-124 @SSJ-365 @selenium + @Regression @Nekrashevich @SSJ-124 @SSJ-365 @selenium @SNOW_UPDATED Scenario: Not registered option And User clicks on Login Dropdown And User clicks "Not Registered" option Then User is redirected to Okta registration page - @Regression @Nekrashevich @SSJ-31 @selenium + @Regression @Nekrashevich @SSJ-31 @selenium @SNOW_UPDATED Scenario: Already Registered option And User clicks on Login Dropdown And User clicks "Already Registered" option Then User is redirected to sign in with existing credentials - @Regression @Nekrashevich @SSJ-122 @SSJ-36 @selenium + @Regression @Nekrashevich @SSJ-122 @SSJ-36 @selenium @SNOW_UPDATED Scenario: Employee/Contractor Onl option And User clicks on Login Dropdown And User clicks "Employee/Contractor Only" option Then User is redirected to NIH Login Page - @Regression @Nekrashevich @SSJ-298 @selenium - Scenario: Okta error registration - And User clicks on Login Dropdown - And User clicks "Not Registered" option - Then User is redirected to Okta registration page - And User enters all the registration details - Then User can verify that Okta account was not created - - @Regression @Nekrashevich @SSJ-27 @selenium + @Regression @Nekrashevich @SSJ-27 @selenium @SNOW_UPDATED Scenario: Okta registration error And User clicks on Login Dropdown And User clicks "Not Registered" option diff --git a/src/test/java/appsCommon/Pages/Playwright_NativeView_Dashboard_Page.java b/src/test/java/appsCommon/Pages/Playwright_NativeView_Dashboard_Page.java index 6d3ee7730..c44061725 100644 --- a/src/test/java/appsCommon/Pages/Playwright_NativeView_Dashboard_Page.java +++ b/src/test/java/appsCommon/Pages/Playwright_NativeView_Dashboard_Page.java @@ -5,7 +5,7 @@ public class Playwright_NativeView_Dashboard_Page { /** * PROFILE BUTTON */ - public static String profileButton = "Avatar: available, user"; + public static String profileButton = "css=div.item-label.keyboard-navigatable.snf-collapsible-list-header-button[role = 'button'][aria-label='Availability']"; /** * IMPERSONATE USER OPTION diff --git a/src/test/java/appsCommon/PlaywrightUtils/Playwright_ServiceNow_Common_Methods.java b/src/test/java/appsCommon/PlaywrightUtils/Playwright_ServiceNow_Common_Methods.java index 7eff8a42c..54956e54b 100644 --- a/src/test/java/appsCommon/PlaywrightUtils/Playwright_ServiceNow_Common_Methods.java +++ b/src/test/java/appsCommon/PlaywrightUtils/Playwright_ServiceNow_Common_Methods.java @@ -37,7 +37,7 @@ public static void side_Door_Test_Account_Login_Impersonate(String name){ page.waitForLoadState(); page.reload(); MiscUtils.sleep(2000); - page.getByLabel(Playwright_NativeView_Dashboard_Page.profileButton).click(); + page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("CBIIT Test Account: available")).click(); page.getByRole(AriaRole.MENUITEM, new Page.GetByRoleOptions().setName(Playwright_NativeView_Dashboard_Page.impersonateUserOption)).click(); MiscUtils.sleep(3000); page.getByRole(AriaRole.COMBOBOX, new Page.GetByRoleOptions().setName(Playwright_NativeView_Dashboard_Page.impersonateUserDropDown)).click();