https://cypress.io logo
Join Discord
Powered by
# vue
  • s

    some-air-72294

    05/17/2021, 7:55 PM
    The test renders correctly and doesn't through the error after click anymore but now i have a "BootstrapVue warn" for multiple instances of vue detected. I think it may be because i'm using
    @vue/test-utils
    when i
    createLocalVue
    but if i try to use
    @cypress/vue
    for it i get error
    createLocalVue
    is not a function.
  • s

    some-air-72294

    05/17/2021, 7:56 PM
    Only thing is, i'm still not taking advantage of the global setup to prevent having to do this in every file.
  • s

    stocky-dream-36427

    05/18/2021, 5:12 AM
  • s

    stocky-dream-36427

    05/18/2021, 5:12 AM
    Yeah, createLocalVue isn't a function... hmmm...
  • s

    stocky-dream-36427

    05/18/2021, 5:13 AM
    Yeah. I see why that would happen. I don't have a recipe for you right now.
  • m

    melodic-father-50900

    05/18/2021, 12:49 PM
    @User Do you know how to migrate v1 (alpha) usage of
    Vue.nextTick
    ?
  • s

    stocky-dream-36427

    05/18/2021, 5:01 PM
    To Cypress component testing? You don’t need to write it at all. Just delete the line. Cypress has retry ability built in and nextTick is an implementation detail of Vue.
  • b

    breezy-australia-64868

    05/19/2021, 4:28 PM
    anyone know how to use the Vue devtools with component testing, if it's even possible?
  • s

    some-air-72294

    05/19/2021, 4:31 PM
    I don't think so due to iframe. There is a feature request open that may make it work with many solutions like this and storybook https://github.com/vuejs/vue-devtools/issues/353
  • s

    some-air-72294

    05/19/2021, 4:37 PM
    Also https://github.com/vuejs/vue-devtools/pull/361
  • b

    breezy-australia-64868

    05/19/2021, 4:40 PM
    gotcha - thanks!
  • s

    stocky-dream-36427

    05/19/2021, 7:07 PM
    @User @User we spent 3 weeks on integrating Vue Devtools in-browser because of the iframe issue, but ran into performance issues within Vue itself.
  • s

    stocky-dream-36427

    05/19/2021, 7:07 PM
    I would wait to retry with vue-devtools-next once it's ready.
  • s

    some-air-72294

    05/19/2021, 7:24 PM
    πŸ‘
  • s

    stocky-dream-36427

    05/19/2021, 7:50 PM
    We honestly find that you don't need it.
  • s

    stocky-dream-36427

    05/19/2021, 7:51 PM
    Do you know how to debug components and their props within Cypress and the devtools?
  • s

    stocky-dream-36427

    05/19/2021, 7:51 PM
    just put a debugger in a computed, etc it and you're good to go.
  • s

    some-air-72294

    05/19/2021, 8:02 PM
    I haven't needed it. I looked for it a while back when I was learning more about TDD on the front-end and realize I couldn't use- vue-dev-tools. since then i've learned to live without it and have been focused on gettingg more clear/consistent with front-end automated testing
  • b

    breezy-australia-64868

    05/19/2021, 9:20 PM
    that's a neat trick - haven't done that. I've just been console logging cypress.vue and i try not to access that too much anyways. just thought it would be nice to use the devtools but it seems like they're a pain to integrate anywhere
  • w

    wonderful-match-15836

    05/19/2021, 9:29 PM
    There's one other thing I sometimes do that I didn't know about for a long time, which is access
    document.querySelector("#app").__vue__
    in the console for the frame. Combined with a .pause() before a failing assertion, you can get quick access to a lot of the stuff you might typically be inspecting with dev tools
  • s

    stocky-dream-36427

    05/19/2021, 11:26 PM
    You can also get the wrapper pretty easily which gives you access to a lot.
  • s

    stocky-dream-36427

    05/19/2021, 11:26 PM
    Here's an alias I wrote for the vuetify suite... https://github.com/JessicaSachs/vuetify/pull/2/files#diff-88e2b3923da43aba6da1ce98fcbc8eb33f3a94fea246b2860e6624ccd4ab6febL12
    Copy code
    js
    import { mount as cyMount } from '@cypress/vue'
    import { createVuetify } from '../../src/entry-bundler'
    
    Cypress.Commands.add('mount', (component, options, vuetifyOptions) => {
      const vuetify = createVuetify(vuetifyOptions)
      const defaultOptions = {
        global: {
          plugins: [vuetify],
        },
      }
    
      return cyMount(component, { ...defaultOptions, ...options }).as('wrapper')
    })
  • m

    melodic-father-50900

    05/26/2021, 5:57 AM
    I feel I wasted your time. That works on Cypress 7.4.0 and I was on an old version! Thanks for the help!
  • m

    melodic-father-50900

    05/26/2021, 6:32 AM
    Oh my I even found a bug now that we don't need
    Vue.nextTick
    anymore 😱
  • g

    gorgeous-refrigerator-7329

    05/26/2021, 12:35 PM
    Hello. Excited about adding component testing to our vue2 library. Is there a way to use rollup instead of webpack for component testing? Perhaps using @cypres/rollup-dev-server?
  • b

    bulky-sundown-74498

    05/26/2021, 1:04 PM
    You could try using vite dev server
  • b

    bulky-sundown-74498

    05/26/2021, 1:04 PM
    All plugins are supersets of rollups
  • s

    stocky-dream-36427

    05/26/2021, 7:33 PM
    @User vite should be a superset of rollup, so you should be good to go
  • s

    stocky-dream-36427

    05/26/2021, 7:33 PM
    @cypress/vite-dev-server
    I suggest trying it from scratch to see how it works with your build πŸ™‚
  • s

    stocky-dream-36427

    05/26/2021, 7:33 PM
    and then adding it into your project following the docs
1...252627...37Latest