前提・実現したいこと
試験結果をgeb reportでWEBブラウザのキャプチャ保存をしていますが、同じ試験を実行すると、前回のキャプチャ保存データがフォルダごと、自動的に消去されるため、消去されないようにしたい。(他のテストを行う分には、消去されずに残っている。)
発生している問題
同じテストを繰り返し実行するために、私はeclipseの[実行]-[実行構成]で同じテストを複数追加して実行構成を作成し実施しています。
この方法で実施したとき、最終回に実施したキャプチャ保存データしか残らないため、全ての試験結果が確認できません。そこで、下記どちらかで良いので、分かれば教えください。
1)geb reportで前回結果を残しながら新しいし結果も保存する方法を教えてください。
2)同じテストを繰り返し実施する方法がこの方法しか知らないため。ほかに良い方法があれば教えてください。
該当のソースコード
■テストコード:GebSampleTest.groovy
geb
1package firefox01 2 3import org.junit.Test 4import org.openqa.selenium.Dimension 5import geb.junit4.GebReportingTest 6 7class GebSampleTest extends GebReportingTest { 8 @Test 9 void 宿泊予約が成功すること() { 10 go("http://example.selenium.jp/reserveApp") 11 driver.manage().window().setSize(new Dimension(900, 1000)) 12 $("#guestname").value("サンプルユーザ") 13 sleep(3000) 14 $("#goto_next").click() 15 sleep(3000) 16 report "result" 17 } 18}
■GebConfig.groovy
import org.openqa.selenium.Dimension import org.openqa.selenium.firefox.FirefoxDriver //GebReportingTest:レポート出力のために必要な設定 //The Book Of Geb : http://www.gebish.org/manual/current/#reports-directory-configuration reportsDir = "target/geb-reports" //The Book Of Geb : http://www.gebish.org/manual/current/#report-test-failures-configuration reportOnTestFailureOnly = true //FireFox - https://github.com/mozilla/geckodriver/releases System.setProperty("webdriver.gecko.driver","./driver/geckodriver.exe") driver = { def driver = new FirefoxDriver() //driver.manage().window().maximize() driver.manage().window().setSize(new Dimension(1280, 1024)) driver } baseUrl = "http://localhost/"
補足情報(FW/ツールのバージョンなど)
環境 OS:Windows7 64bit / 統合開発環境:eclipse photon / プログラム言語:groovy-all 2.4.15 / 実行:Junit4
あなたの回答
tips
プレビュー