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

    ancient-zoo-12002

    05/09/2022, 8:30 AM
    https://github.com/cypress-io/cypress/issues/18947 deleted all of Cypress folders : "roaming , app data , modules " & reinstall That would do the job
  • g

    gifted-boots-63851

    05/09/2022, 8:35 AM
    hi, how can I import
    firebase
    in my tests on the browser side? I have this error
    SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
    I tried to fix this by using webpack/ts-loader/etc. but it seems to create conflict with
    nuxt
    what is using these packages, and thus I can't launch my project. here's the code I'm trying to run:
    Copy code
    ts
    // cypress/support/command.ts
    
    import { initializeApp } from 'firebase/app' // this import causes the error
    
    
    const app = initializeApp({
      // config
    })
  • g

    gifted-boots-63851

    05/09/2022, 9:27 AM
    my issue evolved:
    Copy code
    Error: Webpack Compilation Error
    /Users/anon/project/cypress/tsconfig.json
    [tsl] ERROR
          TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["**/*.ts"]' and 'exclude' paths were '["../node_modules","../.nuxt","../dist","../cypress/**/*","../**/*.stories.js","../**/*.stories.ts"]'.
    in the file preprocessor hook, I use either cucumber or webpack now
  • g

    gifted-boots-63851

    05/09/2022, 9:50 AM
    ok finally done, here's the cypress plugin, hope it can help someone:
    Copy code
    ts
    const webpackOptions = {
            webpackOptions: {
              mode: 'development',
              resolve: {
                extensions: ['.ts', '.js'],
              },
              module: {
                rules: [
                  {
                    test: /\.ts$/,
                    exclude: [/node_modules/],
                    use: [
                      {
                        loader: 'ts-loader',
                        options: {
                          // skip typechecking for speed
                          transpileOnly: true,
                        },
                      },
                    ],
                  },
                ],
              },
            },
          }
    
    const options = {
        ...browserify.defaultOptions,
        typescript: require.resolve('typescript'),
      }
    
      on('file:preprocessor', (file: any) => {
        return file.filePath.includes('.feature')
          ? cucumber(options)(file)
          : webpack(webpackOptions)(file)
      })
    NOTE: a better way is to use webpack to also preprocessed
    .feature
    file with cucumber https://github.com/badeball/cypress-cucumber-preprocessor/blob/v9.1.0/examples/webpack/cypress/plugins/index.ts
  • c

    curved-intern-4253

    05/09/2022, 2:03 PM
    https://docs.cypress.io/guides/references/troubleshooting#Patch-Cypress describes how you can patch
    cypress
    module itself. But this doesn't let me change the Test Runner code, because that isn't in
    node_modules/cypress
    . Is there a way to similarly make patches to Test Runner and commit them to git?
  • s

    sparse-sandwich-95566

    05/09/2022, 2:08 PM
    Hi! Does anyone here runs Cypress with WSL2? I have been trying to run some tests for a couple days now without any success, I can´t even get it to open, it just timesout. I have followed a couple tutorials, including the ones from Cypress. I have the display and the libs in place, but it just keeps on timing out, and I have runned out of gitHub issues to follow
  • c

    curved-intern-4253

    05/09/2022, 2:25 PM
    I am. I wasn't able to run it with the recommended X servers (and it similarly timed out), but https://mobaxterm.mobatek.net/ worked. In addition, afterwards
    --browser chrome
    was required, the default
    electron
    didn't work, but it had very different symptoms https://github.com/cypress-io/cypress/issues/19258
  • g

    gentle-accountant-4760

    05/09/2022, 2:42 PM
    Hello! I wonder whats the difference when using each together with $ or not? Basically why doesnt it work without $ but works with $ when doing for each?
  • g

    gentle-accountant-4760

    05/09/2022, 2:44 PM
    WORKS
    Copy code
    ts
    arrayTest = [];
    cy.get('#test').should('be.visible').each(($el) => {
      arrayTest.push($el.text().replace(/\./g, ''));
    });
    DOESNT WORK
    Copy code
    ts
    arrayTest = [];
    cy.get('#test').should('be.visible').each((el) => {
      arrayTest.push(el.text().replace(/\./g, ''));
    });
  • g

    gray-kilobyte-89541

    05/09/2022, 2:45 PM
    why do you think it works in the first case and does not work in the second case? it is just a variable name
  • b

    bored-dinner-46643

    05/09/2022, 2:55 PM
    how do you force a response with a status 500 in a cy.intercept like this ? cy.intercept('**/dashboard/details/*', { response: {}, status: 500 });
  • m

    magnificent-finland-58048

    05/09/2022, 4:28 PM
    I've never seen that. $ is just a convention for redability
  • m

    magnificent-finland-58048

    05/09/2022, 4:31 PM
    here's a working example https://github.com/muratkeremozcan/fastify-example-tests/blob/main/cypress/integration/spec28.js considering getting Gleb's course, it will help you master all that https://cypress.tips/courses
  • m

    magnificent-finland-58048

    05/09/2022, 4:33 PM
    I recall wrestling this a year ago, and running into limitations with WSL2 Whatever is failing, try it vs a control group, where you either have a linux box, or you're running a linux vm. If what you're trying fails on both WSL and Linux box/vm, it's user error that you can address.
  • s

    sparse-sandwich-95566

    05/09/2022, 4:35 PM
    I will look into it, thank you for the suggestion
  • s

    sparse-sandwich-95566

    05/09/2022, 4:38 PM
    It is failling only on the wsl, but it is running ok on windows thru git bash, but then it gets connection refused from mi API running on the localHost which is why I went into WSL. I have tried all the users error I could think of, from node version to downgrading to checking display and all, but it still just times out
  • g

    gray-kilobyte-89541

    05/09/2022, 5:25 PM
    beautiful test
  • w

    wonderful-author-91008

    05/09/2022, 9:38 PM
    Hi, Is there any way to generate xml test report using cypress that can be publish in azure devops, currently azure devops does not support html reports. so that test result (snapshot) can be attached to failing tests.
  • f

    full-postman-68262

    05/10/2022, 11:37 AM
    Hey Cypress friends. I'm having an issue with connecting to Cypress Dashboard locally. I've got both the record key and project ID set in env vars, and I can see tests running with these values in our CI/CD absolutely fine. But when I do it locally, I get the following error
    Copy code
    We encountered an unexpected error talking to our servers.
    
    We will retry 3 more times in 30 seconds...
    
    The server's response was:
    
    RequestError: Error: connect ECONNREFUSED 127.0.0.1:1234
    Does anyone have any ideas if there's any sort of system settings that can impact with my machine connecting up to Dashboard? Currently using an M1 Mac. I'm wracking my brain, but I've not seen any system config mentioned in any of the Cypress docs.
    • 1
    • 1
  • f

    full-postman-68262

    05/10/2022, 11:48 AM
    Hey Cypress friends I m having an issue
  • l

    little-france-10142

    05/10/2022, 10:40 PM
    I have a very simple page. I'm just trying to insure that when I click the links the user is navigated to the right page, and then go back. I read https://filiphric.com/testing-links-with-cypress to no avail. I must be missing something. Here's a SS of what I'm working with and the code.
    Copy code
    it('checks all links', () => {
      cy.visit('http://localhost:3000/logout')
    
      cy.contains('login').click()
      cy.location('pathname').should('eq', '/login')
      cy.go('back')
    })
    g
    • 2
    • 11
  • a

    adventurous-umbrella-97585

    05/11/2022, 3:17 AM
    Hi, I use the following commands in my test cy.get('textarea').click({force:true}).type('{upArrow}') and then cy.get('button2').click()- Reset the above text area to empty. Anyone knows why its happening-? Browser Electron
  • e

    echoing-painting-40909

    05/11/2022, 3:58 AM
    Hi, besides
    .click({force: true})
    not being required to type in a field, the purpose of the button is missing in your explanation. That's not the default behavior and I'm not able to reproduce it based on the context provided.
  • a

    adventurous-umbrella-97585

    05/11/2022, 4:06 AM
    I couldn't run without {force:true} as the element is being covered by another error message pop up without it
  • e

    echoing-painting-40909

    05/11/2022, 4:12 AM
    If you can't, it's about the same for a user: By forcing it, you are testing something which will never be going to happen for them.
  • a

    adventurous-umbrella-97585

    05/11/2022, 4:15 AM
    This text box has an up-down arrow which is the only possible way to enter the field. Key in is being restricted. And that's why I used click and then type{}.
  • c

    creamy-minister-50636

    05/11/2022, 9:11 AM
    I have Cypress installed on my PC with some external plug-ins (cypress-grep, cypress-keycloak etc.). How can I install Cypress on another machine and have my dependencies installed there? (expect manually re-installing). I should be copying my package.json I guess, but what then?
  • g

    gray-kilobyte-89541

    05/11/2022, 10:36 AM
    npm install
  • a

    aloof-lifeguard-45424

    05/11/2022, 10:43 AM
    I do get a ECONNRESET error when trying to run Cypress and it is completely blocking me. Any help will be greatly appreciated. I have simply cloned [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) and ran
    npm run cy:open
    which is the script that runs this exact command
    cypress open
    The console opens, I click on the first test and then it crashes with the console closing and with and error in the terminal, reproduced bellow:
  • a

    aloof-lifeguard-45424

    05/11/2022, 10:43 AM
    Copy code
    $ npm run cy:open
    
    > cypress-example-kitchensink@0.0.0-development cy:open C:\Users\jboghean\Desktop\cypress-example-kitchensink
    > cypress open
    
    
    [8488:0511/095408.702:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is 
    GET /__/ 200 5.242 ms - -
    GET /__cypress/runner/cypress_runner.css 200 4.690 ms - -
    GET /__cypress/runner/cypress_runner.js 200 2.942 ms - -
    GET /v1/buckets/monitor/collections/changes/changeset?collection=query-stripping&bucket=main&_expected=0 200 672.765 ms - -
    GET /v1/buckets/monitor/collections/changes/changeset?collection=message-groups&bucket=main&_expected=0 200 675.964 ms - -
    GET /__cypress/runner/favicon.ico 200 3.398 ms - -
    GET /v1/buckets/main/collections/query-stripping/changeset?_expected=1649762862679 200 545.892 ms - -
    GET /v1/buckets/main/collections/message-groups/changeset?_expected=1646250823109 200 548.560 ms - -
    GET /__cypress/runner/fonts/fa-solid-900.woff2 200 2.909 ms - 76120
    GET /__cypress/runner/fonts/mulish-latin-400-normal.woff2 200 3.132 ms - 31176
    GET /chains/remote-settings.content-signature.mozilla.org-2022-05-21-02-53-51.chain 200 681.910 ms - -
    GET /__cypress/runner/fonts/mulish-latin-500-normal.woff2 200 9.813 ms - 31176
    GET /chains/remote-settings.content-signature.mozilla.org-2022-06-10-13-16-32.chain 200 691.777 ms - -
    GET /__cypress/iframes/integration%2F1-getting-started%2Ftodo.spec.js 200 4.484 ms - -
    GET /__cypress/runner/fonts/open-sans-latin-400-normal.woff2 200 7.828 ms - 14380
    GET /v1/buckets/monitor/collections/changes/changeset?collection=cfr&bucket=main&_expected=0 200 538.591 ms - -
    Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db
1...616263...252Latest