Skip to content
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

Add exhaustive types for waitFor commands. #3986

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

garg3133
Copy link
Member

@garg3133 garg3133 commented Jan 8, 2024

Fixes: #3981

Earlier, the typings for the waitFor commands were very restrictive due to which the formats which worked in JS were not working in TS.

This PR makes the types for the waitFor commands lenient so that everything that works in JS continues to work in TS, but at the added expense of not at all strict typings which could be error-prone for users (though the argument names have been constructed in a way to reduce this).

Other solution to this would have been to create an overload corresponding to every way the command can be used, but that would have led to way too many overloads for each waitFor command and would have been hard to manage.

@AutomatedTester AutomatedTester merged commit 06679a4 into nightwatchjs:main Jan 17, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

waitForElementPresent wrong ts types
2 participants