https://cypress.io logo
#vue
Title
# vue
l

late-waiter-93776

04/28/2022, 12:19 AM
I am getting this error that vue() custom method is not available, I am looking to test emitted events... anyone have an idea what I have missed?
Looks like I can create the custom command myself
r

rough-monitor-85122

04/28/2022, 12:31 AM
cy.vue()
isn't a default cypress command, yeah. What are you expecting it to do?
Is it defined somewhere else in your project that you were expecting it to work?
Sorry, just catching up on context here. Are you using
Copy code
Cypress.Commands.add('vue', () => {
  return cy.wrap(Cypress.vueWrapper);
});
like the blog post mentions?
l

late-waiter-93776

04/28/2022, 12:35 AM
I've seen it used already in some tutorials by Jessica Sachs and another documentation/tutorial I have been viewing/reading...didn't quite understand what they meant by custom command until now
r

rough-monitor-85122

04/28/2022, 12:35 AM
Ah, yeah. You can add commands to the
cy
object with
Cypress.add()
l

late-waiter-93776

04/28/2022, 12:35 AM
what blog post are you referring to, and yes that's what I want is the vueWrapper... thanks for replying back
r

rough-monitor-85122

04/28/2022, 12:36 AM
https://css-tricks.com/testing-vue-components-with-cypress/ was linked just up the channel a little ways.
I assumed that's where you got it. 🙂
l

late-waiter-93776

04/28/2022, 12:37 AM
ah actually I got it from the vuetify repo in their cypress folder, but they alias to
@wrapper
using a cy.get() in their vue command.. so I started investigating that.. LOL..
@best-toothbrush-1100 ☝🏻
2 Views