Skip to content

fix(types): CustomLocator typing broken for custom strict locators #4120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
15 changes: 9 additions & 6 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ declare namespace CodeceptJS {
* }
* }
* ```
*/
*/
helpers?: {
/**
* Run web tests controlling browsers via Playwright engine.
Expand Down Expand Up @@ -289,7 +289,7 @@ declare namespace CodeceptJS {
* ```js
* bootstrap: 'bootstrap.js',
* ```
*/
*/
bootstrap?: (() => Promise<void>) | boolean | string;
/**
* [Execute code after tests](https://codecept.io/bootstrap/) finished.
Expand All @@ -303,7 +303,7 @@ declare namespace CodeceptJS {
* ```js
* teardown: 'teardown.js',
* ```
*/
*/
teardown?: (() => Promise<void>) | boolean | string;
/**
* [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
Expand All @@ -312,7 +312,7 @@ declare namespace CodeceptJS {
bootstrapAll?: (() => Promise<void>) | boolean | string;
/**
* [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
*/
*/
teardownAll?: (() => Promise<void>) | boolean | string;

/** Enable [localized test commands](https://codecept.io/translation/) */
Expand All @@ -328,7 +328,7 @@ declare namespace CodeceptJS {
* ```
* require: ["should"]
* ```
*/
*/
require?: Array<string>;

/**
Expand Down Expand Up @@ -423,15 +423,18 @@ declare namespace CodeceptJS {
| { ios: string }
| { android: string; ios: string }
| { react: string }
| { vue: string }
| { shadow: string[] }
| { custom: string };

interface CustomLocators {}
interface OtherLocators { props?: object }
type LocatorOrString =
| string
| ILocator
| Locator
| CustomLocators;
| OtherLocators
| CustomLocators[keyof CustomLocators];

type StringOrSecret = string | CodeceptJS.Secret;

Expand Down