Skip to content

Reading a value from a function for a Cypress test run #28182

Discussion options

You must be logged in to vote

It appears that you are having trouble retrieving the result from the functionForSpecificTableCell_Month2 in your fileWithObjects.js. The issue arises from the asynchronous nature of Cypress instructions and the promise handling.

You are returning a value from within an asynchronous.then() block in your fileWithObjects.js. When you return a value from within this block, the value from the functionForSpecificTableCell_Month2 function is not returned. Instead, it returns from the inner function supplied to.then() without passing the value to the outer function.

To manage the asynchronous behavior, you may utilize Cypress promises appropriately. You may return a Cypress promise from your fun…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by thepixelhead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants