【问题标题】:Error executing script TestApp: ApplicationContext requested, but is not present in the build binding执行脚本 TestApp 时出错:请求了 ApplicationContext,但在构建绑定中不存在
【发布时间】:2011-07-27 04:51:18
【问题描述】:

_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

这是怎么回事?

【问题讨论】:

    标签: grails groovy selenium grails-plugin


    【解决方案1】:

    看到那条自动连线了吗?看起来很可疑,嗯?删除它。

    //setup selenium test type
    def seleniumTestType = new JUnit4GrailsTestType('selenium', 'selenium')
    seleniumTests = [seleniumTestType]
    seleniumTestPhasePreparation = {
        unitTestPhasePreparation()
    }
    seleniumTestPhaseCleanUp = {
        unitTestPhaseCleanUp()
    }
    
    eventAllTestsStart = {
        phasesToRun << "selenium"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-08
      • 2015-11-29
      • 2020-03-21
      • 1970-01-01
      相关资源
      最近更新 更多