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

    bulky-sundown-74498

    05/03/2021, 5:35 PM
    One of the most common issues one can have with cypress...
  • b

    bulky-sundown-74498

    05/03/2021, 5:37 PM
    Cypress runs in an iframe, so if the site you are targeting refuses to be put in iframe (google, facebook, twitter), or behaves differently in this context you might have some unfortunate consequences
  • b

    bulky-sundown-74498

    05/03/2021, 5:38 PM
    At my prev job, there was a JavaScript check in the code to know if the current page was a Popup.... the check was
    if(window.parent)
    and that's it... we stuggled a bit to find the culprit
  • a

    alert-photographer-39416

    05/03/2021, 5:38 PM
    ahhhh i see
  • a

    alert-photographer-39416

    05/03/2021, 5:39 PM
    so, theres literally nothing that can be done to work around it for her small test case
  • b

    bulky-sundown-74498

    05/03/2021, 5:39 PM
    Let me check
  • b

    bulky-sundown-74498

    05/03/2021, 5:44 PM
    I don't know any yet
  • b

    bulky-sundown-74498

    05/03/2021, 5:44 PM
    If I find one I'll point you to it
  • b

    bulky-sundown-74498

    05/03/2021, 5:44 PM
    https://github.com/cypress-io/cypress/issues/14385
  • a

    alert-photographer-39416

    05/03/2021, 5:44 PM
    no worries! thanks
  • f

    future-gold-77198

    05/04/2021, 9:52 PM
    I would like to make additional requests depending on the response of an intercepted request. Is this simply just not possible, as this error seems to imply, or am I just implementing it incorrectly?
  • f

    future-gold-77198

    05/04/2021, 10:29 PM
    ok, I was doing it wrong. I failed to read the documentation about aliasing and what the cy.wait('@route') would yield. Previously I had tried to access the body directly within a .then from the wait, not from the whole intercept. this works
  • b

    bulky-sundown-74498

    05/05/2021, 1:29 AM
    @User this discovery only is worth a blog post. Add this to your work on component testing and you have a full blog ☺️
  • f

    future-gold-77198

    05/05/2021, 4:01 AM
    Well, I wish me and writing got along better. Takes me a long time to write to my satisfaction. Maybe someday though 🙂
  • p

    purple-afternoon-2408

    05/07/2021, 4:11 AM
    Hello everyone,
    taskCoverage
    is failing because of
    coverage no such file or directory coverage\...\node_modules\moment\locale sync ^\.*$.html
    , can anyone help please?
  • g

    gray-kilobyte-89541

    05/07/2021, 6:02 PM
    What's the plugin's version you are using, since we have removed using Cypress.moment
  • f

    future-baker-50174

    05/10/2021, 12:24 PM
    Is there a way to turn off animations and transitions for the e2e tests? (I am using Vue + Vuetify)
  • s

    stocky-dream-36427

    05/10/2021, 5:35 PM
    Maybe? I don't think so though. What's the problem you're seeing? Cypress does a bunch of crazy stuff to actually await for the animations to finish. Component tests definitely also have support for it if you're using , but I don't think e2e does. CC @User
  • f

    future-baker-50174

    05/11/2021, 7:48 AM
    The problem is that the tests take so long time, and I believe animations is an important reason to that.
  • u

    user

    05/11/2021, 12:17 PM
    You'd probably need to add a class at the start of the test to the body. Then in your CSS if that is set (like "is-testing") then turn off animations etc. Also in all cases you may not want to disable animations (why this methodology is good) because some JS code may be dependent upon them to get ran. So if you're trying to test your code upon those APIs, they need to run.
  • b

    bulky-sundown-74498

    05/11/2021, 12:30 PM
    Use a faster timing if you can. This will allow you to do both;)
  • b

    bulky-sundown-74498

    05/11/2021, 12:30 PM
    Instead of removing them
  • p

    purple-afternoon-2408

    05/12/2021, 1:16 AM
    Hello @User , I am using
    "@cypress/code-coverage": "^3.9.2",
    if this is what you are referring to
  • g

    gray-kilobyte-89541

    05/12/2021, 3:26 AM
    make sure you are using the latest version, just to be safe
  • n

    nutritious-restaurant-91514

    05/12/2021, 8:01 PM
    Heyo 🙂 I’m building myself a vue 3 + vite app + typescript (I know, very fancy 😄 ) I have been playing around with code coverage for that app and I have been successful with instrumenting my files. However, it seems there’s something about the instrumentation I’m not doing quite right. I have
    .vue
    components which look a little weird in the coverage report. it seems that the template and style is also getting instrumented, which (I guess) is not the thing I want. the
    babel.config.js
    I’m using has a configuration like this:
    Copy code
    js
    module.exports = {
      presets: [
        '@vue/app'
      ],
      plugins: [
        ['babel-plugin-istanbul', {
          extension: ['.ts', '.vue']
        }]
      ]
    }
    If you have any idea what might be wrong about this, I’d be super happy if you help me. Have an awesome day!
  • p

    purple-afternoon-2408

    05/13/2021, 5:52 AM
    Hello Bahmutov, I did update to
    "@cypress/code-coverage": "^3.9.5"
    , but still I am getting an error:
    Copy code
    CypressError: cy.task('coverageReport') timed out after waiting 180000ms.
    
    https://on.cypress.io/api/task
    
    Because this error occurred during a `after all` hook we are skipping all of the remaining tests.
          at http://localhost:4200/__cypress/runner/cypress_runner.js:140408:19
          at tryCatcher (http://localhost:4200/__cypress/runner/cypress_runner.js:10791:23)
          at http://localhost:4200/__cypress/runner/cypress_runner.js:5913:41
          at tryCatcher (http://localhost:4200/__cypress/runner/cypress_runner.js:10791:23)
          at Promise._settlePromiseFromHandler (http://localhost:4200/__cypress/runner/cypress_runner.js:8726:31)
          at Promise._settlePromise (http://localhost:4200/__cypress/runner/cypress_runner.js:8783:18)
          at Promise._settlePromise0 (http://localhost:4200/__cypress/runner/cypress_runner.js:8828:10)
          at Promise._settlePromises (http://localhost:4200/__cypress/runner/cypress_runner.js:8904:18)
          at _drainQueueStep (http://localhost:4200/__cypress/runner/cypress_runner.js:5498:12)
          at _drainQueue (http://localhost:4200/__cypress/runner/cypress_runner.js:5491:9)
          at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:4200/__cypress/runner/cypress_runner.js:5507:5)
          at Async.drainQueues (http://localhost:4200/__cypress/runner/cypress_runner.js:5377:14)
      From Your Spec Code:
          at Context.generateReport (http://localhost:4200/__cypress/tests?p=cypress\support\index.ts:756:8)
  • p

    purple-afternoon-2408

    05/13/2021, 5:56 AM
    I think it fails here:
    Copy code
    after(function generateReport() {
        // when all tests finish, lets generate the coverage report
        const logInstance = Cypress.log({
          name: 'Coverage',
          message: ['Generating report [@cypress/code-coverage]']
        })
        cy.task('coverageReport', null, {
          timeout: dayjs.duration(3, 'minutes').asMilliseconds(),
          log: false
        }).then((coverageReportFolder) => {
          logInstance.set('consoleProps', () => ({
            'coverage report folder': coverageReportFolder
          }))
          logInstance.end()
          return coverageReportFolder
        })
      })
  • p

    purple-afternoon-2408

    05/14/2021, 12:11 AM
    When using
    DEBUG=cypress:*
    , I see additional info:
    Copy code
    CypressError: cy.task('combineCoverage') timed out after waiting 60000ms.
    
    https://on.cypress.io/api/task
    
    Because this error occurred during a `after each` hook we are skipping all of the remaining tests.
          at http://localhost:4200/__cypress/runner/cypress_runner.js:140408:19
          at tryCatcher (http://localhost:4200/__cypress/runner/cypress_runner.js:10791:23)
          at http://localhost:4200/__cypress/runner/cypress_runner.js:5913:41
          at tryCatcher (http://localhost:4200/__cypress/runner/cypress_runner.js:10791:23)
          at Promise._settlePromiseFromHandler (http://localhost:4200/__cypress/runner/cypress_runner.js:8726:31)
          at Promise._settlePromise (http://localhost:4200/__cypress/runner/cypress_runner.js:8783:18)
          at Promise._settlePromise0 (http://localhost:4200/__cypress/runner/cypress_runner.js:8828:10)
          at Promise._settlePromises (http://localhost:4200/__cypress/runner/cypress_runner.js:8904:18)
          at _drainQueueStep (http://localhost:4200/__cypress/runner/cypress_runner.js:5498:12)
          at _drainQueue (http://localhost:4200/__cypress/runner/cypress_runner.js:5491:9)
          at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:4200/__cypress/runner/cypress_runner.js:5507:5)
          at Async.drainQueues (http://localhost:4200/__cypress/runner/cypress_runner.js:5377:14)
      From Your Spec Code:
          at sendCoverage (http://localhost:4200/__cypress/tests?p=cypress\support\index.ts:545:6)
          at eval (http://localhost:4200/__cypress/tests?p=cypress\support\index.ts:658:7)
      at Array.forEach (<anonymous>)
          at Context.eval (http://localhost:4200/__cypress/tests?p=cypress\support\index.ts:657:27)
  • s

    stocky-dream-36427

    05/14/2021, 2:49 AM
    @User can you use the multi-line code fence to format? ```
  • s

    stocky-dream-36427

    05/14/2021, 2:50 AM
    If you can give us a full reproduction in an isolated environment, then we can help, but it's a bit challenging otherwise
12345...192Latest