Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariachaudhry committed Jun 26, 2024
1 parent 398e363 commit 6fbb87d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void if_user_selects_no_for_the_isTheEmployeeLocatedOnSiteField_then_show
}

@Then("the “FedEx Label Needed” field should be under “Employee Address” field.")
public void the_fedexLabelNeeded_field_should_be_under_employee_address_field() throws Exception{
public void the_fedexLabelNeeded_field_should_be_under_employee_address_field() {
OFFBOARD_StepsImpl.the_fedexLabelNeeded_field_should_be_under_employeeAddress_field();
}

Expand All @@ -57,7 +57,7 @@ public void if_user_selects_yes_for_the_fedexLabelNeeded_field_then_show_the_are
}

@Then("the “Are Boxes Needed for Items to be returned?” field should be under “FedEx Label Needed” field.")
public void the_areBoxesNeededForItemsToBeReturned_field_should_be_under_fedexLabelNeeded() throws Exception{
public void the_areBoxesNeededForItemsToBeReturned_field_should_be_under_fedexLabelNeeded(){
OFFBOARD_StepsImpl.the_areBoxesNeededForItemsToBeReturned_field_should_be_under_fedexLabelNeeded();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void i_open_the_offboarding_request_form() {
* Verifies that the specified departure or transfer field is visible on the page.
*
* @param departureOrTransferField the text of the departure or transfer field
* @param departure the departure value
* @param departure the departure value
*/
public static void i_should_see_field_to_put_in_a_request_for_an_employee(String departureOrTransferField, String departure) {
PlaywrightUtils.page.waitForSelector(OFFBOARD_Page.cbiit_OffBoardingRequestFormDepartureOrTransferFieldTextLocator);
Expand Down Expand Up @@ -112,14 +112,19 @@ public static void if_user_selects_no_for_the_isTheEmployeeLocatedOnSiteField_th
*
* @throws Exception if the bounding box cannot be retrieved for one or both fields
*/
public static void the_fedexLabelNeeded_field_should_be_under_employeeAddress_field() throws Exception {
BoundingBox fedexLabelNeededFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_FedexLabelNeededFieldLocator).boundingBox();
BoundingBox employeeAddressFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_EmployeeAddressFieldLocator).boundingBox();
if (fedexLabelNeededFieldBounds == null || employeeAddressFieldBounds == null) {
throw new Exception("Could not find the element location for one or both fields on the page");
public static void the_fedexLabelNeeded_field_should_be_under_employeeAddress_field() {
try {
BoundingBox fedexLabelNeededFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_FedexLabelNeededFieldLocator).boundingBox();
BoundingBox employeeAddressFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_EmployeeAddressFieldLocator).boundingBox();
if (fedexLabelNeededFieldBounds == null || employeeAddressFieldBounds == null) {
throw new Exception("Could not find the element location for one or both fields on the page");
}
Assert.assertTrue(fedexLabelNeededFieldBounds.y > employeeAddressFieldBounds.y, "The “FedEx Label Needed” field is under “Employee Address” field");
CucumberLogUtils.playwrightScreenshot(PlaywrightUtils.page);
} catch (
Exception e) {
e.printStackTrace();
}
Assert.assertTrue(fedexLabelNeededFieldBounds.y > employeeAddressFieldBounds.y, "The “FedEx Label Needed” field is under “Employee Address” field");
CucumberLogUtils.playwrightScreenshot(PlaywrightUtils.page);
}

/**
Expand All @@ -144,14 +149,18 @@ public static void if_user_selects_yes_for_the_fedexLabelNeeded_field_then_show_
*
* @throws Exception if the bounding box cannot be retrieved for one or both fields
*/
public static void the_areBoxesNeededForItemsToBeReturned_field_should_be_under_fedexLabelNeeded() throws Exception{
BoundingBox areBoxesNeededForItemsToBeReturnedFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_AreBoxesNeededForItemsToBeReturnedFieldLocator).boundingBox();
BoundingBox fedexLabelNeededFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_FedexLabelNeededFieldLocator).boundingBox();
if (areBoxesNeededForItemsToBeReturnedFieldBounds == null || fedexLabelNeededFieldBounds == null) {
throw new Exception("Could not find the element location for one or both fields on the page");
public static void the_areBoxesNeededForItemsToBeReturned_field_should_be_under_fedexLabelNeeded() {
try {
BoundingBox areBoxesNeededForItemsToBeReturnedFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_AreBoxesNeededForItemsToBeReturnedFieldLocator).boundingBox();
BoundingBox fedexLabelNeededFieldBounds = PlaywrightUtils.page.locator(OFFBOARD_Page.cbiit_FedexLabelNeededFieldLocator).boundingBox();
if (areBoxesNeededForItemsToBeReturnedFieldBounds == null || fedexLabelNeededFieldBounds == null) {
throw new Exception("Could not find the element location for one or both fields on the page");
}
Assert.assertTrue(areBoxesNeededForItemsToBeReturnedFieldBounds.y > fedexLabelNeededFieldBounds.y, "The “Are Boxes Needed for Items to be returned?” field is under “FedEx Label Needed” field");
CucumberLogUtils.playwrightScreenshot(PlaywrightUtils.page);
} catch (Exception e) {
e.printStackTrace();
}
Assert.assertTrue(areBoxesNeededForItemsToBeReturnedFieldBounds.y > fedexLabelNeededFieldBounds.y, "The “Are Boxes Needed for Items to be returned?” field is under “FedEx Label Needed” field");
CucumberLogUtils.playwrightScreenshot(PlaywrightUtils.page);
}

/**
Expand Down

0 comments on commit 6fbb87d

Please sign in to comment.