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

    ripe-student-91560

    09/09/2021, 4:16 PM
    oh awesome!
  • b

    bulky-sundown-74498

    09/09/2021, 4:17 PM
    We should probably make the readme links absolute
  • r

    ripe-student-91560

    09/09/2021, 4:18 PM
    Definitely. I never would have thought to look there, and the npm page is far higher on the search results
  • a

    adorable-state-61786

    09/20/2021, 3:36 PM
    Is anyone else having trouble rendering slots in the most recent version of cypress? I keep getting a 'Cannot convert undefined or null to object' whenever I try to mount a compliment like this:
    Copy code
    Mount(SlotTest, { 
      slots: { 
        default: 'slot content' 
      } 
    })
  • p

    plain-knife-50783

    10/08/2021, 2:51 AM
    I'm having this too. Help!!
  • p

    plain-knife-50783

    10/08/2021, 8:08 PM
    Hello guys. I have a component with a button which emits an event, but it does so from an async function. In my test I call Cypress.vueWrapper.emitted() but the event is never returned, even under the
    then
    after clicking the button which fires the event. Is there any way to capture an async emit?
    Copy code
    // MyComponent.vue
    const emitAsync = async () => {
      const x = await something();
      emit('myEvent', x);
    };
    
    // MyComponent.spec.js
    cy.get('.button-which-fires-my-event').click().then(() => {
      // Cypress.vueWrapper.emitted('myEvent') is always undefined 😢 
    })
  • a

    astonishing-football-22754

    11/02/2021, 7:08 PM
    Hey there, is anyone using Composition API with Vue3 and Component Test Runner? Since
    setData
    on
    vue-test-utils-next
    will not initialise any data that we define on the setup, is there a way of setting mocked data for a ref inside of a component (without using props)
  • b

    bulky-sundown-74498

    11/17/2021, 7:05 PM
    (click on the component?)
  • b

    bulky-sundown-74498

    11/17/2021, 7:08 PM
    @User You are right, thank you for reminding us. Unfortunately we did not set this up yet. We found it counter-intuitive to mock anything in our components so we put this for later.
  • b

    bulky-sundown-74498

    11/17/2021, 7:08 PM
    This could be an interesting debate to have in iteration number two. - Should we start with mocking dependencies? - Should we start with injecting the state
  • b

    better-piano-6669

    11/24/2021, 9:56 AM
    Hey all ✌️ Can you help me to get cypress component testing to work with jsx? I have attached my testfile "TestComponent.cy.jsx". The error is:
    Cannot read properties of undefined (reading 'props')
    It works when I mount my component like this:`mount(TestComponent)` Do you know what I am missing here? Let me know if you need further information.
  • b

    bored-nightfall-61392

    11/24/2021, 5:24 PM
    Try
    Copy code
    js
    mount(<TestComponent />)
      .get(textSelector)
      .should('be.visible')
  • b

    better-piano-6669

    11/25/2021, 6:50 AM
    Then it says 'h is not defined'
    b
    • 2
    • 8
  • b

    bored-nightfall-61392

    11/25/2021, 8:49 AM
    h is not defined
  • s

    salmon-oxygen-44652

    11/25/2021, 9:41 AM
    is there a right way to deal with v-model ?
  • b

    better-piano-6669

    12/02/2021, 6:34 AM
    What do you mean?
  • f

    fierce-arm-74985

    12/12/2021, 7:21 PM
    any 1 used cypresss new test runner with Quasar v1?
  • o

    orange-animal-45080

    12/22/2021, 3:42 PM
    Hi, i have an vue 3 app with components from Primevue for example a toast https://primefaces.org/primevue/showcase/#/toast I wanna write some component test with cypress how can I integrate dependencies from Primevue or is this possible?
  • s

    swift-glass-92692

    01/03/2022, 4:31 PM
    @User you can add plugins/extensions when mounting your component with the
    mount
    command. In this case, you would likely be adding
    PrimeVue
    here. The documentation here should help https://next.vue-test-utils.vuejs.org/api/#global
  • c

    colossal-horse-50990

    01/03/2022, 4:38 PM
    Hi all, I encountered a same issue as describe in stackoverflow https://stackoverflow.com/questions/69850493/issue-testing-components-with-slots-with-vue-and-cypress/ regarding mounting of slots. Here is a screenshot of the stacktrace.
  • s

    swift-glass-92692

    01/03/2022, 6:00 PM
    @User Looks like it matches up with an issue we have here: https://github.com/cypress-io/cypress/issues/18219 Can you try replacing the slot value with a render function as described in the issue?
  • t

    thankful-battery-80804

    01/05/2022, 5:52 PM
    Hello, I wanted to test nested comps with Cypress. The imports within the component are called using aliases
    Copy code
    import AppCard from '~/components/base/AppCard/AppCard.vue'
    However, when I run the test, no AppCard is rendered. No error is displayed. I assume that Cypress cannot reload the downstream components. How can I make this happen?
  • u

    user

    01/07/2022, 6:20 PM
    Hey all, just getting started with @cypress/vue library and I can't currently get cypress to recognize my vue files. The error I'm getting from cypress is saying: 'Error: Webpack Compilation Error ./src/components/activities/GanttTable.vue 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. > | | <div' Here is the current config file:
    Copy code
    const { startDevServer } = require('@cypress/webpack-dev-server')
    
    const webpackOptions = {
      module: {
        rules: [
          {
            test: /\.vue$/,
            use: { loader: 'vue-loader' }
          }
        ]
      }
    }
    const options = {
      webpackOptions,
      watchOptions: {}
    }
    module.exports = (on, config) => {
      on('dev-server:start', async () => startDevServer({ options }))
      require('@cypress/code-coverage/task')(on, config)
    
      return Object.assign({}, config, {
        fixturesFolder: 'tests/e2e/fixtures',
        integrationFolder: 'tests/e2e/specs',
        screenshotsFolder: 'tests/e2e/screenshots',
        videosFolder: 'tests/e2e/videos',
        supportFile: 'tests/e2e/support/index.js'
      })
    }
    Does anybody see what I am doing wrong?
  • u

    user

    01/11/2022, 4:32 PM
    I'm a total newbie here but I'm finding first of all you want to make sure to use version 9.0.0 (cypress@9.0.0) unfortunately I've been having problems with the newer versions.. Second, check your
    cypress.json
    file in your project directory. Perhaps since you're using vue templates you'll want to investigate how to have that file configured properly.
  • u

    user

    01/11/2022, 4:34 PM
    (it appears 9.2.1 is available today)
  • l

    loud-zebra-21352

    01/14/2022, 1:10 PM
    I'm testing a Paginator-Component which has a v-if on the outer tag to hide it if there is only one page. Can somebody help me how to test this?
  • l

    loud-zebra-21352

    01/14/2022, 1:11 PM
    I tried this ....
  • l

    loud-zebra-21352

    01/14/2022, 1:11 PM
    mount(Paginator, { props: { currentPage: 1, maxPage: 1, }) .vue() // custom command to get test-utils wrapper .then((wrapper) => { expect(wrapper.html()).to.eq('') })
  • l

    loud-zebra-21352

    01/14/2022, 1:12 PM
    but this is very hacky ..... I hop there is a better way 🙂
  • l

    loud-zebra-21352

    01/14/2022, 2:34 PM
    and another one ....
1...313233...37Latest