package nwo.stqa.addressbook.appmanager;

import nwo.stqa.addressbook.model.GroupData;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;

public class GroupHelper {
  private FirefoxDriver wd;

  private BaseHelper baseHelper;

  public GroupHelper(FirefoxDriver wd) {
    this.wd = wd;
    baseHelper = new BaseHelper(wd);
  }

  public void returnToGroupPage() {
    wd.findElement(By.linkText("group page")).click();
  }

  public void submitGroupCreation() {
    wd.findElement(By.name("submit")).click();
  }

  public void fillGroupForm(GroupData groupData) {
    baseHelper.selectGroupName();
    baseHelper.setGroupName(groupData);
    baseHelper.selectGroupHeader();
    baseHelper.setGroupHeader(groupData);
    baseHelper.selectGroupFooter();
    baseHelper.setGroupFooter(groupData);
  }

  public void initGroupCreation() {
    wd.findElement(By.name("new")).click();
  }

  public void deleteSelectedGroups() {
    wd.findElement(By.name("delete")).click();
  }

  public void selectGroup() {
    wd.findElement(By.name("selected[]")).click();
  }

  public BaseHelper getBaseHelper() {
    return baseHelper;
  }
}

@@ -222,42 +222,8 @@
 d;%0A%0A
-  private BaseHelper baseHelper;%0A%0A
   pu
@@ -281,45 +281,8 @@
 wd;%0A
-    baseHelper = new BaseHelper(wd);%0A
   %7D%0A
@@ -527,231 +527,595 @@
     
-baseHelper.selectG
+wd.findElement(By.name(%22g
 roup
-Name();%0A    baseHelper.setG
+_name%22)).click();%0A    wd.findElement(By.name(%22group_name%22)).clear();%0A    wd.findElement(By.name(%22g
 roup
-Name(groupData);%0A    baseHelper.selectG
+_name%22)).sendKeys(groupData.getName());%0A    wd.findElement(By.name(%22g
 roup
-H
+_h
 eader
-();%0A    baseHelper.setG
+%22)).click();%0A    wd.findElement(By.name(%22group_header%22)).clear();%0A    wd.findElement(By.name(%22g
 roup
-H
+_h
 eader
-(groupData);%0A    baseHelper.selectG
+%22)).sendKeys(groupData.getHeader());%0A    wd.findElement(By.name(%22group_footer%22)).click();%0A    wd.findElement(By.name(%22g
 roup
-F
+_f
 ooter
-();%0A    baseHelper.setGroupFooter(groupData
+%22)).clear();%0A    wd.findElement(By.name(%22group_footer%22)).sendKeys(groupData.getFooter());%0A    wd.findElement(By.name(%22group_footer%22)).click(
 );%0A 
@@ -1382,73 +1382,7 @@
 %0A  %7D
-%0A%0A  public BaseHelper getBaseHelper() %7B%0A    return baseHelper;%0A  %7D
 %0A%7D%0A

Revert "Grouphelper small changes"