You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to improve in this area in regards to docs/code completion (such as VS Code IntelliSense)? Or is waitFor actually always returning a JSHandle even though selectorOrFunctionOrTimeout is a string?
If it always returns a JSHandle, is it recommended to actually use waitForSelector instead?
(Maybe the function should be removed completely and a new waitForTimeout would be better?)
The text was updated successfully, but these errors were encountered:
thernstig
changed the title
[Feature] waitFor() with string - return of JSHandle or ElementHandle
[Feature] waitFor() with string for selectorOrFunctionOrTimeout - return of JSHandle or ElementHandle
Apr 27, 2020
@pavelfeldman Great to see a change here. A question: Should waitForSelector() be deprecated instead and waitFor() be the same as waitForSelector() was?
I understand this is less than ideal with the actual name. But the reason I ask is that waitFor() is shorter and I've noticed that often using waitForSelector() wraps on a new line for the input (the selector) as it becomes longer (and if you use code formatters that only allow 80 chars width it is quite common it wraps).
@pavelfeldman Just wanted to see if you had any input on my last comment here. I'm not sure myself if a change is good, but good to get your reasoning around this as you are the expert.
https://github.com/microsoft/playwright/blob/master/docs/api.md#pagewaitforselectororfunctionortimeout-options-arg says it returns a
JSHandle
, but in case of the argumentselectorOrFunctionOrTimeout
being a string, the function is a shortcut forwaitForSelector
, which returns anElementHandle
.Is there any way to improve in this area in regards to docs/code completion (such as VS Code IntelliSense)? Or is
waitFor
actually always returning aJSHandle
even thoughselectorOrFunctionOrTimeout
is a string?If it always returns a
JSHandle
, is it recommended to actually usewaitForSelector
instead?(Maybe the function should be removed completely and a new
waitForTimeout
would be better?)The text was updated successfully, but these errors were encountered: