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

    nice-manchester-42957

    07/13/2022, 1:01 PM
    Hi I faced the unknown issue with the
  • n

    nice-manchester-42957

    07/13/2022, 1:02 PM
    Hello everyone I want to enable Test
  • h

    handsome-telephone-90688

    07/13/2022, 1:12 PM
    hi
  • b

    bright-motherboard-31539

    07/13/2022, 1:29 PM
    Seams like is missing something from core-js, but I have the latest version
  • h

    handsome-telephone-90688

    07/13/2022, 1:36 PM
    can anyone here help me out in generating random date.
  • f

    famous-restaurant-30435

    07/13/2022, 1:41 PM
    Moment.js is probably the most popular package for handling dates.
  • f

    famous-restaurant-30435

    07/13/2022, 1:41 PM
    https://www.npmjs.com/package/moment
  • f

    famous-restaurant-30435

    07/13/2022, 1:42 PM
    Its deprecated though so a lot of people are migrating to date-fns
  • f

    famous-restaurant-30435

    07/13/2022, 1:42 PM
    https://date-fns.org/
  • l

    late-planet-4481

    07/13/2022, 2:06 PM
    Google! 🙂 https://stackoverflow.com/a/9035732/5746360
  • r

    rhythmic-guitar-55789

    07/13/2022, 2:06 PM
    I used
    faker
    in the past with great success. https://fakerjs.dev/api/date.html#between
  • a

    acceptable-jordan-87374

    07/13/2022, 3:52 PM
    Anyone know how to modify the build process of Cypress on github? I had to use the flag **'npm install --legacy-peer-deps' **to get my build working but now Cypress seems to also require the flag in order to deal with dependency conflicts. I've looked into my actions/workflows and don't see anywhere where I can change it from npm ci to npm install --legacy-peer-deps
  • e

    elegant-psychiatrist-66173

    07/13/2022, 7:36 PM
    Hello folks. I have a quick question. How can we import the compiler options from a
    jsconfig.json
    file so we can get the right import aliasing for cypress component testing? Do I need to write a custom
    webpack.config
    for this even if we are using CRA? Where else can I read about how the devserver is built and set up?
  • g

    gray-beard-8992

    07/13/2022, 8:07 PM
    Hello, I need some help with Cloud Flare authentication. I implemented a test where I run two Cypress test runners at the same time based on @gray-kilobyte-89541 's blog post using socket.io. It works well locally when I connect through VPN from my laptop to the server. However, when I am trying to put this into our CI pipeline, I am running into the problem where I get the following message: "[187:0713/174146.255608:ERROR:cert_verify_proc_builtin.cc(681)] CertVerifyProcBuiltin for .cloudflareaccess.com failed: ----- Certificate i=0 (OU=Cypress Proxy Server Certificate,O=Cypress Proxy CA,L=Internet,ST=Internet,C=Internet,CN=.cloudflareaccess.com) ----- ERROR: No matching issuer found I need to bypass the Cloud Flare authentication, which I am trying to do by having a beforeEach hook in each test file and where I am doing this: beforeEach(() => { cy.intercept(${Cypress.config('baseUrl')}**, req => { req.headers['CF-Access-Client-ID'] = '***' req.headers['CF-Access-Client-Secret'] = Cypress.env('CF_SECRET') }) }) And I am setting Cypress.env for CF_SECRET in the run.js file where I run both Cypress test runners like this: return cypressAction({ configFile: process.argv[3], env: { CF_SECRET: process.argv[4] }, and I pass the CF_SECRET from the .yaml file that runs in Github. I am not sure why it's not bypassing the CloudFlare certification, any help or ideas would be greatly appreciated! It looks like the headers are not getting set?
  • g

    gray-kilobyte-89541

    07/13/2022, 8:48 PM
    When running on CI, it does not use the VPN, so it is not the same connection as you have locally
  • g

    gray-beard-8992

    07/13/2022, 8:49 PM
    yes exactly, that's why I am trying to bypass this cloudflare by setting the headers for each request, but that doesn't seem to be working for some reason. Is it possible to implement this in CI?
  • g

    gray-kilobyte-89541

    07/13/2022, 8:58 PM
    setting the request headers works the same way. Are you sure you have the
    Cypress.env('CF_SECRET')
    ? How do you pass it to the test runner? Read https://glebbahmutov.com/blog/keep-passwords-secret-in-e2e-tests/
  • b

    breezy-magazine-21205

    07/13/2022, 9:19 PM
    Hello there, is there a way to turn on/off using fixtures when intercepting, so that when I develop the tests it uses fixture data but when I deploy the app it tests using live data?
  • g

    gray-kilobyte-89541

    07/13/2022, 10:07 PM
    you can probably do conditional commands based on some env variable to turn cy.stub
    Copy code
    const isProd = Cypress.env('PROD')
    if (isProd) {
      cy.spy('...').as('foo')
    } else {
      cy.stub('...', {fixture: }).as('foo')
    }
    cy.wait('@foo')
    b
    • 2
    • 1
  • g

    gray-beard-8992

    07/13/2022, 10:27 PM
    In the test runner I have this:
    Copy code
    const cypressAction = args['--open'] ? cypress.open : cypress.run
    const firstCypress = cypressAction({
      configFile: process.argv[2],
      env: {
        CF_SECRET: process.argv[4]
      },
    }).then((results) => {
      console.log('First Cypress has finished')
      return results
    })
    
    // delay starting the second Cypress instance
    // to avoid XVFB race condition
    const secondCypress = wait(5000).then(() => {
      console.log('starting the second Cypress')
      return cypressAction({
        configFile: process.argv[3],
        env: {
          CF_SECRET: process.argv[4]
        },
      })
    })
    And then in the GitHub .yaml file I have this, which I thought would be passing CF_SECRET to the test runner as the 4th parameter:
    npm run ${{ matrix.test }} cypress-dev-user1TipChatNotice.config.js cypress-dev-user2TipChatNotice.config.js ${{ secrets.GHA_CF_SERVICE_ACCESS_TOKEN }}
    Also, tried this: removed from test runner:
    Copy code
    env: {
          CF_SECRET: process.argv[4]
        },
    and in .yaml in Gitghub have this:
    Copy code
    CYPRESS_CF_SECRET=${{ secrets.GHA_CF_SERVICE_ACCESS_TOKEN }} 
     npm run ${{ matrix.test }} cypress-dev-user1TipChatNotice.config.js cypress-dev-user2TipChatNotice.config.js
    I also upgraded to 10.3.0 and now the certification error is gone but in both ways above I am getting a cross-origin error for https://google.com. Am I supposed to use` cy.origin` somewhere when I am trying to bypass the cloudflare authorization?
  • b

    breezy-magazine-21205

    07/13/2022, 11:59 PM
    you can probably do conditional commands
  • g

    gray-kilobyte-89541

    07/14/2022, 12:01 AM
    from the test you can throw an error right away if the
    Cypress.env('CF_SECRET')
    is not set
    g
    • 2
    • 1
  • e

    enough-honey-34178

    07/14/2022, 12:05 AM
    Hi all, I'm running into this issue with the `cypress-example-recipies`: https://github.com/cypress-io/cypress-example-recipes/issues/553. The
    after(sendTestAttributes)
    doesn't appear to run?
  • f

    famous-fireman-83662

    07/14/2022, 8:35 AM
    > Plan Limit Reached: You've reached 102% of your test results for this usage period. I want to delete the test results. What should I do?
  • m

    melodic-jordan-92756

    07/14/2022, 8:53 AM
    Hi all. I want to run .feature in cypress, but i received this error message instead. Everything was fine before. The error happened after i set up the global variable inside cypress.env.json and after i add cy.visit(Cypress.env('homepage_url')) inside step_definitions. What should i do? Thank you.
  • b

    brief-candle-53311

    07/14/2022, 9:51 AM
    kindky assist
  • b

    brief-candle-53311

    07/14/2022, 9:51 AM
    @rhythmic-guitar-55789
  • r

    rhythmic-guitar-55789

    07/14/2022, 10:18 AM
    Hey, I think you can try to delete the AppData\Local\Application Data symlink
  • r

    rhythmic-guitar-55789

    07/14/2022, 10:20 AM
    Hey @melodic-jordan-92756, share the contents of
    cypress.config.js
    in particular the part where you added the new variable.
  • b

    billions-shampoo-89711

    07/14/2022, 12:13 PM
    Hi all! I need some help... I'm sending a request to endpoint A with a body with content-length of 56, endpoint A adds some data to that body (content-length 86) and sends to enpoint B, but it throws and error. My request never reaches endpoint B and throws timeout expecting a body of 86 length (I think cypress does not allow that body adition that endpoint A) Do you know any solution for this? Like allowing changes in bodies or something like that? Thanks!
1...107108109...252Latest