https://cypress.io logo
Cy.origin with Custom Commands?
# i-need-help
e
Are we not able to do this? Im currently seeing errors when trying to implement this. Is there another way to achieve this?
c
The docs seem to indicate this is possible -> https://docs.cypress.io/api/commands/origin#Dependencies--Sharing-Code under custom commands. The example looks like it is importing the command in an origin block within the before block. Then, the origin block within the it block can access the commands.
e
Oh shit awesome! Thanks I missed that.
So that worked, but it still doesnt like
cy.intercept
within there haha
c
yea, I think later on in the same doc it says there are some limitations - and one is that intercept doesn't work
e
Ah my reading skills are shining bright today!
c
XD
5 Views