package home.two.addressbook.appmanager;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;


public class NavigationHelper extends HelperBase{


  public NavigationHelper(WebDriver wd) {
    super(wd);
  }

  public void groupPage() {
    if (isElementPresent(By.tagName("h1"))
            && getElement(By.tagName("h1")).getText().equals("Groups")
            && isElementPresent(By.name("new"))) {
      return;

    } else {
      click(By.linkText("groups"));
    }
  }

  public void gotoPageContactCreation() {
    if (isElementPresent(By.tagName("h1"))
            && getElement(By.tagName("h1")).getText().equals("Edit / add address book entry")
            && isElementPresent(By.name("Enter"))) {
      return;
    } else {
      click(By.linkText("add new"));
    }
  }

  public void contactPage() {
  if (isElementPresent(By.id("maintable"))) {
  return;
    }
    click(By.linkText("home"));
  }

}
