Can't use variables in Command callback if options exist #1089
Labels
stage: wontfix
Cypress does not regard this as an issue or will not implement this feature
type: question
Is this a Feature or Bug?
Bug
Current behavior:
variables in Command callback are ignored when
{prevSubject: <options>}
existsi.e.:
cy.clickNavLink('sales')
returnsGET [data-test="undefined-home-tile"]
but
cy.clickNavLink('sales')
returnsGET [data-test="sales-home-tile"]
Desired behavior:
variables in a callback are respected when
prevSubject
is presentHow to reproduce:
create a
Cypress.Command
withprevSubject: 'optional'
variable and variable in callback.Test code:
./support/commands.js
./integration/test_example_links.js
I know the test will fail because there's multiple, but really you just need to see that it returns
undefined
instead of the variable passed into the callback.I'll throw a repo together tonight if needed but this is pretty straightforward to test.
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: