🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## Cucumber API 每个方法都可以从require('cucumber')返回的对象中获得。 函数 ``` export function After(code: HookCode): void; export function After(options: HookOptions | string, code: HookCode): void; export function AfterAll(code: GlobalHookCode): void; export function AfterAll(options: HookOptions | string, code: GlobalHookCode): void; export function Before(code: HookCode): void; export function Before(options: HookOptions | string, code: HookCode): void; export function BeforeAll(code: GlobalHookCode): void; export function BeforeAll(options: HookOptions | string, code: GlobalHookCode): void; export function defineParameterType(transform: Transform): void; export function defineStep(pattern: RegExp | string, code: StepDefinitionCode): void; export function defineStep(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; export function Given(pattern: RegExp | string, code: StepDefinitionCode): void; export function Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; export function setDefaultTimeout(time: number): void; export function setDefinitionFunctionWrapper(fn: () => void, options?: {[key: string]: any}): void; // tslint:disable-next-line ban-types export function setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; export function Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; export function Then(pattern: RegExp | string, code: StepDefinitionCode): void; export function When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; export function When(pattern: RegExp | string, code: StepDefinitionCode): void; ``` ## After 表示在每个场景结束后执行 ## AfterAll 表示在所有场景接收后执行 ## setDefaultTimeout 定义异步执行的超时时间