函数名 | 介绍 | 说明 | 返回 |
---|---|---|---|
__construct($label = false) | $label测试用例的名称 | 如果未指定,将使用类名 | void |
setUp | setUp运行于每个测试方法运行之前调用 | ||
tearDown | tearDown运行于每个测试方法运行之后调用 | ||
showRequest | 显示请求参数 | void | |
showHeaders | 显示请求头 | ||
showSource | 显示html | ||
showText | 显示text | ||
getUrl | void | 返回当前url | |
getSize | |||
函数名 | 介绍 | 说明 | 返回 |
---|---|---|---|
get | ($url, $parameters = false) | get打开网址 | page |
post | ($url, $parameters = false, $content_type = false) | post请求 | |
put | ($url, $body = false, $content_type = false) | put请求 | |
delete | ($url, $parameters = false) | ||
head | ($url, $parameters = false) | ||
addHeader | ($header) | 添加请求头 | |
函数名 | 参数 | 介绍 | 说明 | 返回 |
---|---|---|---|---|
click | ($label) | 单击可见的文本 | 首先尝试button,然后是link,然后是img | page/false |
clickSubmit | ($label=’Submit’, $additional = false) | 单击submit button,提交所有form | page/false | |
clickSubmitByName | ($name, $additional = false) | |||
clickSubmitById | - | |||
clickImage | ($label, $x = 1, $y = 1, $additional = false) | |||
clickImageByName | - | |||
clickImageById | - | |||
submitFormById | ($id, $additional = false) | |||
clickLink | ($label, $index = 0) | |||
clickLinkById | ($id) | |||
函数名 | 参数 | 介绍 | 说明 | 返回 |
---|---|---|---|---|
assertTrue | ($result, $message = ‘%s’) | 断言true | ||
assertFalse | ||||
assertEqual | ($first, $second, $message = ‘%s’) | 断言相等 | ||
assertNotEqual | 断言不相等 | |||
assertTitle | ($title = false, $message = ‘%s’) | 测试标题标记之间的文本相等 | $message要显示的消息 | true/false |
assertResponse | ($responses, $message = ‘%s’) | 断言get、post等结果 | 200… | |
assertField | ($label, $expected = true, $message = ‘%s’) | 断言表单字段 | ||
assertFieldByName | 断言表单字段名下值 | |||
assertFieldById | ||||
assertFieldValue | ||||
assertLink
assertNoLink
assertLinkById
assertNoLinkById
assertMime
assertAuthentication
assertNoAuthentication
assertRealm
assertHeader
assertNoHeader
assertText
assertNoText
assertPattern
assertNoPattern
assertCookie
assertNoCookie
assertClickable
assertSubmit
assertImage
before
after
getBrowser
setBrowser
setParser
unsetBrowser
createBrowser
getTransportError
restart
ignoreErrors
failOnError
setMaximumRedirects
setConnectionTimeout
useProxy
retry
back
forward
authenticate
getAssertionLine
getLabel
skip
skipIf
shouldSkip
skipUnless
createInvoker
run
getTests
isTest
tell
pass
fail
error
exception
signal
assert
escapePercentageSignsExceptFirst
dump
setField
setFieldByName
setFieldById
ignoreFrames 关闭frames支持
getFrameFocus
setFrameFocusByIndex
setFrameFocus
clearFrameFocus 清除frame焦点
ageCookies($interval) 过期时间
ignoreCookies 关闭cookie发送和接收
getCookie($name)
setCookie($name, $value, $host = false, $path = '/', $expiry = false) 设置cookie