nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.85k stars 1.34k forks source link

Improve TSDoc for page object's url property. #4297

Closed garg3133 closed 2 weeks ago

garg3133 commented 2 weeks ago

Fixes: #3903

There is actually no issue with the type of the url property here, the issue linked above is more of a documentation issue.

By default, the url property is set to a string type here. To set it to a function type instead, the fifth type parameter of the EnhancedPageObject interface can be used:

export interface MyPage extends
  EnhancedPageObject<{}, typeof elements, {}, {}, () => string> {}

See the usage of the EnhancedPageObject interface here for reference.