我試圖用蓋布+斯波克做網絡自動化測試,但它一直告訴我:無法找到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