Skip to content

Commit

Permalink
Merge pull request #326 from CBIIT/cabreralf
Browse files Browse the repository at this point in the history
SSJ Regression tests fixes
  • Loading branch information
Mariachaudhry authored Nov 22, 2024
2 parents f876a25 + d8a9f80 commit 0545b81
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 107 deletions.
11 changes: 6 additions & 5 deletions src/main/java/com/nci/automation/web/CommonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.DateTimeParseException;
import java.time.format.SignStyle;
import java.time.temporal.ChronoField;
import java.util.*;
import org.openqa.selenium.*;
Expand Down Expand Up @@ -697,13 +698,13 @@ public static String getCurrentDateIn_MM_DD_YYYY_format() {
*/
public static String getTenDaysFromToday_In_MM_DD_YYYY_format() {
DateTimeFormatter formatter = new DateTimeFormatterBuilder()
.appendValue(ChronoField.MONTH_OF_YEAR)
.appendValue(ChronoField.MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL)
.appendLiteral('/')
.appendValue(ChronoField.DAY_OF_MONTH, 2)
.appendValue(ChronoField.DAY_OF_MONTH, 1, 2, SignStyle.NORMAL)
.appendLiteral('/')
.appendValue(ChronoField.YEAR, 4)
.appendValue(ChronoField.YEAR, 4, 4, SignStyle.EXCEEDS_PAD)
.toFormatter();
LocalDate dateAfterTenDays = LocalDate.now().plusDays(10);
LocalDate dateAfterTenDays = LocalDate.now().plusDays(9);
return dateAfterTenDays.format(formatter);
}

Expand All @@ -714,7 +715,7 @@ public static String getTenDaysFromToday_In_MM_DD_YYYY_format() {
*/
public static String getDateAfterTenDaysIn_YYYY_MM_DD_format() {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate dateAfterDays = LocalDate.now().plusDays(10);
LocalDate dateAfterDays = LocalDate.now().plusDays(9);
return dateAfterDays.format(formatter);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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_NF @playwright @SNOW_UPDATED
@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 "<firstName>" is reset before executing a test
When User is on SSJ Landing page and user is "Maria Chaudhry" - PW
Expand Down Expand Up @@ -42,7 +42,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_NF @playwright @SNOW_UPDATED
@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 "<firstName>" is reset before executing a test
When User is on SSJ Landing page and user is "Maria Chaudhry" - PW
Expand Down Expand Up @@ -84,51 +84,9 @@ 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 |

@US_APPTRACK-342 @TC_APPTRACK-385 @JUAREZDS @Regression_NF @playwright @SNOW_UPDATED
@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
And clicks on "Vacancy Dashboard" - PW
And clicks on "+ Create Vacancy" - PW
And enters Vacancy Title name "DIEGO TEST" - PW
And enters Vacancy Description "THIS IS A TEST AUTOMATION TEST" - PW
And selects "Yes" for point of contact - PW
And User sets an "Open Date" entry as today's date
And unselects the option for cover letter
And checks "Enable Reference Collection" check box
And selects a Reference Collection Date Ten days from today
And selects "2" for Full Contact Details for References
And selects "Research Fellow" for Position Classification drop down
And selects "HNC" for Organizational Code drop down
And clicks "Save"
And clicks Save for Mandatory Statements
And selects "David Rampulla" for Committee Member with chair 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
And verifies Vacancy Title "DIEGO TEST"
And verifies Utilize a Set Close Date is "No"
And verifies Allow HR Specialist to Triage is "No"
And verifies Vacancy Description "THIS IS A TEST AUTOMATION TEST"
And verifies Vacancy Point of Contact Information is "Holly Gemar-Griffith" with email address "[email protected]"
And verifies Open Date is todays date
And verifies Application Documents "Curriculum Vitae (CV)", "Cover Letter", "Vision Statement", "Qualification Statement"
And verifies Reference Collection is "Yes"
And verifies Collection Date is ten days from today
And verifies "2 recommendation(s)" reference recommendations are required for this vacancy
And verifies "4 categories" scoring categories are required for this vacancy
And verifies Organizational Code is "HNC"
And verifies Position Classification is "Research Fellow"
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 "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"
And clicks "Close"
And OWM Vacancy Manager logs out
Given a test account "<firstName>" is reset before executing a test
When User is on SSJ Landing page and user is "Maria Chaudhry" - PW
And clicks on Vacancy Title "DIEGO TEST"
Expand Down Expand Up @@ -251,7 +209,7 @@ Feature: Applicant Profile Scenarios
And verifies Application Documents text "APPLICATION DOCUMENTS"
And verifies required documents with required references needed to apply to this test Vacancy

@TC_APPTRACK-144 @JUAREZDS @Regression_NF @playwright @NEEDS_FIX
@TC_APPTRACK-144 @JUAREZDS @Regression @playwright
Scenario: Applying for vacancy as unauthenticated applicant
Given an unauthenticated applicant is on the SSJ homepage "SSJPortalView"
And verifies that the drop drown text is "Login"
Expand All @@ -266,9 +224,8 @@ Would you like to log in now or go back to the home page?
"""
And verifies that the text on the buttons is "Create an account" "Log in" "Go Back"
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_NF @playwright @SNOW_UPDATED
@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
Expand Down Expand Up @@ -336,7 +293,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_NF @playwright @SNOW_UPDATED
@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Feature: OWM Vacancy Manager Scenarios
And User verifies that Number of Scoring Categories slider is set to "4" by default
And User verifies Number of Scoring Categories slider has 6 (One - six) options
And User verifies that all positions are present via Position Classification dropdown
And User verifies all org codes are present via Organizational Code dropdown
And User verifies the text of "Position Classification" i tooltip is
"""
Select the Intramural or Extramural Professional Designation for your vacancy. Select “N/A” for Stadtman positions.
Expand Down Expand Up @@ -78,7 +77,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_NF @playwright @SNOW_UPDATED
@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
Expand Down Expand Up @@ -140,7 +139,7 @@ Feature: OWM Vacancy Manager Scenarios
And User clicks "Save" for Actions
Then User can see "A committee member can only be listed once on a committee. Please remove duplicate committee members." alert

@BUGFIX_APPTRACK-1332 @playwright @Regression_NF @cabreralf
@BUGFIX_APPTRACK-1332 @playwright @Regression @cabreralf
Scenario: BUG - Vacancy not showing for assigned Exec Secretary in Your Vacancies tab
When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW
And User navigates to tab "Vacancy Dashboard" - PW
Expand All @@ -149,6 +148,7 @@ Feature: OWM Vacancy Manager Scenarios
And enters Vacancy Description "THIS IS A TEST AUTOMATION TEST" - PW
And selects "Yes" for point of contact - PW
And User sets an "Open Date" entry as today's date
And User sets a "Close Date" entry a month from the Open Date
And selects "0" for Full Contact Details for References
And User verifies that Number of Scoring Categories slider is set to "4" by default
And selects "4" for Number of Scoring Categories
Expand All @@ -172,6 +172,71 @@ Feature: OWM Vacancy Manager Scenarios
And User navigates to tab "Your Vacancies" - PW
And verifies Vacancy Title "Testing Automation Title SSJ-1332" is on the Your Vacancies page

@APPTRACK-151 @cabreralf @playwright @IN-PROGRESS
Scenario: Live vacancies View verification
# Given User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW
# And User navigates to tab "Vacancy Dashboard" - PW
# When User clicks on the "live vacancies" tab
# Then User can see the filters "All","Live","Extended"
# And User can verify All is by default selected
# And User can verify that All subfilter displays vacancies in the open state
# And User can verify that vacancies with subfilter All are by default sorted by number of applicants in ascending order
# And User can verify that Live subfilter displays vacancies in the open state
# And User can verify that vacancies with subfilter Live are by default sorted by number of applicants in ascending order
# And User can verify the table columns are displayed as "Vacancy Title","Applicants","Open Date","Close Date","Actions"

When User is on SSJ Landing page and user is "OWM Vacancy Manager" - PW
And clicks on "Vacancy Dashboard" - PW
And clicks on "+ Create Vacancy" - PW
And enters Vacancy Title name "DIEGO TEST" - PW
And enters Vacancy Description "THIS IS A TEST AUTOMATION TEST" - PW
And User checks "Utilizing a Set Close Date" option
And selects "Yes" for point of contact - PW
And User sets an "Open Date" entry as today's date
And User sets a "Close Date" entry a month from the Open Date
And unselects the option for cover letter
And checks "Enable Reference Collection" check box
And selects a Reference Collection Date Ten days from today
And selects "2" for Full Contact Details for References
And selects "Research Fellow" for Position Classification drop down
And selects "HNC" for Organizational Code drop down
And clicks "Save"
And clicks Save for Mandatory Statements
And selects "David Rampulla" for Committee Member with chair 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
And verifies Vacancy Title "DIEGO TEST"
And verifies Utilize a Set Close Date is "No"
And verifies Allow HR Specialist to Triage is "No"
And verifies Vacancy Description "THIS IS A TEST AUTOMATION TEST"
And verifies Vacancy Point of Contact Information is "Holly Gemar-Griffith" with email address "[email protected]"
And verifies Open Date is todays date
And verifies Application Documents "Curriculum Vitae (CV)", "Cover Letter", "Vision Statement", "Qualification Statement"
And verifies Reference Collection is "Yes"
And verifies Collection Date is ten days from today
And verifies "2 recommendation(s)" reference recommendations are required for this vacancy
And verifies "4 categories" scoring categories are required for this vacancy
And verifies Organizational Code is "HNC"
And verifies Position Classification is "Research Fellow"
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 "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"
And clicks "Close"
And OWM Vacancy Manager logs out

# And User can edit a vacancy
# And User can copy link of a vacancy
# And User can extend a vacancy
# And User can sort vacancies by Applicants in ascending order
# And User can sort vacancies by Open Date in descending order
# And User can sort vacancies by Close Date in ascending order

@SSJ-310 @SSJ-158 @SSJ-71 @playwright
Scenario: Verification of Email Templates section while creating an NCI Vacancy Positive Flow
Given User is on SSJ Landing page and user is "OWM Vacancy Manager"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package ServiceNow.PlatformBusinessApps.SSJ.playwright.Steps;

import Hooks.Hooks;
import ServiceNow.PlatformBusinessApps.SSJ.playwright.Pages.Mandatory_Statements_Page;
import ServiceNow.PlatformBusinessApps.SSJ.playwright.StepsImplementation.OWM_Vacancy_Manager_StepsImpl;
import appsCommon.Pages.Playwright_Common_Locators;
import com.microsoft.playwright.ElementHandle;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.AriaRole;
import io.cucumber.java.en.Given;
Expand Down Expand Up @@ -118,11 +120,6 @@ public void user_confirms_that_checkbox_is_displayed(String text) {
OWM_Vacancy_Manager_StepsImpl.user_confirms_that_checkbox_is_displayed(text);
}

@Then("User verifies all org codes are present via Organizational Code dropdown")
public void user_verifies_all_org_codes_are_present_via_organizational_code_dropdown() {
OWM_Vacancy_Manager_StepsImpl.user_verifies_all_org_codes_are_present_via_organizational_code_dropdown();
}

@Then("User verifies the text of {string} i tooltip is")
public void user_verifies_the_text_of_i_tooltip_is(String text, String docString) {
OWM_Vacancy_Manager_StepsImpl.user_verifies_the_text_of_i_tooltip_is(text, docString);
Expand Down Expand Up @@ -267,4 +264,45 @@ public void impersonate_holly_or_any_vacancy_manager() {
public void verifies_vacancy_title_is_on_the_your_vacancies_page(String vacancyTitle) {
OWM_Vacancy_Manager_StepsImpl.verifies_vacancy_title_is_on_the_your_vacancies_page(vacancyTitle);
}

@When("User clicks on the {string} tab")
public void user_clicks_on_the_tab(String text) {
page.locator(Playwright_Common_Locators.vacancyType(text)).click();
}

@Then("User can see the filters {string},{string},{string}")
public void user_can_see_the_filters(String all, String live, String extended) {
Hooks.softAssert.assertEquals(page.locator(Playwright_Common_Locators.dynamicTextLocator(all)).innerText(), all);
Hooks.softAssert.assertEquals(page.locator(Playwright_Common_Locators.dynamicSpanNormalizeSpaceLocator(live)).innerText(), live);
Hooks.softAssert.assertEquals(page.locator(Playwright_Common_Locators.dynamicSpanNormalizeSpaceLocator(extended)).innerText(), extended);
}

@Then("User can verify All is by default selected")
public void user_can_verify_all_is_by_default_selected() {
page.locator("(//span[@class='ant-radio-button ant-radio-button-checked'])[2]").isVisible();
ElementHandle button = page.waitForSelector("xpath=(//span[@class='ant-radio-button ant-radio-button-checked'])[2]");
String classNames = button.getAttribute("class");
assert classNames.contains("ant-radio-button-checked");
}

@Then("User can verify that All subfilter displays vacancies in the open state")
public void user_can_verify_that_all_subfilter_displays_vacancies_in_the_open_state() {
page.locator("(//span[@class='ant-table-column-title'][normalize-space()='Open Date'])[2]").click();
}

@Then("User can verify that vacancies with subfilter All are by default sorted by number of applicants in ascending order")
public void user_can_verify_that_vacancies_with_subfilter_all_are_by_default_sorted_by_number_of_applicants_in_ascending_order() {
}

@Then("User can verify that Live subfilter displays vacancies in the open state")
public void user_can_verify_that_live_subfilter_displays_vacancies_in_the_open_state() {
}

@Then("User can verify that vacancies with subfilter Live are by default sorted by number of applicants in ascending order")
public void user_can_verify_that_vacancies_with_subfilter_live_are_by_default_sorted_by_number_of_applicants_in_ascending_order() {
}

@Then("User can verify the table columns are displayed as {string},{string},{string},{string},{string}")
public void user_can_verify_the_table_columns_are_displayed_as(String string, String string2, String string3, String string4, String string5) {
}
}
Loading

0 comments on commit 0545b81

Please sign in to comment.