forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cucumber.d.ts
57 lines (46 loc) · 1.85 KB
/
cucumber.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Type definitions for cucumber-js
// Project: https://github.com/cucumber/cucumber-js
// Definitions by: Abraão Alves <https://github.com/abraaoalves>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../es6-promise/es6-promise.d.ts" />
declare module cucumber {
export interface CallbackStepDefinition{
pending : () => Thenable<any>;
(errror?:any):void;
}
interface StepDefinitionCode {
(...stepArgs: Array<string |CallbackStepDefinition>): Thenable<any> | any | void;
}
interface StepDefinitionOptions{
timeout?: number;
}
export interface StepDefinitions {
Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
Given(pattern: RegExp | string, code: StepDefinitionCode): void;
When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
When(pattern: RegExp | string, code: StepDefinitionCode): void;
Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
Then(pattern: RegExp | string, code: StepDefinitionCode): void;
setDefaultTimeout(time:number): void;
}
interface HookScenario{
attach(text: string, mimeType?: string, callback?: (err?:any) => void): void;
isFailed() : boolean;
}
interface HookCode {
(scenario: HookScenario, callback?: CallbackStepDefinition): void;
}
interface AroundCode{
(scenario: HookScenario, runScenario?: (error:string, callback?:Function)=>void): void;
}
export interface Hooks {
Before(code: HookCode): void;
After(code: HookCode): void;
Around(code: AroundCode):void;
setDefaultTimeout(time:number): void;
registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void;
}
}
declare module 'cucumber'{
export = cucumber;
}