Class: Template
Object: GlobalOptions
默认的模板全局配置项。
env
<web
|wxapp
> 运行环境cliPath?
<string
> Chromium 或 Chrome 可执行文件的路径(web
环境)/ 开发者工具命令行工具绝对路径(wxapp
环境)projectPath?
<string
> 项目绝对路径headless?
<boolean
> 是否开启无头模式proxy?
<boolean
> 是否启动本地代理服务pageUrl?
<string
> 目标页面路由
Object: SpecOptions
默认的用例配置项。
name
<string
> 用例名
Object: ConfigOptions
默认的快捷配置项。
...global
<GlobalOptions> 全局配置对象展开plugins
<TemplatePlugin> 插件组specs
<SpecOptions[]> 用例配置组
Object: TemplateStore
模板实例上下文。
global
<GlobalOptions> 全局配置app
<App|null
> 当前App
实例page
<Page|null
> 当前Page
实例specs
<SpecOptions[]> 用例配置组
Object: TemplateResult
模板用例执行结果。
failed
<number
> 失败用例数passed
<number
> 成功用例数total
<number
> 总用例数
template.plugin(Plugin)
挂载单个模板插件。
Since:
1.2.0
Arguments:
Plugin
<TemplatePlugin> 模板插件类
Returns: <Template>
template.global(options)
注入全局配置,包括 SDK 启动参数等等。
Since:
1.2.0
Arguments:
options
<GlobalOptions> 全局配置
Returns: <Template>
template.spec(options)
注入单个测试用例配置。
Since:
1.2.0
Arguments:
options
<SpecOptions> 测试用例配置
Returns: <Template>
template.config(options)
注入所有配置的快捷入口。
Since:
1.2.0
Arguments:
options
<ConfigOptions> 所有配置
Returns: <Template>
template.exec()
运行测试用例模板。
Since:
1.2.0
Returns: <
Promise
<TemplateResult>>