https://cypress.io logo
Join Discord
Powered by
# general-chat
  • p

    prehistoric-restaurant-72560

    05/26/2022, 10:53 AM
    I understand that, but still hardcoding test-id selector into cy.getBySel() is discussable for me
    cy.getBySel("bankaccount-new").click();
  • f

    fresh-doctor-14925

    05/26/2022, 11:14 AM
    > I understand that I don’t really get the point of this discussion, then. They’ve already stated a preference for test ids (which can be changed with a search and replace in a code editor). So I’m not sure why they would invest time into providing examples for a model they advise against. It’s all open source, so if you want to make an example that adheres to the POM I’m sure they’d be happy to see it 🙂
  • p

    prehistoric-restaurant-72560

    05/26/2022, 1:49 PM
    Thanks for the answers, I'm coming form selenium where people would praise POM, while Cypress just comes with some common sense, I love that 😄
  • f

    fresh-doctor-14925

    05/26/2022, 5:03 PM
    Yes I used to work in selenium as well. I was initially surprised to hear recommendations against POM, but I like that the test id model places the onus on those building the app to help make it more testable
  • s

    stale-magazine-23991

    05/27/2022, 3:02 PM
    hey guys is it a bad practice use the "it" block to describe each action a test does or should I put everything in one big "it" block?
  • g

    gray-easter-54566

    05/27/2022, 3:05 PM
    Hey @stale-magazine-23991 . Hopefully this link helps answer that question 😃 https://docs.cypress.io/guides/references/best-practices#Creating-tiny-tests-with-a-single-assertion
  • s

    stale-magazine-23991

    05/27/2022, 3:06 PM
    thanks @gray-easter-54566
  • c

    creamy-greece-10206

    05/27/2022, 5:09 PM
    Our QA team is experiencing a weird issue. They are running Cypress 9.7. When running the whole suite, using electron or chrome, the application data in the browser reaches 11MB and then stops Cypress. Has anyone else been experiencing something like this?
  • i

    icy-greece-31960

    05/27/2022, 6:01 PM
    How might I fix this, or, is there a better approach to achieving this?
  • a

    adorable-machine-81849

    05/28/2022, 5:39 AM
    Hi Team, I have a email id field in my application.when i enter the wrong email id and I am trying to click a button. I see a pop up message which disappears immediately. I am unable to inspect the element . But i need to validate the text inside the pop up. Has anybody come across this issue. Please suggest me.
  • l

    lemon-yak-55678

    05/28/2022, 4:25 PM
    You may have to lock the dom in place to capture the element. Sometimes, the element is always there but hidden. It depend on the implementation
  • b

    bitter-fountain-36713

    05/28/2022, 4:46 PM
    It may show up on the 'after' image of the click.
  • r

    red-toddler-79937

    05/28/2022, 9:12 PM
    Hi, in the docs: https://docs.cypress.io/guides/references/best-practices
    data-testid
    is never explained, when do I use that one?
  • s

    straight-whale-2716

    05/28/2022, 9:33 PM
    Does anyone else here have to wait about 5 minutes from the time they type
    npx cypress run
    and press Enter until the Cypress UI displays?
  • r

    red-toddler-79937

    05/28/2022, 10:25 PM
    no, however, sometimes it doesn't load for me and then i have to rerun the command.
  • r

    red-toddler-79937

    05/28/2022, 10:25 PM
    Should take no more than 30 secs. Well also ofc depending on your pc specs
  • e

    echoing-painting-40909

    05/29/2022, 8:31 AM
    It's an arbitrary attribute. You might as well use
    data-cypress
    in place of
    data-cy
    .
  • r

    red-toddler-79937

    05/29/2022, 8:47 AM
    Ah cool, what about
    data-testid
    ? Is that also arbitrary?
  • e

    echoing-painting-40909

    05/29/2022, 8:53 AM
    Exactly, the goal is to stick to an attribute you created for the lone purpose of testing
  • r

    red-toddler-79937

    05/29/2022, 8:54 AM
    oww cool, thx!! 😄
  • g

    green-continent-58391

    05/29/2022, 9:52 PM
    Hello, When I try this, cypress enters only one or two integers and moves on to the next step. cy.get('#autocomplete-input').type('12345') But if It try: cy.get('#autocomplete-input').type('1') cy.get('#autocomplete-input').type('2') cy.get('#autocomplete-input').type('3') cy.get('#autocomplete-input').type('4') It enters and retains the text. Is there a better way to approach this? Thank you!
  • b

    bitter-fountain-36713

    05/30/2022, 4:54 AM
    @green-continent-58391 You should check to see how your app reacts to the typing into that input.
  • m

    mammoth-electrician-64243

    05/30/2022, 6:55 AM
    In my cypress project I use
    fakerjs
    . In a spec file I have a
    request
    to a javascript file which generates an object with faker. Running this file alone works. However when starting my tests, I get
    Error: Webpack Compilation Error
    . This morning I updated
    fackerjs
    , and now I see that the files in the
    node_modules\@faker-js\faker\esm\
    are now actually
    mjs
    files. This wasn't the case before. I think I need to configure a setting in cypress for these files but I'm not sure where. Can someone advise?
  • w

    wonderful-wire-43244

    05/30/2022, 8:27 AM
    Hi folks, I'm coming from Codeception/Selenium and am pretty hyped about cypress. I'm writing my first tests and I'm running into an issue. First of all, I have a one-pager to setup my app, which at the end does a bunch of ajax requests. Is there a way to intercept all ajax requests and not just the first? While the number of requests right now is fixed, I don't really want to setup an intercept for each one, but simply wait for all of them to be done. The second issue is, that at the end of the different ajax requests, I'm doing a redirect to a finish page and it seems as if the session isn't kept in that moment. I say that, because the language switches, even though that doesn't happen when doing the steps manually outside of the tests. Can anybody give me some hints there?
  • l

    lemon-yak-55678

    05/30/2022, 1:33 PM
    Haven’t tried intercepting ajax, but you should be able to intercept any call. You can also use a wildcard to intercept multiple with the same intercept. Cypress does the waits automatically in most cases. You may need to look at multiple domain support, depending on how your app is structured
  • i

    important-park-97069

    05/30/2022, 3:25 PM
    FWIW I use faker with latest cypress and have no issues. I know Faker had an issue where the owner of the repo purposefully pushed bad code to make some statement about open source being exploited -- it was a little while back though, but I had to make sure to get Faker from the new forked version. I'd say start my making sure you have latest faker. What do your module import statements look like for faker as well, because later versions of faker use the more modern ES import syntax
  • i

    important-park-97069

    05/30/2022, 3:26 PM
    I HAVE run into that error, though -- this is a bit of an "Is it plugged in" question but did you try blowing away and reinstalling node_modules
  • i

    important-park-97069

    05/30/2022, 3:26 PM
    because .... that often works 😂
  • d

    dry-furniture-93469

    05/30/2022, 6:16 PM
    Hey Any ideas about this? https://github.com/cypress-io/cypress/issues/21876
  • d

    dazzling-cartoon-99399

    05/31/2022, 1:23 AM
    Hello guys. I am trying to use the cy.clock feature but it's not working for me. I am on mac and I am testing a react app. When using clock, the visit command will hang forever.
1...434445...127Latest