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

    red-refrigerator-13075

    04/16/2021, 2:55 PM
    By the way, do you guys have any plans to have sub-sections like Vue/React/Angular inside the Component testings docs? because there could be some tricks (like the vue() command from Jess) to settings up some tools with cypress ct in each framework and trying to address those tricks on those sections could help others to speed up their work.
  • b

    bulky-sundown-74498

    04/16/2021, 3:17 PM
    This is a very good idea indeed @User & @User are our docs gurus right now. They are rolling out the new version of the docs and are ironing out the last tech details. Once they are done, we will definitely add some How-tos and classical tests in those sections
  • s

    some-air-72294

    04/21/2021, 8:27 PM
    I have what may be a strange test idea....but in the process of learning cypress, i'm trying to write test for everything I might normally check visually. I have a password field and want to verify that input is masked. I found the awesome "Overwrite-type-command" example that can be used to mask text from input. But I'm not concerned if someone sees the password in the console of the test runner. All my dev test use easy passwords like admin/password because they don't connect to anything production. I'm trying to verify that when a user enters input, the text is masked. Here is what i have so far:
    Copy code
    cy.get('input').should('exist')
        cy.get('input').type('nicepass', { delay: 500 })
        cy.get('input').should('include.text', '********')
    The test fails and says text was '' even though i see the mask. If I replace
    include.text
    with
    include.value
    i get the value. I can see my input text is masked, but i'm trying to get the test to be my eyes. Is this possible considering all the different ways (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password) the mask might look?
  • b

    bulky-sundown-74498

    04/21/2021, 8:32 PM
    Are you trying to test that the type of input (use
    cy.get().then()
    and check the attibute) is actually
    password
    or that it visually looks like star (use visial regression tools like percy or consorts)? Maybe are you trying to check that human eyes could not read it? In this case natural reading algorythms might have to be involved after screenshot. but I would qualify this as overkill
  • s

    some-air-72294

    04/21/2021, 8:34 PM
    I didn't think about it clearly.....testing for the password attribute is technically all i need since the stars/astrics are built into the browser?
  • s

    some-air-72294

    04/21/2021, 8:35 PM
    I should be using
    use cy.get().then()
    considering all i want to verify is input is masked by the browser and the browser will do it if the attribute is correct?
  • b

    bulky-sundown-74498

    04/21/2021, 8:35 PM
    exact
  • s

    stocky-dream-36427

    04/21/2021, 8:36 PM
    If you want extra "how it looks to my eyes" support you can always hook up visual regression testing with something like Percy
  • b

    bulky-sundown-74498

    04/21/2021, 8:36 PM
    If in the future you choose to bake your own microsoft style crazy password field, it will be time to review the test
  • s

    stocky-dream-36427

    04/21/2021, 8:37 PM
    else, you can check for
    cy.get('input[type=password]').should('be.visible')
    (or something like that)
  • s

    stocky-dream-36427

    04/21/2021, 8:37 PM
    or .should('have.attr', 'type', 'password') // I might be butchering this API, but that's the general idea
  • s

    some-air-72294

    04/21/2021, 8:39 PM
    Thank you both!
  • b

    bulky-sundown-74498

    04/21/2021, 8:42 PM
    UrWelcom
  • w

    witty-kite-3465

    04/24/2021, 9:07 AM
    Hi! 👋 I'm trying out component testing with vite and tailwind and everything seems to work well except the components are completely unstyled in the test runner. Has anyone else run into this? I'm guessing I might have to do something similar to https://github.com/JessicaSachs/cypress-loves-vite/blob/develop/cypress/plugins/index.js but I'm a bit lost since I'm not using windi
  • w

    witty-kite-3465

    04/24/2021, 11:14 AM
    does this mean it's not supported? https://github.com/cypress-io/cypress/issues/15992 I've tried with and without JIT mode and it makes no difference from what I can see
  • w

    witty-kite-3465

    04/24/2021, 11:40 AM
    Importing the index.css file in the test file seems to work though 🤔
  • w

    witty-kite-3465

    04/24/2021, 12:08 PM
    Now I found https://discord.com/channels/755913899261296641/755921564108587038/835302764804177930 and https://github.com/elevatebart/cy-vuecli-tailwind/blob/main/cypress/support/index.js which solves my problem nicely. Sorry for the spam 🤦
  • s

    stocky-dream-36427

    04/24/2021, 1:48 PM
    Lol, no problem.
  • q

    quick-gpu-68223

    04/25/2021, 8:14 AM
    I wanted to work with the playground component. I am coming with one custom. It's not perfect at all but it's a start
  • q

    quick-gpu-68223

    04/25/2021, 8:15 AM
    usage
    Copy code
    js
    <Playground :test="BaseInput" :events="['input']" />
  • q

    quick-gpu-68223

    04/25/2021, 8:17 AM
    it generate interaction automatically
  • q

    quick-gpu-68223

    04/25/2021, 8:18 AM
    it just look likes shit ^^
  • s

    stocky-dream-36427

    04/25/2021, 6:25 PM
    Oooh. This this is cool
  • q

    quick-gpu-68223

    04/25/2021, 8:47 PM
    it can be improve a lot i think
  • t

    thousands-lawyer-86765

    04/27/2021, 3:50 PM
    I tried to get the component testing libs going with quasar, but was running into webpack issues. The project I'm working on has a bit of an older quasar base. I tried a fresh quasar+vue-cli + cypress components, but it doesn't attach quasar to the vue components... Anyhow, anyone have any luck making them work together in any versions?
  • b

    bulky-sundown-74498

    04/27/2021, 6:21 PM
    Not yet tabmow
  • b

    bulky-sundown-74498

    04/27/2021, 6:21 PM
    @User would you mind setting up a bare bones quasar project that I can fork and clone?
  • b

    bulky-sundown-74498

    04/27/2021, 6:23 PM
    A "Button" or "Input" component would also help a lot
  • t

    thousands-lawyer-86765

    04/27/2021, 6:25 PM
    might be a while 😄 but I did find this on the quasar side of things - https://github.com/quasarframework/quasar-testing/issues/163
  • b

    bulky-sundown-74498

    04/27/2021, 6:26 PM
    @User oh no I did not mean to set up a project with cypress in it
1...202122...37Latest