Skip to content

Commit

Permalink
Merge pull request #259 from CBIIT/Alena
Browse files Browse the repository at this point in the history
CCR Careers Smoke test: Fill In An Application As An Internal User , Verify CCR Landing Page items
  • Loading branch information
alenaminsk authored Aug 26, 2024
2 parents 62e4778 + 274304a commit 049ed3e
Show file tree
Hide file tree
Showing 11 changed files with 552 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ src/main/resources/.DS_Store
src/test/java/ServiceNow/COVIDDash/Resources/.DS_Store
src/test/java/ServiceNow/PlatformBusinessApps/CCT_CHAT_BOT/Playwright/Steps/Example.java
src/test/java/PlaywrightTests_sandbox
src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Steps/Example.java
src/test/java/ServiceNow/PlatformBusinessApps/SSJ/playwright/Steps/Example.java
8 changes: 4 additions & 4 deletions src/test/java/CustomBusiness/CCR/Constants/CCR_CONSTANTS.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package CustomBusiness.CCR.Constants;

public class CCR_CONSTANTS {

public static final String CV = System.getProperty("user.dir") + "/src/test/java/CustomBusiness/CCR/Resources/CV.docx";
public static final String DIVERSITY_STATEMENT = System.getProperty("user.dir") + "/src/test/java/CustomBusiness/CCR/Resources/DiversityStatement.docx";
public static final String LETTER_OF_INTEREST = System.getProperty("user.dir") + "/src/test/java/CustomBusiness/CCR/Resources/LetterOfInterest.docx";
public static final String APPLICANT = "Alena Nekrashevich";
public static final String ADMIN = "Lori Holliday";
public static final String CV = "C:\\Users\\nekrashevicha2\\Desktop\\CBIIT-Test-Automation\\src\\test\\java\\CustomBusiness\\CCR\\Resources\\CV.docx";
public static final String RESEARCH_GOALS ="C:\\Users\\nekrashevicha2\\Desktop\\CBIIT-Test-Automation\\src\\test\\java\\CustomBusiness\\CCR\\Resources\\ResearchGoals.docx";
}
40 changes: 25 additions & 15 deletions src/test/java/CustomBusiness/CCR/Features/LandingPage.feature
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
Feature: CCR Landing Page Scenarios

Background: common steps
Given User is on CCR Landing page and user is "internal user"

@Nekrashevich @Regression @Smoke @landingPage
@Nekrashevich @Regression @Smoke @CAMS-7
Scenario: Verify CCR Landing Page items
Given User is on CCR Landing page and user is "internal user"
And User can see "Home" tab displayed
And User can see "Positions" tab displayed

@Nekrashevich @Regression @Smoke @fillApplication @CAMS-9
Scenario Outline: Fill In An Application As An Internal User
And User navigates to "Biostatistician" open vacancy
And User clicks "Apply Now" button
@Nekrashevich @Regression @Smoke @fillApplication @CAMS-9 @CAMS-5 @CAMS-17 @CAMS-38
Scenario Outline: Fill In An Application As An Internal User End to End flow
Given User is on CCR Landing page and user is "admin user"
And Admin User creates a new vacancy
And User logs out of CCR application
And User is on CCR Landing page and user is "internal user"
And User navigates to "Chief Technical Officer" open vacancy
And User applies for that vacancy
And User enters "<firstName>" into a first name field
And User enter "<middleName>" into a middle name field
And User enters "<lastName>" into a last name field
And User enters "<email>" into an email field
And User enters "<phone>" into a phone field
And User enters "<businessPhone>" into a business phone field
And User selects " Ph.D. " from a degree dropdown
And User selects Other from a degree dropdown
And User enters "<otherDegree(s)>" into an other degree field
And User confirms that User is a US Citizen
And User clicks Next button for "Basic Information" section
Expand All @@ -38,17 +40,25 @@ Feature: CCR Landing Page Scenarios
And User enters "<businessZip>" into a business zip field
And User selects United States from a country dropdown for "Business Address" section
And User clicks Next button for "Business Address" section
And User uploads "Letter of Interest" document
And User uploads "CV/Bibliography" document
And User uploads "Upload Diversity Statement" document
And User enters "<referenceFirstName>" into a reference First name field
And User enters "<referenceLastName>" into a reference Last name field
And User enters "<referenceEmail>" into a reference Email field
And User enters "<referencePhoneNumber>" into a reference Phone Number field
And User selects M.D., Ph.D. from a reference degree dropdown
And User clicks Next button for "Reference" section
And User uploads "CV" document
And User uploads "Research Goals" document
And User clicks Next button for "Required Documents" section
And User selects an outreach source as "Contacted By Member"
And User selects "Yes" for the question on simplicity of uploading application materials
And User selects "Yes" for the question on whether the ad posted on the website contains enough information to decide on applying for a job
And User inputs "No suggestions at the moment" in the changing process text field
And User clicks "Submit" button
And User submits CCR Careers application
And User logs out of CCR application
Given User is on CCR Landing page and user is "admin user"
And Admin User deletes a newly created vacancy

Examples:
| firstName | middleName | lastName | email | phone | businessPhone | otherDegree(s) | address | address2 | city | state | zip | department | institution | businessAddress | businessAddress2 | businessCity | businessState | businessZip |
| Elena | Maria | Beloli | elena@gmail.com | 2012212343 | 2023323454 | MBA | 7 Mills | Drive | Reston| VA | 20453 | Research | NCI | 43 Cal Dr | Full Circuit | Mclean | VA | 20567 |
| firstName | middleName | lastName | email | phone | businessPhone | referenceFirstName| referenceLastName| referenceEmail|referencePhoneNumber | otherDegree(s) | address | address2 | city | state | zip | department | institution | businessAddress | businessAddress2 | businessCity | businessState | businessZip |
| Elena | Maria | Beloli | elena@gmail.com | 2012212343 | 2023323454 | John | Molls | test@gmail.com| 2123345678 | MBA | 7 Mills | Drive | Reston| VA | 20453 | Research | NCI | 43 Cal Dr | Full Circuit | Mclean | VA | 20567 |

62 changes: 62 additions & 0 deletions src/test/java/CustomBusiness/CCR/Pages/CCRAdminUserPage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package CustomBusiness.CCR.Pages;

import com.nci.automation.web.CommonUtils;
import com.nci.automation.web.WebDriverUtils;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class CCRAdminUserPage extends CommonUtils {

public CCRAdminUserPage() {
PageFactory.initElements(WebDriverUtils.webDriver, this);
}

/** Positions tab**/
@FindBy(xpath = "//li//a[.=' Positions ']")
public WebElement tabPositions;

/** button Add Position**/
@FindBy(xpath = "//a[@class='btn btn-default btn-sm border-0 mt-0 mb-0 ng-scope']")
public WebElement buttonAddPosition;

/** field Position Title**/
@FindBy(xpath = "//input[@id='title']")
public WebElement fieldPositionTitle;

/** field Description**/
@FindBy(xpath = "//body[@data-id='description']//p")
public WebElement fieldDescription;

/** Todays Date Active Datepicker Choice**/
@FindBy(xpath = "//button[@class='btn btn-default btn-sm active']")
public WebElement todaysDateActiveField;

/** Open Date Calendar**/
@FindBy(xpath = "(//i[@class='fa fa-calendar'])[1]")
public WebElement openDateCalendar;

/** Description text box iframe**/
@FindBy(xpath = "//iframe[@id='description_ifr']")
public WebElement descriptionTextBoxIframe;

/** button Save position**/
@FindBy(xpath = "(//div[@class='text-center']//button[.=' Save '])[1]")
public WebElement buttonSaveNewPosition;

/** button Remove newly created position**/
@FindBy(xpath = "(//button[@class='btn btn-sm btn-danger m-0'])[1]")
public WebElement buttonRemoveNewlyCreatedPosition;

/** button Ok Removing Position Modal**/
@FindBy(xpath = "(//button[@ng-click='buttonClicked(button)'])[2]")
public WebElement buttonOkRemovingPositionModal;

/** Position was removed Confirmation Message**/
@FindBy(xpath = "//p[.='The position and all associated applicant data have been removed from the system.']")
public WebElement confirmationMessagePositionWasRemoved;

/** Acknowledge Position was removed Confirmation Modal**/
@FindBy(xpath = "//button[@ng-click='buttonClicked(button)']")
public WebElement acknowledgeConfirmationModalPositionWasRemoved;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class CCRApplicationPage extends CommonUtils {
public class CCRApplicantPage extends CommonUtils {

public CCRApplicationPage() {
public CCRApplicantPage() {
PageFactory.initElements(WebDriverUtils.webDriver, this);
}

Expand Down Expand Up @@ -80,8 +80,28 @@ public CCRApplicationPage() {
@FindBy(xpath = "(//div//button[contains(text(),' Next ')])[3]")
public WebElement nextButtonBusinessAddressSection;

/** Next Button Required Documents Section **/
/** Next Button Reference Section **/
@FindBy(xpath = "(//div//button[contains(text(),' Next ')])[4]")
public WebElement nextButtonReferenceSection;

/** Reference First Name Field **/
@FindBy(xpath = "//input[@id='reference_0_first_name']")
public WebElement refFirstNameField;

/** Reference Last Name Field **/
@FindBy(xpath = "//input[@id='reference_0_last_name']")
public WebElement refLastNameField;

/** Reference Email Field **/
@FindBy(xpath = "//input[@id='reference_0_email']")
public WebElement refEmailField;

/** Reference Phone Number Field **/
@FindBy(xpath = "//input[@id='reference_0_phone']")
public WebElement refPhoneNumberField;

/** Next Button Required Documents Section **/
@FindBy(xpath = "(//div//button[contains(text(),' Next ')])[5]")
public WebElement nextButtonRequiredDocumentsSection;

/** Department Field **/
Expand Down Expand Up @@ -137,29 +157,13 @@ public CCRApplicationPage() {
public WebElement submitButton;

/** Submit Confirmation Button **/
@FindBy(xpath = "//button[@class='btn btn-primary mx-2']")
@FindBy(xpath = "(//button[@ng-click='buttonClicked(button)'])[2]")
public WebElement submitConfirmationButton;

/** Close Application Submitted Button **/
@FindBy(xpath = "//button[@class='btn btn-primary mx-2']")
@FindBy(xpath = "//button[@ng-repeat='button in options.buttons track by button.label']")
public WebElement closeApplicationSubmittedButton;

/** Upload File1 **/
@FindBy(xpath = "//label[normalize-space()='Upload Letter of Interest']//parent::div//child::div[1]//child::input")
public WebElement uploadFile1;

/** Upload File2 **/
@FindBy(xpath = "(//input[@placeholder='No file chosen'])[2]")
public WebElement uploadFile2;

/** Upload File3 **/
@FindBy(xpath = "(//input[@placeholder='No file chosen'])[3]")
public WebElement uploadFile3;

/** Outreach Source Dropdown **/
@FindBy(xpath = "//select[@id='outreach_source']")
public WebElement outreachSourceDropdown;

/** Country Dropdown **/
@FindBy(xpath = "//select[@id='country']")
public WebElement countryDropdown;
Expand All @@ -168,7 +172,39 @@ public CCRApplicationPage() {
@FindBy(xpath = "//select[@id='business_country']")
public WebElement countryBusinessDropdown;

/** Degree Dropdown **/
/** Applicant Degree Dropdown **/
@FindBy(xpath = "//select[@id='degree']")
public WebElement degreeDropdown;

/** Reference Degree Dropdown **/
@FindBy(xpath = "//select[@id='reference_0_degree']")
public WebElement referenceDegreeDropdown;

/** Reference Degree M.D., Ph.D **/
@FindBy(xpath = "(//option[contains(text(),' M.D., Ph.D.')])[2]")
public WebElement referenceDegreeMDPhD;

/** Other Degree option**/
@FindBy(xpath = "//option[contains(text(),'Other')]")
public WebElement degreeOther;

/** upload Button for CV **/
@FindBy(xpath = "(//div[@class='input-group-btn']//button[.=' Choose File '])[1]")
public WebElement uploadFileCV;

/** upload Button for ResearchGoals **/
@FindBy(xpath = "(//div[@class='input-group-btn']//button[.=' Choose File '])[2]")
public WebElement uploadFileResearchGoals;

/** Confirmation message "The application has been submitted." **/
@FindBy(xpath = "//p[.='The application has been submitted.']")
public WebElement msgApplicationSubmitted;

/** CCR user dropdpown menu" **/
@FindBy(xpath = "//li[@class='dropdown ng-scope']")
public WebElement userDropdownMenu;

/** Log out option" **/
@FindBy(xpath = "//ul[@class='dropdown-menu px-3 shadow-md']")
public WebElement optionLogOut;
}
Binary file not shown.
17 changes: 17 additions & 0 deletions src/test/java/CustomBusiness/CCR/Steps/AdminUserSteps.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package CustomBusiness.CCR.Steps;

import appsCommon.PageInitializers.PageInitializer;
import io.cucumber.java.en.Given;

public class AdminUserSteps extends PageInitializer {

@Given("Admin User deletes a newly created vacancy")
public void admin_user_deletes_a_newly_created_vacancy() {
cCRStepsImplementation.adminUserDeletesNewVacancy();
}

@Given("Admin User creates a new vacancy")
public void admin_user_creates_a_new_vacancy() {
cCRStepsImplementation.adminUserCreatesNewVacancy();
}
}
Loading

0 comments on commit 049ed3e

Please sign in to comment.