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 verifyTextBoxAddress2(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String verifyAddress2PresentInTextBox = overviewTab.getTextBoxAddress2();
   Assert.assertEquals(
       verifyAddress2PresentInTextBox, overviewData.getAddress2(), "Address2 not found");
   AutomationLog.info("Expected Address2 found As per the Text Box");
 }
 public void verifyTextBoxNeigborhood(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String verifyNeighborhoodPresentInTextBox = overviewTab.getMultipleSelectNeighborhood();
   Assert.assertEquals(
       verifyNeighborhoodPresentInTextBox, overviewData.getNeighbour(), "Neigborhood not found");
   AutomationLog.info("Expected Neighborhood found As per the Text Box");
 }
 public void verifyTextBoxComapnyName(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String verifyComapnyNamePresentInTextBox = overviewTab.getTextBoxCompanyName();
   Assert.assertEquals(
       verifyComapnyNamePresentInTextBox, overviewData.getCompanyName(), "company name not found");
   AutomationLog.info("Expected Company Name found As per the Text Box");
 }
 public void testBannerPhoneDetails(PageBanner banner, UserProfile overviewData) throws Exception {
   String phoneDetails = banner.getBannerWorkPhoneText();
   String phoneToken[] = phoneDetails.split(": ");
   String formattedPhoneNumber = formatPhoneNumber(overviewData.getWorkPhone());
   Assert.assertEquals(
       phoneToken[1], formattedPhoneNumber, "The correct Workphone is not displayed in banner");
   AutomationLog.info("Updated WorkPhone found in banner");
 }
 public void verifyBannerDetails(PageBanner banner, UserProfile overviewData) throws Exception {
   String newBannerNameAfterSavingOverviewData = banner.getBannerText();
   Assert.assertEquals(
       newBannerNameAfterSavingOverviewData,
       overviewData.getName(),
       "Expected name is not displayed in banner");
   AutomationLog.info("Updated Name displayed on Banner");
 }
 public void verifyTextBoxDescribeYourself(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String verifydescribeYourselfPresentInTextBox = overviewTab.getTextBoxDescribeYorself();
   Assert.assertEquals(
       verifydescribeYourselfPresentInTextBox,
       overviewData.getDescribe(),
       "Describe yourself not found");
   AutomationLog.info("Expected Description found As per the Text Box");
 }
 public void verifyTextBoxWorkPhoneNumber(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String work = overviewTab.getTextBoxWorkPhoneNumber();
   String verifyWorkPhoneNumberPresentInTextBox = work.replaceAll("-", "");
   Assert.assertEquals(
       verifyWorkPhoneNumberPresentInTextBox,
       overviewData.getWorkPhone(),
       "Workphone nos not found");
   AutomationLog.info("Expected Work Phone number found As per the Text Box");
 }
 public void testBannerMobileDetails(PageBanner banner, UserProfile overviewData)
     throws Exception {
   String mobileDetails = banner.getBannerMobilePhoneText();
   String mobileToken[] = mobileDetails.split(": ");
   String formattedMobileNumber = formatPhoneNumber(overviewData.getMobilePhone());
   Assert.assertEquals(
       mobileToken[1],
       formattedMobileNumber,
       "The correct Mobile number is not displayed in banner");
   AutomationLog.info(" Updated MobileNumber found in banner");
 }
  @Override
  protected void verifyTestCases() throws Exception {
    UserProfile userData = getTestOverviewData();

    overviewTab.populateOverviewDetails(userData);
    overviewTab = overviewTab.saveOverviewDetails();
    WaitFor.waitForPageToLoad(
        Page.driver,
        overviewTab.msg_SuccessAfterSave().getText(),
        overviewTab.neighborhoodlocator());

    pageBanner = dashboard.pageBanner();
    WaitFor.waitForPageToLoad(Page.driver, userData.getName(), pageBanner.getBannerTextLocater());

    verifyUpdatedOverviewBanner(pageBanner, userData);
    verifyUpdatedOverviewTabForm(overviewTab, userData);

    verifyIfEmailFieldIsEditable();

    verifyIfClickingSpecializedNeighborhoodsShowsDropDownToSelectNeighborhoods();
    verifyIfMoreThanFiveNeighborhoodsCanBeAddedInSpecializedNeighborhoods();
  }
  private UserProfile getTestOverviewData() {
    HashMap<String, String> overviewTestData = testCaseData.get("OverviewData");

    UserProfile userData = new UserProfile();
    userData.setName(overviewTestData.get("validName"));
    userData.setCompanyName(overviewTestData.get("companyName"));
    userData.setWorkPhone(overviewTestData.get("validWorkPhone"));
    userData.setMobilePhone(overviewTestData.get("validMobileNumber"));
    userData.setAddress1(overviewTestData.get("validAddress1"));
    userData.setAddress2(overviewTestData.get("validAddress2"));
    userData.setCity(overviewTestData.get("validCity"));
    userData.setState(overviewTestData.get("validState"));
    userData.setZipCode(overviewTestData.get("validZip"));
    userData.setDescribe(overviewTestData.get("character"));
    userData.setNeighbour(overviewTestData.get("validNeighbour"));

    return userData;
  }
 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");
 }
 public void verifyTextBoxState(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String verifyStatePresentInTextBox = overviewTab.getDropdownState();
   Assert.assertEquals(verifyStatePresentInTextBox, overviewData.getState(), "State not found");
   AutomationLog.info("Expected State found As per the Text Box");
 }
 public void verifyTextBoxCity(OverviewTab overviewTab, UserProfile overviewData)
     throws Exception {
   String verifyCityPresentInTextBox = overviewTab.getTextBoxCity();
   Assert.assertEquals(verifyCityPresentInTextBox, overviewData.getCity(), "City not found");
   AutomationLog.info("Expected City found As per the Text Box");
 }