Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions lib/command/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,46 @@ interface ILocator {
ios?: string;
}

declare class Helper {
/** Abstract method to provide required config options */
static _config(): any;
/** Abstract method to validate config */
_validateConfig<T>(config: T): T;
/** Sets config for current test */
_setConfig(opts: any): void;
/** Hook executed before all tests */
_init(): void
/** Hook executed before each test. */
_before(): void
/** Hook executed after each test */
_after(): void
/**
* Hook provides a test details
* Executed in the very beginning of a test
*/
_test(test): void
/** Hook executed after each passed test */
_passed(test: () => void): void
/** Hook executed after each failed test */
_failed(test: () => void): void
/** Hook executed before each step */
_beforeStep(step: () => void): void
/** Hook executed after each step */
_afterStep(step: () => void): void
/** Hook executed before each suite */
_beforeSuite(suite: () => void): void
/** Hook executed after each suite */
_afterSuite(suite: () => void): void
/** Hook executed after all tests are executed */
_finishTest(suite: () => void): void
/**Access another configured helper: `this.helpers['AnotherHelper']` */
Comment thread
Akxe marked this conversation as resolved.
get helpers(): any
/** Print debug message to console (outputs only in debug mode) */
debug(msg: string): void

debugSection(section: string, msg: string): void
}

declare class Locator implements ILocator {
xpath?: string;
css?: string;
Expand All @@ -64,8 +104,12 @@ declare class Locator implements ILocator {

declare function actor(customSteps?: {}): CodeceptJS.{{I}};
declare function Feature(title: string, opts?: {}): FeatureConfig;
declare function Scenario(title: string, callback: ICodeceptCallback): ScenarioConfig;
declare function Scenario(title: string, opts: {}, callback: ICodeceptCallback): ScenarioConfig;
declare const Scenario: {
(title: string, callback: ICodeceptCallback): ScenarioConfig;
(title: string, opts: {}, callback: ICodeceptCallback): ScenarioConfig;
only(title: string, callback: ICodeceptCallback): ScenarioConfig;
only(title: string, opts: {}, callback: ICodeceptCallback): ScenarioConfig;
}
declare function xScenario(title: string, callback: ICodeceptCallback): ScenarioConfig;
declare function xScenario(title: string, opts: {}, callback: ICodeceptCallback): ScenarioConfig;
declare function Data(data: any): any;
Expand Down