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
After updating to CodeceptJS version 3.6.10 (also occurring in 3.7.0), we noticed that the within functionality no longer works correctly when used with a selector like .modal-dialog. Instead of setting the context to a page or frame object, it sets it to a locator object, which causes an error when trying to execute certain functions.
The error encountered:
context.waitForFunction is not a function
This error occurred in the waitForEnabled function, which expects context to be a page object, but instead it is passed as a locator because of the changes introduced with: #4557
Other helper functions that we found that produce the same error: waitForDisabled, waitNumberOfVisibleElements, waitForValue.
We also observed other functions like waitForText not working correctly inside within (e.g. not finding text inside the within context although it was obviously there).
Specifically this line in the _getContext function breaks this use case, since it now returns this.context even if it is a locator object:
Description
After updating to CodeceptJS version
3.6.10
(also occurring in3.7.0
), we noticed that thewithin
functionality no longer works correctly when used with a selector like.modal-dialog
. Instead of setting the context to a page or frame object, it sets it to a locator object, which causes an error when trying to execute certain functions.The error encountered:
This error occurred in the waitForEnabled function, which expects context to be a page object, but instead it is passed as a locator because of the changes introduced with: #4557
Other helper functions that we found that produce the same error:
waitForDisabled, waitNumberOfVisibleElements, waitForValue
.We also observed other functions like waitForText not working correctly inside within (e.g. not finding text inside the within context although it was obviously there).
Specifically this line in the
_getContext
function breaks this use case, since it now returns this.context even if it is a locator object:Everything worked fine again after reverting the changes that were introduced by this commit.
Steps to Reproduce
within
function with a selector such as.modal-dialog
.within
block, likewaitForEnabled
.Example test case:
Details
The text was updated successfully, but these errors were encountered: