Closed websaid closed 4 years ago
Is there any way you can simplify your example so that we can run the code? Right now this code cannot be run as provided.
Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.
Please comment in this issue with a reproducible example and we will consider reopening the issue.
Current behavior:
When running a test from the gui via
npx cypress open
and command line vianpx cypress run
, custom commands behave different and will not work properly in the second case.Own Cypress Command (
cy.collectData
)cy.fixtures
calls which resolve their own promiseallSettled
, the output gets formed and returned viacy.wrap()
cy.wrap
, strangely not the whole object gets returned.VIA
npx cypress open
:-The code work perfect, I get the
console.log("OUTPUT:",output)
of thecy.collectData
before theconsole.log("RESULT:",result)
and i have the whole output objectVIA
npx cypress run
-The RESULT: gets logged before -I get an incomplete object, just the selectors object, the last object a
cy.fixture
function retrieved... -I get aCypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
Desired behavior:
The same behavior from run and open
Test code to reproduce
cy.collectData function call in a before hook:
Custom Command:
Versions
Cypress 4.2.0 Windows 10 Chrome 80