Skip to content

Commit

Permalink
add types for TestController.customActions property (#7440)
Browse files Browse the repository at this point in the history
## Purpose
TestController.customActions property doesn't have types definitions. 

## References
#7393

## Pre-Merge TODO
- [ ] Make sure that existing tests do not fail
  • Loading branch information
Artem-Babich committed Dec 27, 2022
1 parent 770f1a1 commit 6fb1727
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/configuration/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ interface GlobalHooks {
request?: typeof RequestHook[] | typeof RequestHook;
}

type CustomActions = { [name: string]: () => void }

// eslint-disable-next-line @typescript-eslint/no-unused-vars
type OptionValue = undefined | null | string | boolean | number | string[] | Function | { [key: string]: any } | ScreenshotOptionValue | QuarantineOptionValue | CompilerOptions | GlobalHooks | SkipJsErrorsOptionValue | CustomActions;
8 changes: 8 additions & 0 deletions ts-defs-src/test-api/test-controller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ interface WindowFilterData {
url: URL;
}

interface CustomActions {
[key: string]: (...args: any[]) => TestControllerPromise
}

type ScrollPosition = 'top' | 'right' | 'bottom' | 'left' | 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft' | 'center';

interface TestController {
Expand All @@ -112,6 +116,10 @@ interface TestController {
* Returns an object that contains browser information.
*/
readonly browser: Browser;
/**
* Returns an object that contains registered custom actions.
*/
readonly customActions: CustomActions;
/**
* Dispatches an event over a specified webpage element.
*
Expand Down

0 comments on commit 6fb1727

Please sign in to comment.