在_Events.groovy
中,我创建了一个测试类型:
//setup selenium test type
eventAllTestsStart = {
phasesToRun << "selenium"
}
def seleniumTestType = new JUnit4GrailsTestType('selenium', 'selenium', new GrailsTestMode(autowire: true))
seleniumTests = [seleniumTestType]
seleniumTestPhasePreparation = {
}
seleniumTestPhaseCleanUp = {
}
当我跑步时:
grails test-app selenium:
,我明白了:
Error executing script TestApp: java.lang.IllegalStateException: ApplicationContext
requested, but is not present in the build binding
这里发生了什么?
答案 0 :(得分:0)
看到那条autowire线?看起来很可疑,嗯?删除它。
//setup selenium test type
def seleniumTestType = new JUnit4GrailsTestType('selenium', 'selenium')
seleniumTests = [seleniumTestType]
seleniumTestPhasePreparation = {
unitTestPhasePreparation()
}
seleniumTestPhaseCleanUp = {
unitTestPhaseCleanUp()
}
eventAllTestsStart = {
phasesToRun << "selenium"
}