https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • b

    bulky-sundown-74498

    06/03/2021, 11:12 PM
    In my opinion, Early on in a project, you want to build components in isolation. If you use TDD, you can clearly see what part is covered and avoid creating components that won't be useful. But this coverage is local and does not say anything about the way your app works. It tells you how your TESTS work in isolation. It gives you info about the components but not the app itself.
  • b

    bulky-sundown-74498

    06/03/2021, 11:13 PM
    You could have all components working and 100% tested and have an app that is failing miserably because all component are used improperly
  • b

    bulky-sundown-74498

    06/03/2021, 11:14 PM
    So I like to know what part of my code is tested in integration and what is tested in isolation
  • b

    bulky-sundown-74498

    06/03/2021, 11:14 PM
    This is really an opinion and I know it is not of everyone
  • b

    bulky-sundown-74498

    06/03/2021, 11:16 PM
    Unit testing => a dev/refactor tool
  • b

    bulky-sundown-74498

    06/03/2021, 11:16 PM
    E2E testing => a safety net
  • b

    bulky-sundown-74498

    06/03/2021, 11:17 PM
    I should post about this vision
  • c

    cool-application-67821

    06/03/2021, 11:17 PM
    very true but the intention of that why is different, the intention or purpose of a coverage is to know how much of your code is tested and how much is pending, whether it is in isolated or integrated shouldnt matter, isnt it? If i have an application with 5 components and used in 6 places to be tested for integration then when i look for coverage i wonder if a dev would/should think about is the coverage from isolated or integration environment True these are opinionated topics
  • b

    bulky-sundown-74498

    06/03/2021, 11:18 PM
    If I want to know if my app is safe from regressions I will need more e2e code coverage
  • c

    cool-application-67821

    06/03/2021, 11:18 PM
    one final question, and after this I think i have successfully setup a cypress testing for my teams huge react app including component testing, e2e testing, unit testing, snapshot testing, coverage
  • b

    bulky-sundown-74498

    06/03/2021, 11:19 PM
    If I am about to refactor a part of my code I would really hope that component tests about this fully cover that part
  • c

    cool-application-67821

    06/03/2021, 11:19 PM
    When I run e2e testing it says found only unit tet code coverage, i wonder why, it doesnt show coverage of code under e2e
  • c

    cool-application-67821

    06/03/2021, 11:21 PM
    "If I want to know if my app is safe from regressions I will need more e2e code coverage" Very fair point. Also, i didn mean I would be writing tests only for coverage purpose, I would be writing enough tests based on the test-cases that are required rather than just coverage purpose, coverage is just one of the tool i would be using to get a decent idea
  • c

    cool-application-67821

    06/03/2021, 11:23 PM
    that file containing e2e testing has no unit tests or imports at all.
  • b

    bulky-sundown-74498

    06/03/2021, 11:24 PM
    did you load the support from cypress/code-coverage ?
  • c

    cool-application-67821

    06/03/2021, 11:25 PM
    this is my support file
  • b

    bulky-sundown-74498

    06/03/2021, 11:25 PM
    this error is triggered here https://github.com/cypress-io/code-coverage/blob/master/support.js
  • c

    cool-application-67821

    06/03/2021, 11:27 PM
    I see it fails if windowCoverageObjects.length but succeeds window.__coverage__.length
  • b

    bulky-sundown-74498

    06/03/2021, 11:29 PM
    To track it down I would put a debugger statement inside your node_modules
  • c

    cool-application-67821

    06/03/2021, 11:45 PM
    thanks a bunch
  • c

    cool-application-67821

    06/03/2021, 11:51 PM
    It looks it is saying the app is not instrumented, I have followed https://docs.cypress.io/guides/tooling/code-coverage#Using-code-transpilation-pipeline instead of nyc, will check why it is not instrumented
  • h

    hallowed-orange-38556

    06/04/2021, 4:02 AM
    Can someone get me some article which compares cypress and selenium. It's advantages, disadvantages, features etc
  • c

    cool-application-67821

    06/04/2021, 5:28 PM
    Sorry but I tried everything that is listed to make sure my react app is instrumented using https://docs.cypress.io/guides/tooling/code-coverage#Using-code-transpilation-pipeline and not using nyc. Step1: Added istanbul to babelrc so it looks like below now Step 2: Cypress open step 3: When running a e2e test using visit() check for window.__coverage__ under App: as specificed here https://github.com/cypress-io/code-coverage#instrument-your-application But i dont see window.__coverage__ What am i missing?
  • c

    cool-application-67821

    06/04/2021, 5:29 PM
    my .nycrc file. I have tried other combinations too but this is my current one.
  • c

    cool-application-67821

    06/04/2021, 5:30 PM
    my .babelrc file
  • c

    cool-application-67821

    06/04/2021, 5:31 PM
    my support file cypress/support/index.js
  • c

    cool-application-67821

    06/04/2021, 5:32 PM
    .babelrc
  • c

    cool-application-67821

    06/04/2021, 5:32 PM
    my cypress/plugin/index.js
  • c

    cool-application-67821

    06/04/2021, 5:37 PM
    The issue is e2e testing coverage does not take place, I get a log msg saying only found unit code coverage
  • c

    cool-application-67821

    06/04/2021, 5:40 PM
    This log too ⚠️ Could not find any coverage information in your application by looking at the window coverage object. Did you forget to instrument your application? See code-coverage#instrument-your-application [@cypress/code-coverage]
1...789...192Latest