@@ -11,6 +11,23 @@ const path = require('path');
11
11
const template = `
12
12
type ICodeceptCallback = (i: CodeceptJS.{{I}}) => void;
13
13
14
+ declare class FeatureConfig {
15
+ retry(integer): FeatureConfig
16
+ timeout(integer): FeatureConfig
17
+ config(object): FeatureConfig
18
+ config(string, object): FeatureConfig
19
+ }
20
+
21
+ declare class ScenarioConfig {
22
+ throws(any) : ScenarioConfig;
23
+ fails() : ScenarioConfig;
24
+ retry(integer): ScenarioConfig
25
+ timeout(integer): ScenarioConfig
26
+ inject(object): ScenarioConfig
27
+ config(object): ScenarioConfig
28
+ config(string, object): ScenarioConfig
29
+ }
30
+
14
31
interface ILocator {
15
32
xpath?: string;
16
33
css?: string;
@@ -21,14 +38,37 @@ interface ILocator {
21
38
ios?: string;
22
39
}
23
40
41
+ declare class Locator implements ILocator {
42
+ or(locator): Locator;
43
+ find(locator): Locator;
44
+ withChild(locator): Locator;
45
+ find(locator): Locator;
46
+ at(position): Locator;
47
+ first(): Locator;
48
+ last(): Locator;
49
+ inside(locator): Locator;
50
+ before(locator): Locator;
51
+ after(locator): Locator;
52
+ withText(text): Locator;
53
+ withAttr(attr): Locator;
54
+ as(output): Locator;
55
+ }
56
+
24
57
declare const actor: () => CodeceptJS.{{I}};
25
- declare const Feature: (string: string) => void ;
26
- declare const Scenario: (string: string, callback: ICodeceptCallback) => void ;
58
+ declare const Feature: (string: string) => FeatureConfig ;
59
+ declare const Scenario: (string: string, callback: ICodeceptCallback) => ScenarioConfig ;
27
60
declare const Before: (callback: ICodeceptCallback) => void;
28
61
declare const BeforeSuite: (callback: ICodeceptCallback) => void;
29
62
declare const After: (callback: ICodeceptCallback) => void;
30
63
declare const AfterSuite: (callback: ICodeceptCallback) => void;
31
- declare const within: (selector: string, callback: Function) => void;
64
+ declare const locate: (selector: string) => Locator;
65
+ declare const locate: (selector: ILocator) => Locator;
66
+ declare const within: (selector: string, callback: Function) => Promise;
67
+ declare const within: (selector: ILocator, callback: Function) => Promise;
68
+ declare const session: (selector: string, callback: Function) => Promise;
69
+ declare const session: (selector: ILocator, callback: Function) => Promise;
70
+ declare const session: (selector: string, config: any, callback: Function) => Promise;
71
+ declare const session: (selector: ILocator, config: any, callback: Function) => Promise;
32
72
33
73
declare namespace CodeceptJS {
34
74
export interface {{I}} {
0 commit comments