私はプレイ中のアプリケーションを開発しています。セレンテストでは、繰り返しタスクにいくつかのタグを使用します。二つのタグは以下のとおりです。再生1.2.2 - タグ内のタグは許可されなくなりましたか?
アプリ/ビュー/タグ/ loginAs.html
*{ Tag for running selenium tests when being logged in }*
#{if !_keepData}
#{braindumpFixture delete:'all', load:'users.yml' /}
#{/if}
#{selenium}
... some selenium code to log into the application
#{/selenium}
アプリ/ビュー/タグ/ braindumpFixture.html
%{
if(_delete == 'all') {
play.test.Fixtures.deleteAll()
} else if(_delete) {
play.test.Fixtures.delete(_delete)
}
}%
%{
if(_load) {
play.test.Fixtures.load(_load)
}
// finally make sure the index is correctly updated.
new application.jobs.CompleteReindexJob().doJob();
}%
問題ではなく、これらの作業1.1を再生します。 loginAsを使用してセレンのテストを実行するときに1.2.2を再生するために切り替えた後、私は次の例外を取得:
テスト/セレン/ AddCard.test.html
*{ Tests adding a simple card }*
#{loginAs login:'[email protected]', password:'foobar' /}
#{selenium}
open('@{Application.index()}')
... more selenium stuff here
#{/selenium}
例外ビーイング:
play.exceptions.TemplateExecutionException: Cannot get property 'data' on null object
at play.templates.BaseTemplate.throwException(BaseTemplate.java:84)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:252)
at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:374)
at /test/selenium/AddCard.test.html.(line:3)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:229)
at play.templates.Template.render(Template.java:26)
at play.templates.GroovyTemplate.render(GroovyTemplate.java:184)
at controllers.TestRunner.run(TestRunner.java:107)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:543)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:499)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:475)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:470)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException: Cannot get property 'data' on null object
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:229)
... 12 more
私はbraindumpFixtureへの呼び出しの周りに#{_keepDataあれば!}を削除すると、私はEmptyStackExceptionを得る:
play.exceptions.TemplateExecutionException
at play.templates.BaseTemplate.throwException(BaseTemplate.java:84)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:252)
at play.templates.Template.render(Template.java:26)
at play.templates.GroovyTemplate.render(GroovyTemplate.java:184)
at controllers.TestRunner.run(TestRunner.java:107)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:543)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:499)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:475)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:470)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
at Invocation.HTTP Request(Play!)
Caused by: java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:85)
at java.util.Stack.pop(Stack.java:67)
at play.templates.TagContext.exitTag(TagContext.java:31)
at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:380)
at /test/selenium/AddCard.test.html.(line:3)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:229)
... 9 more
Play 1.2のタグで根本的に何かが変わってしまったのか、ドキュメントでは見落としてしまったのか、それともバグかもしれないのかなと思います。この謎を解決するためのアイデアは大歓迎です。
は、我々はこれを見てもらえ:/test/selenium/AddCard.test.html.(line:3で)あなたはフィクスチャタグの修正版を作成することができます回避策として
? –私はそれを加えました。その行のタグを呼び出します。 –