package ru.stqa.pft.addressbook;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.*;

public class GroupCreationTests {
    FirefoxDriver wd;
    
    @BeforeMethod
    public void setUp() throws Exception {
        wd = new FirefoxDriver();
        wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    }
    
    @Test
    public void GroupCreationTests() {
        wd.get("http://addressbook/");
        wd.findElement(By.id("LoginForm")).click();
        wd.findElement(By.name("user")).click();
        wd.findElement(By.name("user")).clear();
        wd.findElement(By.name("user")).sendKeys("admin");
        wd.findElement(By.id("LoginForm")).click();
        wd.findElement(By.name("pass")).click();
        wd.findElement(By.name("pass")).clear();
        wd.findElement(By.name("pass")).sendKeys("secret");
        wd.findElement(By.xpath("//form[@id='LoginForm']/input[3]")).click();
        wd.findElement(By.linkText("groups")).click();
        wd.findElement(By.name("new")).click();
        wd.findElement(By.name("group_name")).click();
        wd.findElement(By.name("group_name")).clear();
        wd.findElement(By.name("group_name")).sendKeys("my group");
        wd.findElement(By.name("group_header")).click();
        wd.findElement(By.name("group_header")).clear();
        wd.findElement(By.name("group_header")).sendKeys("group header");
        wd.findElement(By.name("group_footer")).click();
        wd.findElement(By.name("group_footer")).clear();
        wd.findElement(By.name("group_footer")).sendKeys("group footer");
        wd.findElement(By.name("submit")).click();
        wd.findElement(By.linkText("group page")).click();
        wd.findElement(By.linkText("Logout")).click();
    }
    
    @AfterMethod
    public void tearDown() {
        wd.quit();
    }
}

@@ -189,16 +189,17 @@
 meUnit;%0A
+%0A
 import o
@@ -327,21 +327,17 @@
 ver wd;%0A
-    
 %0A
+
     @Bef
@@ -496,68 +496,8 @@
 S);%0A
-    %7D%0A    %0A    @Test%0A    public void GroupCreationTests() %7B%0A
     
@@ -1020,32 +1020,87 @@
 %5B3%5D%22)).click();%0A
+    %7D%0A%0A    @Test%0A    public void testGroupCreation() %7B%0A
         wd.findE
@@ -1911,20 +1911,16 @@
 ;%0A    %7D%0A
-    
 %0A    @Af

Put login code to @beforeTest part