public void testBannerAddressDetails(PageBanner banner, UserProfile overviewData) throws Exception { String addressDetails = banner.getBannerAddressText(); String addressToken[] = addressDetails.split(", "); Assert.assertEquals( addressToken[0], overviewData.getAddress1(), "The correct Address1 is not displayed in banner"); AutomationLog.info("Updated address1 found in banner"); Assert.assertEquals( addressToken[1], overviewData.getAddress2(), "The correct Address2 is not displayed in banner"); AutomationLog.info("Updated address2 found in banner"); Assert.assertEquals( addressToken[2], overviewData.getCity(), "The correct City is not displayed in banner"); AutomationLog.info("Updated City found in banner"); createStateAbbreviationMap(); String stateAndZipcode[] = addressToken[3].split(" "); String abbreviation = getStateAbbreviation(overviewData.getState()); Assert.assertEquals( stateAndZipcode[0], abbreviation, "The correct state is not displayed in banner"); AutomationLog.info("Updated State found in banner"); Assert.assertEquals( stateAndZipcode[1], overviewData.getZipCode(), "The correct Zipcode is not displayed in banner"); AutomationLog.info("Updated Zip found in banner"); }
public void verifyTextBoxZip(OverviewTab overviewTab, UserProfile overviewData) throws Exception { String verifyZipPresentInTextBox = overviewTab.getTextBoxZip(); Assert.assertEquals(verifyZipPresentInTextBox, overviewData.getZipCode(), "Zip not found"); AutomationLog.info("Expected Zip found As per the Text Box"); }