我试图用盖布+斯波克做网络自动化测试,但它一直告诉我:无法找到spock.lang.Specification
Caught: java.lang.NoClassDefFoundError: spock/lang/Specification
Caused by: java.lang.ClassNotFoundException: spock.lang.Specification
而且我觉得我已经添加的东西斯波克可能需要...?
@Grapes([
@Grab('org.gebish:geb-core:1.1.1'),
@Grab('org.seleniumhq.selenium:selenium-chrome-driver:2.42.0'),
@Grab('org.seleniumhq.selenium:selenium-support:2.42.0'),
@Grab('org.gebish:geb-spock:1.1.1')
])
import geb.spock.GebSpec
import spock.lang.*
class GoogleSpec extends GebSpec{
def "Google search"() {
given:
to GooglePage
when:
searchBox.value == "Dogs"
and:
searchButton.click()
then:
at ResultPage
}
}
我刚刚修复了您的语法突出显示。您的摘要是**而不是** JavaScript。 – kriegaex
ooops,谢谢!!!我没有注意到它。 – wipi