gray-kilobyte-89541
06/27/2022, 4:27 PMsilly-journalist-41771
06/27/2022, 7:02 PMsilly-journalist-41771
06/27/2022, 7:02 PMsilly-journalist-41771
06/27/2022, 7:02 PMsilly-journalist-41771
06/27/2022, 7:03 PMlate-planet-4481
06/27/2022, 7:19 PMcheckout
class? That's surely where your problem lies. I might not be much help myself (I know how to chain custom cy
commands, but I fumble through js promises), but I bet someone else would be able to spot the issue.silly-journalist-41771
06/27/2022, 7:20 PMsilly-journalist-41771
06/27/2022, 7:20 PMsilly-journalist-41771
06/27/2022, 7:20 PMsilly-journalist-41771
06/27/2022, 7:20 PMlate-planet-4481
06/27/2022, 7:21 PMsilly-journalist-41771
06/27/2022, 7:21 PMsilly-journalist-41771
06/27/2022, 7:21 PMsilly-journalist-41771
06/27/2022, 7:21 PMsilly-journalist-41771
06/27/2022, 7:21 PMsilly-journalist-41771
06/27/2022, 7:22 PMlate-planet-4481
06/27/2022, 7:22 PMcy
command you ran is what is yielded by your custom command. So that can be cy.wrap()
or can even be cy.get()
. It's whatever you invoked last.silly-journalist-41771
06/27/2022, 7:24 PMsilly-journalist-41771
06/27/2022, 7:24 PMsilly-journalist-41771
06/27/2022, 7:24 PMsilly-journalist-41771
06/27/2022, 7:25 PMsilly-journalist-41771
06/27/2022, 7:25 PMlate-planet-4481
06/27/2022, 7:25 PMprevSubject: true
is what makes your command chainable. It means it will accept the yield of the previous command in place of the first argument in the list. In this case that's subject
.silly-journalist-41771
06/27/2022, 7:26 PMlate-planet-4481
06/27/2022, 7:27 PMcy.wrap()
might not be necessary. It depends on what was yielded. If it yielded a cypress object then you don't need cy.wrap()
. cy.wrap()
would be needed if something agnostic like a string were passed in.late-planet-4481
06/27/2022, 7:27 PMsilly-journalist-41771
06/27/2022, 7:27 PMsilly-journalist-41771
06/27/2022, 7:28 PMsilly-journalist-41771
06/27/2022, 7:28 PMsilly-journalist-41771
06/27/2022, 7:28 PM