https://cypress.io logo
Join Discord
Powered by
# help
  • v

    victorious-queen-73209

    10/03/2022, 11:17 AM
    Combine karma unit test case and cypress integration test coverage
    • 1
    • 1
  • s

    stale-wire-41120

    10/03/2022, 11:20 AM
    @mysterious-belgium-25713 i am trying to create html report but showing error
  • m

    mysterious-belgium-25713

    10/03/2022, 11:28 AM
    Your npm install command is missing. cypress-mochawesome-reporter
  • m

    mammoth-flower-57564

    10/03/2022, 12:00 PM
    Hi. Why if my tests do not pass, the cypress dashboard is loading a huge amount of time? Can these tests fail somehow? Status is fail everywhere and the cypress dashboard is on the go. Is it about a business plan that allows you to automatically fail tests?
  • d

    dry-battery-91871

    10/03/2022, 1:34 PM
    I see, thank you! We'll just have to look for another way to do semi-automated testing then.
  • c

    cool-toothbrush-53313

    10/03/2022, 1:58 PM
    cy.get('#username').type(
    ${Cypress.env().username_default_imp}
    , { log: false }); At this step I'm getting error (uncaught exception)TypeError: Cannot read properties of undefined (reading 'length'). Did anyone face similar error.
  • f

    famous-restaurant-30435

    10/03/2022, 1:59 PM
    Your string interpolation syntax is incorrect. cy.get('#username').type(
    ${Cypress.env().username_default_imp}
    , { log: false })
  • f

    famous-restaurant-30435

    10/03/2022, 1:59 PM
    Oh nevermind I see that the Discord formatting removed it.
  • f

    famous-restaurant-30435

    10/03/2022, 2:00 PM
    But also thats now how you access ENV vars
  • f

    famous-restaurant-30435

    10/03/2022, 2:00 PM
    https://docs.cypress.io/guides/guides/environment-variables#Setting
  • f

    famous-restaurant-30435

    10/03/2022, 2:00 PM
    Copy code
    cy.request(Cypress.env('EXTERNAL_API'))
    See the example above and the docs.
  • c

    cool-toothbrush-53313

    10/03/2022, 2:03 PM
    Thanks for immediate reply I tried with hard coded text too but I do see the same error
  • f

    famous-restaurant-30435

    10/03/2022, 2:07 PM
    I imagine you are seeing the error about .length because there is nothing for Cypress to type meaning that there is nothing being returned from your Cypress.env command. Can you make sure you are accessing the ENV variable correctly?
  • c

    cool-toothbrush-53313

    10/03/2022, 2:14 PM
    Might be some issue with the cypress?. I just kept it simple step definition, below is the code works for the first time and when I try to rerun the same again it is giving me the error: When("User visits QPP Home Page", () => { cy.visit(); cy.get(
    #mainContent
    ).should('be.visible'); cy.contains('Manage Account').click(); });
  • a

    acceptable-hamburger-48790

    10/03/2022, 2:16 PM
    Any reason why you are using .type(${Cypress.env().username_default_imp}, { log: false }); - The ${} is usually used inside string literal . You should be just using cy.get('#username').type(Cypress.env().username_default_imp, { log: false })
  • g

    gray-kilobyte-89541

    10/03/2022, 2:21 PM
    https://glebbahmutov.com/blog/cypress-v10-env/
  • c

    cool-toothbrush-53313

    10/03/2022, 2:21 PM
    Yes you are right. We tried to use the same code that was working fine before we upgraded to Cypress 10. If you check my above simple code. I'm getting similar error without any variables too
  • m

    mammoth-sugar-52290

    10/03/2022, 3:29 PM
    Hello, does anyone know what this problem can be about or have you never seen it?
  • n

    narrow-artist-87113

    10/03/2022, 5:05 PM
    What can you understand by this?
  • c

    cool-toothbrush-53313

    10/03/2022, 5:19 PM
    @here I was able to resolve this by adding below code in e2e.ts. Cypress.on('uncaught:exception', (err, runnable) => { // returning false here prevents Cypress from // failing the test return false })
  • s

    stale-wire-41120

    10/03/2022, 7:40 PM
    Is there any simple way that teach us how to instrument during code coverage
  • s

    salmon-apple-69375

    10/03/2022, 7:47 PM
    Hi! First comment here 🙂 HELP! In a test I'm working on, Cypress goes to a page, select an option from a dropdown, then clicks the Buy Now button and continues the flow. The issue is that after Cypress clicks the Buy Now button, the site fails with the following error message: "cypress_runner.js:163397 Uncaught TypeError: getWindowTop(...).ShowAddToCartSavedModal is not a function" (Image1.png) This functions are createad in a functions.js that is loaded at the beginning. And I'm even being able to console.log those methods in the middle of the tests (Image2.png) When I make the same steps manually it works, but I run thourgh Cypress it fails. It would look as if the file/methods were being loaded
  • m

    mysterious-belgium-25713

    10/03/2022, 7:51 PM
    How do you call the ShowAddToCartSavedModal function?
  • s

    salmon-apple-69375

    10/03/2022, 7:54 PM
    I tried just putting ShowAddToCartSavedModal in the browser console. If I do this in the "Manual test" I see the method definition. In the Cypress browser, I don't
  • m

    mysterious-belgium-25713

    10/03/2022, 7:55 PM
    So it's not a custom created cypress function? This is something in your webapp?
  • s

    salmon-apple-69375

    10/03/2022, 7:56 PM
    Yes, exactly. I forgot to add that detail. It seems that for some weird reason, this file or methods are not being loaded at all when I ran the Cypress UI
  • m

    mysterious-belgium-25713

    10/03/2022, 8:03 PM
    If you do all the same steps manual will this error also pop up in your console?
  • s

    salmon-apple-69375

    10/03/2022, 8:06 PM
    Nope. And If I run "ShowAddToCartSavedModal" in the browser console, I see the method
  • m

    mysterious-belgium-25713

    10/03/2022, 8:08 PM
    Also in your first screenshot i see devtools failed to load something. With a 404. Is there something blocking cypress from getting JS files. Why it's not able to load the functions?
  • s

    salmon-apple-69375

    10/03/2022, 8:17 PM
    I wouldn't be sure, but I see the same warning if I open the site "manually"
1...161162163...252Latest