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.adapter.webdriver.WebDriverAdapter;

public class ContactPageSampleTest {
        
    @Test
    public void Firefoxでの問い合わせが成功すること() {
        WebDriver wd = new FirefoxDriver();
        WebDriverAdapter.setAdapter(wd);
        try {
            testMain(wd);
        } finally {
            wd.quit();
        }
    }
    
    @Test
    public void Chromeでの問い合わせが成功すること() {
        WebDriver wd = new ChromeDriver();
        WebDriverAdapter.setAdapter(wd);
        try {
            testMain(wd);
        } finally {
            wd.quit();
        }
    }
    
    @Test
    public void PhantomJSでの問い合わせが成功すること() {
        WebDriver wd = new PhantomJSDriver();
        WebDriverAdapter.setAdapter(wd);
        try {
            testMain(wd);
        } finally {
            wd.quit();
        }
    }
    
    private void testMain(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();
    }
}

@@ -342,32 +342,125 @@
 hantomJSDriver;%0A
+import org.sahagin.runlib.external.CaptureStyle;%0Aimport org.sahagin.runlib.external.TestDoc;%0A
 import org.sahag
@@ -552,24 +552,16 @@
 eTest %7B%0A
-        
 %0A    @Te
@@ -702,103 +702,46 @@
     
-try %7B%0A            testMain(wd);%0A        %7D finally %7B%0A            wd.quit();%0A        %7D
+contact(wd);%0A        wd.quit();
 %0A    %7D%0A
-    
 %0A   
@@ -884,103 +884,46 @@
     
-try %7B%0A            testMain(wd);%0A        %7D finally %7B%0A            wd.quit();%0A        %7D
+contact(wd);%0A        wd.quit();
 %0A    %7D%0A
-    
 %0A   
@@ -1072,103 +1072,109 @@
     
-try %7B%0A            testMain(wd);%0A        %7D finally %7B%0A            wd.quit();%0A        %7D%0A    %7D%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   
@@ -1191,16 +1191,15 @@
 oid 
-testMain
+contact
 (Web

improve sahagin report