package com.tridentqa.webdriver.pages;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.sahagin.runlib.external.CaptureStyle;
import org.sahagin.runlib.external.TestDoc;
import org.sahagin.runlib.external.adapter.webdriver.WebDriverAdapter;

public class ContactPageSampleTest {

    @Test
    public void Firefoxでの問い合わせが成功すること() {
        WebDriver wd = new FirefoxDriver();
        WebDriverAdapter.setAdapter(wd);
        contact(wd);
        wd.quit();
    }

    @Test
    public void Chromeでの問い合わせが成功すること() {
        WebDriver wd = new ChromeDriver();
        WebDriverAdapter.setAdapter(wd);
        contact(wd);
        wd.quit();
    }

    @Test
    public void PhantomJSでの問い合わせが成功すること() {
        WebDriver wd = new PhantomJSDriver();
        WebDriverAdapter.setAdapter(wd);
        contact(wd);
        wd.quit();
    }

    @TestDoc(value = "問い合わせを行う", capture=CaptureStyle.STEP_IN)
    private void contact(WebDriver wd) {
        wd.get("http://www-demo.trident-qa.com/contact/");
        wd.findElement(By.name("your-name")).sendKeys("テストユーザー");
        wd.findElement(By.name("your-email")).sendKeys("***@***.com");
        wd.findElement(By.name("your-organization")).sendKeys("TRIDENT Inc.");
        wd.findElement(By.name("your-subject")).sendKeys("テスト");
        wd.findElement(By.name("your-message")).sendKeys("テスト送信です");
        wd.findElement(By.cssSelector("input.wpcf7-submit")).click();
    }
}

@@ -60,81 +60,8 @@
 st;%0A
-import org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A
 impo
@@ -177,972 +177,132 @@
 er;%0A
-import org.openqa.selenium.firefox.FirefoxDriver;%0Aimport org.openqa.selenium.phantomjs.PhantomJSDriver;%0Aimport org.sahagin.runlib.external.CaptureStyle;%0Aimport org.sahagin.runlib.external.TestDoc;%0Aimport org.sahagin.runlib.external.adapter.webdriver.WebDriverAdapter;%0A%0Apublic class ContactPageSampleTest %7B%0A%0A    @Test%0A    public void Firefox%E3%81%A7%E3%81%AE%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%E3%81%8C%E6%88%90%E5%8A%9F%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8() %7B%0A        WebDriver wd = new FirefoxDriver();%0A        WebDriverAdapter.setAdapter(wd);%0A        contact(wd);%0A        wd.quit();%0A    %7D%0A%0A    @Test%0A    public void Chrome%E3%81%A7%E3%81%AE%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%E3%81%8C%E6%88%90%E5%8A%9F%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8() %7B%0A        WebDriver wd = new ChromeDriver();%0A        WebDriverAdapter.setAdapter(wd);%0A        contact(wd);%0A        wd.quit();%0A    %7D%0A%0A    @Test%0A    public void PhantomJS%E3%81%A7%E3%81%AE%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%E3%81%8C%E6%88%90%E5%8A%9F%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8() %7B%0A        WebDriver wd = new PhantomJSDriver();%0A        WebDriverAdapter.setAdapter(wd);%0A        contact(wd);%0A        wd.quit();%0A    %7D%0A%0A    @TestDoc(value = %22%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%E3%82%92%E8%A1%8C%E3%81%86%22, capture=CaptureStyle.STEP_IN)%0A    private void contact(WebDriver wd) %7B
+%0Apublic class ContactPageSampleTest %7B%0A%0A    @Test%0A    public void %E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B%E3%81%8C%E6%88%90%E5%8A%9F%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8() %7B%0A        WebDriver wd = new ChromeDriver();
 %0A   
@@ -773,20 +773,39 @@
 )).click();%0A
+        wd.quit();%0A
     %7D%0A%7D%0A

make test simple